NEW: aide scripts

This commit is contained in:
xpk 2021-12-05 11:24:57 +08:00
parent 6d5a9fc5f7
commit 230ff9ea7d
Signed by: xpk
GPG Key ID: CD4FF6793F09AB86
2 changed files with 13 additions and 0 deletions

8
sh/aide-check.sh Normal file
View File

@ -0,0 +1,8 @@
#!/bin/bash
aide --check -r file:/var/log/aide-check.log
COUNT=$(egrep '(Added|Removed|Changed).*[0-9]' /var/log/aide-check.log | awk '{SUM+=$NF}; END {print SUM}')
if [ $COUNT -gt 0 ]; then
# changes detected
cat /var/log/aide-check.log | mailx -s "AIDE alert" -r security@your-domain.com -- yourself@your-domain.com
fi

5
sh/aide-update.sh Normal file
View File

@ -0,0 +1,5 @@
#!/bin/bash
aide -u
mv /var/lib/aide/{aide.db.gz,aide.db.previous.gz}
mv /var/lib/aide/{aide.db.new.gz,aide.db.gz}
aide -C