From 4bf48b58019413f8760d52cf82d553a56b082b55 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Thu, 3 Aug 2017 21:32:18 +0100 Subject: [PATCH 1/2] Reset tripwire --- src/freedombone-base-tripwire | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/freedombone-base-tripwire b/src/freedombone-base-tripwire index cf89b91b..2f44b086 100755 --- a/src/freedombone-base-tripwire +++ b/src/freedombone-base-tripwire @@ -90,7 +90,7 @@ function install_tripwire { # make a script for easy resetting of the tripwire echo '#!/bin/sh' > /usr/bin/reset-tripwire - echo 'tripwire --update-policy --secure-mode low /etc/tripwire/twpol.txt' >> /usr/bin/reset-tripwire + echo 'tripwire -m i' >> /usr/bin/reset-tripwire chmod +x /usr/bin/reset-tripwire sed -i '/# These files change the behavior of the root account/,/}/ s/.*//g' /etc/tripwire/twpol.txt From 23f541964e9b4ab973da297c9f90ed006d3044f4 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Fri, 4 Aug 2017 18:12:01 +0100 Subject: [PATCH 2/2] Add tripwire check as a cron job --- src/freedombone-base-tripwire | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/freedombone-base-tripwire b/src/freedombone-base-tripwire index 2f44b086..2c0db7eb 100755 --- a/src/freedombone-base-tripwire +++ b/src/freedombone-base-tripwire @@ -75,10 +75,11 @@ function install_tripwire { echo 'EMAILREPORTLEVEL =3' >> /etc/tripwire/twcfg.txt echo 'REPORTLEVEL =3' >> /etc/tripwire/twcfg.txt echo 'SYSLOGREPORTING =false' >> /etc/tripwire/twcfg.txt - echo 'MAILMETHOD =SMTP' >> /etc/tripwire/twcfg.txt + echo 'MAILMETHOD =SENDMAIL' >> /etc/tripwire/twcfg.txt echo 'SMTPHOST =localhost' >> /etc/tripwire/twcfg.txt echo 'SMTPPORT =25' >> /etc/tripwire/twcfg.txt echo 'TEMPDIRECTORY =/tmp' >> /etc/tripwire/twcfg.txt + echo 'MAILFROMADDRESS =tripwire@$(HOSTNAME)' >> /etc/tripwire/twcfg.txt echo ' @@ -117,6 +118,7 @@ function install_tripwire { sed -i 's|$(TWETC)/tw.pol.*||g' /etc/tripwire/twpol.txt # site key name sed -i 's|$(TWETC)/site.key|$(TWETC)/$(HOSTNAME)-site.key|g' /etc/tripwire/twpol.txt + # create the policy echo ' @@ -137,6 +139,10 @@ function install_tripwire { ' | reset-tripwire + TRIPWIRE_MIN=$((1 + RANDOM % 49)) + TRIPWIRE_HOUR=$((1 + RANDOM % 6)) + echo "${TRIPWIRE_MIN} ${TRIPWIRE_HOUR} * * * root /usr/sbin/tripwire -m c" /etc/crontab + mark_completed $FUNCNAME }