forked from konstruktoid/hardening
-
Notifications
You must be signed in to change notification settings - Fork 0
/
aide
44 lines (32 loc) · 1.07 KB
/
aide
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
function f_aide {
echo "[$SCRIPT_COUNT] Aide configuration"
if ! grep -R -E '^!/var/lib/lxcfs/cgroup$' /etc/aide/*; then
echo '!/var/lib/lxcfs/cgroup' > /etc/aide/aide.conf.d/70_aide_lxcfs
fi
if ! grep -R -E '^!/var/lib/docker$' /etc/aide/*; then
echo '!/var/lib/docker' > /etc/aide/aide.conf.d/70_aide_docker
fi
sed -i 's/^Checksums.*/Checksums = sha512/' /etc/aide/aide.conf
((SCRIPT_COUNT++))
}
function f_aide_post {
echo "[$SCRIPT_COUNT] Running Aide, this will take a while"
aideinit --yes
((SCRIPT_COUNT++))
}
function f_aide_timer {
if ! [ -f /etc/cron.daily/aide ]; then
echo "[$SCRIPT_COUNT] Enable daily Aide check"
cp ./config/aidecheck.service /etc/systemd/system/aidecheck.service
cp ./config/aidecheck.timer /etc/systemd/system/aidecheck.timer
chmod 0644 /etc/systemd/system/aidecheck.*
systemctl reenable aidecheck.timer
systemctl restart aidecheck.timer
systemctl daemon-reload
if [[ $VERBOSE == "Y" ]]; then
systemctl status aidecheck.timer --no-pager
echo
fi
((SCRIPT_COUNT++))
fi
}