Modify aide audit methods for debian 9
This commit is contained in:
parent
2b50f8ddf8
commit
35b75f0779
|
@ -15,28 +15,25 @@ set -u # One variable unset, it's over
|
|||
|
||||
HARDENING_LEVEL=4
|
||||
|
||||
FILES='/etc/crontab /etc/cron.d/*'
|
||||
PATTERN='/usr/bin/aide.wrapper --check'
|
||||
FILES='/etc/cron.daily/aide'
|
||||
|
||||
# This function will be called if the script status is on enabled / audit mode
|
||||
audit () {
|
||||
does_pattern_exist_in_file "$FILES" "$PATTERN"
|
||||
if [ $FNRET != 0 ]; then
|
||||
crit "$PATTERN is not present in $FILES"
|
||||
FNRET=1
|
||||
else
|
||||
ok "$PATTERN is present in $FILES"
|
||||
if [ -x ${FILES} ]; then
|
||||
ok "$FILES is exist."
|
||||
FNRET=0
|
||||
else
|
||||
crit "$FILES is not exist."
|
||||
FNRET=1
|
||||
fi
|
||||
}
|
||||
|
||||
# This function will be called if the script status is on enabled mode
|
||||
apply () {
|
||||
if [ $FNRET != 0 ]; then
|
||||
warn "$PATTERN is not present in $FILES, setting aide cron"
|
||||
echo "0 10 * * * ${PATTERN} > /dev/null 2>&1 " > /etc/cron.d/CIS_8.3.2_aide
|
||||
warn "$FILES is not exist, so need to manual check"
|
||||
else
|
||||
ok "$PATTERN is present in $FILES"
|
||||
ok "$FILES is exist "
|
||||
fi
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue