This commit is contained in:
Bob Mottram 2017-08-04 18:14:40 +01:00
commit 6fc1e1e967
1 changed files with 8 additions and 2 deletions

View File

@ -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 '
@ -90,7 +91,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
@ -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
}