Last active
March 25, 2018 09:32
-
-
Save teamextension/055ffbd78ef1e6220aff17ab325a3be5 to your computer and use it in GitHub Desktop.
Tripwire Setup
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd /etc/tripwire/ | |
# setup | |
tripwire-setup-keyfiles | |
tripwire --init | |
# remove 404s | |
tripwire --check | grep Filename | sed 's/ Filename: \(.*\)/\1/' > twpol.sh | |
sed -i 's/\//\\\//g' twpol.sh | |
sed -i 's/\./\\\./g' twpol.sh | |
sed -i "s/^/sed -i '\//g" twpol.sh | |
sed -i "s/$/\/d' twpol.tsh/g" twpol.txt | |
chmod u+x twpol.sh | |
./twpol.sh | |
# remove /var/log | |
sed -e '/ \/var\/log/ s/^#*/#/' -i twpol.txt | |
# resetup | |
twadmin -m P twpol.txt | |
tripwire --init | |
# update twcfg | |
sed -i 's/^MAILNOVIOLATIONS =true/MAILNOVIOLATIONS =false/' twcfg.txt | |
sed -i 's/^EMAILREPORTLEVEL =3/EMAILREPORTLEVEL =1/' twcfg.txt | |
sed -i 's/^REPORTLEVEL =3/REPORTLEVEL =1/' twcfg.txt | |
twadmin --create-cfgfile -S site.key twcfg.txt | |
# cleanup | |
rm -f twpol.txt twcfg.txt twpol.sh |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment