Modify 8.3.1 8.3.2

This commit is contained in:
Samson-W 2018-11-19 06:08:01 -05:00
parent dabf90d48b
commit 2d31c04684
2 changed files with 9 additions and 5 deletions

View File

@ -35,6 +35,7 @@ apply () {
else
crit "$PACKAGE is absent, installing it"
apt_install $PACKAGE
aideinit
info "${PACKAGE} is now installed but not fully functionnal, please see readme to go further"
fi
}

View File

@ -1,11 +1,13 @@
#!/bin/bash
#
# harbian audit 7/8/9 Hardening
# harbian audit 9 Hardening
#
#
# 8.3.2 Implement Periodic Execution of File Integrity (Scored)
# Modify by:
# Samson-W (sccxboy@gmail.com)
#
set -e # One error, it's over
@ -14,24 +16,25 @@ set -u # One variable unset, it's over
HARDENING_LEVEL=4
FILES='/etc/crontab /etc/cron.d/*'
PATTERN='tripwire --check'
PATTERN='/usr/bin/aide.wrapper --check'
# 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"
FNRET=0
fi
}
# This function will be called if the script status is on enabled mode
apply () {
does_pattern_exist_in_file "$FILES" "$PATTERN"
if [ $FNRET != 0 ]; then
warn "$PATTERN is not present in $FILES, setting tripwire cron"
echo "0 10 * * * root /usr/sbin/tripwire --check > /dev/shm/tripwire_check 2>&1 " > /etc/cron.d/CIS_8.3.2_tripwire
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
else
ok "$PATTERN is present in $FILES"
fi