From 2d31c04684199037a56a14c7b7410669dcc64971 Mon Sep 17 00:00:00 2001 From: Samson-W Date: Mon, 19 Nov 2018 06:08:01 -0500 Subject: [PATCH] Modify 8.3.1 8.3.2 --- bin/hardening/8.3.1_install_aide.sh | 1 + bin/hardening/8.3.2_tripwire_cron.sh | 13 ++++++++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/bin/hardening/8.3.1_install_aide.sh b/bin/hardening/8.3.1_install_aide.sh index 63c27aa..bc99c65 100755 --- a/bin/hardening/8.3.1_install_aide.sh +++ b/bin/hardening/8.3.1_install_aide.sh @@ -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 } diff --git a/bin/hardening/8.3.2_tripwire_cron.sh b/bin/hardening/8.3.2_tripwire_cron.sh index ae05127..6d7c17d 100755 --- a/bin/hardening/8.3.2_tripwire_cron.sh +++ b/bin/hardening/8.3.2_tripwire_cron.sh @@ -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