Explorar el Código

Merge branch 'stretch' of https://github.com/bashrc/freedombone

Bob Mottram hace 7 años
padre
commit
6fc1e1e967
Se han modificado 1 ficheros con 8 adiciones y 2 borrados
  1. 8
    2
      src/freedombone-base-tripwire

+ 8
- 2
src/freedombone-base-tripwire Ver fichero

@@ -75,10 +75,11 @@ function install_tripwire {
75 75
     echo 'EMAILREPORTLEVEL =3' >> /etc/tripwire/twcfg.txt
76 76
     echo 'REPORTLEVEL   =3' >> /etc/tripwire/twcfg.txt
77 77
     echo 'SYSLOGREPORTING =false' >> /etc/tripwire/twcfg.txt
78
-    echo 'MAILMETHOD    =SMTP' >> /etc/tripwire/twcfg.txt
78
+    echo 'MAILMETHOD    =SENDMAIL' >> /etc/tripwire/twcfg.txt
79 79
     echo 'SMTPHOST      =localhost' >> /etc/tripwire/twcfg.txt
80 80
     echo 'SMTPPORT      =25' >> /etc/tripwire/twcfg.txt
81 81
     echo 'TEMPDIRECTORY =/tmp' >> /etc/tripwire/twcfg.txt
82
+    echo 'MAILFROMADDRESS =tripwire@$(HOSTNAME)' >> /etc/tripwire/twcfg.txt
82 83
 
83 84
     echo '
84 85
 
@@ -90,7 +91,7 @@ function install_tripwire {
90 91
 
91 92
     # make a script for easy resetting of the tripwire
92 93
     echo '#!/bin/sh' > /usr/bin/reset-tripwire
93
-    echo 'tripwire --update-policy --secure-mode low /etc/tripwire/twpol.txt' >> /usr/bin/reset-tripwire
94
+    echo 'tripwire -m i' >> /usr/bin/reset-tripwire
94 95
     chmod +x /usr/bin/reset-tripwire
95 96
 
96 97
     sed -i '/# These files change the behavior of the root account/,/}/ s/.*//g' /etc/tripwire/twpol.txt
@@ -117,6 +118,7 @@ function install_tripwire {
117 118
     sed -i 's|$(TWETC)/tw.pol.*||g' /etc/tripwire/twpol.txt
118 119
     # site key name
119 120
     sed -i 's|$(TWETC)/site.key|$(TWETC)/$(HOSTNAME)-site.key|g' /etc/tripwire/twpol.txt
121
+
120 122
     # create the policy
121 123
     echo '
122 124
 
@@ -137,6 +139,10 @@ function install_tripwire {
137 139
 
138 140
        ' | reset-tripwire
139 141
 
142
+    TRIPWIRE_MIN=$((1 + RANDOM % 49))
143
+    TRIPWIRE_HOUR=$((1 + RANDOM % 6))
144
+    echo "${TRIPWIRE_MIN} ${TRIPWIRE_HOUR}              *   *   *   root /usr/sbin/tripwire -m c" /etc/crontab
145
+
140 146
     mark_completed $FUNCNAME
141 147
 }
142 148