mirror of
https://github.com/hardenedlinux/harbian-audit.git
synced 2025-07-26 15:14:29 +02:00
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
|
HARDENING_LEVEL=4
|
||||||
|
|
||||||
FILES='/etc/crontab /etc/cron.d/*'
|
FILES='/etc/cron.daily/aide'
|
||||||
PATTERN='/usr/bin/aide.wrapper --check'
|
|
||||||
|
|
||||||
# This function will be called if the script status is on enabled / audit mode
|
# This function will be called if the script status is on enabled / audit mode
|
||||||
audit () {
|
audit () {
|
||||||
does_pattern_exist_in_file "$FILES" "$PATTERN"
|
if [ -x ${FILES} ]; then
|
||||||
if [ $FNRET != 0 ]; then
|
ok "$FILES is exist."
|
||||||
crit "$PATTERN is not present in $FILES"
|
|
||||||
FNRET=1
|
|
||||||
else
|
|
||||||
ok "$PATTERN is present in $FILES"
|
|
||||||
FNRET=0
|
FNRET=0
|
||||||
|
else
|
||||||
|
crit "$FILES is not exist."
|
||||||
|
FNRET=1
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# This function will be called if the script status is on enabled mode
|
# This function will be called if the script status is on enabled mode
|
||||||
apply () {
|
apply () {
|
||||||
if [ $FNRET != 0 ]; then
|
if [ $FNRET != 0 ]; then
|
||||||
warn "$PATTERN is not present in $FILES, setting aide cron"
|
warn "$FILES is not exist, so need to manual check"
|
||||||
echo "0 10 * * * ${PATTERN} > /dev/null 2>&1 " > /etc/cron.d/CIS_8.3.2_aide
|
|
||||||
else
|
else
|
||||||
ok "$PATTERN is present in $FILES"
|
ok "$FILES is exist "
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user