Modify 8.3.1 8.3.2
This commit is contained in:
parent
dabf90d48b
commit
2d31c04684
|
@ -35,6 +35,7 @@ apply () {
|
||||||
else
|
else
|
||||||
crit "$PACKAGE is absent, installing it"
|
crit "$PACKAGE is absent, installing it"
|
||||||
apt_install $PACKAGE
|
apt_install $PACKAGE
|
||||||
|
aideinit
|
||||||
info "${PACKAGE} is now installed but not fully functionnal, please see readme to go further"
|
info "${PACKAGE} is now installed but not fully functionnal, please see readme to go further"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,11 +1,13 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
#
|
#
|
||||||
# harbian audit 7/8/9 Hardening
|
# harbian audit 9 Hardening
|
||||||
#
|
#
|
||||||
|
|
||||||
#
|
#
|
||||||
# 8.3.2 Implement Periodic Execution of File Integrity (Scored)
|
# 8.3.2 Implement Periodic Execution of File Integrity (Scored)
|
||||||
|
# Modify by:
|
||||||
|
# Samson-W (sccxboy@gmail.com)
|
||||||
#
|
#
|
||||||
|
|
||||||
set -e # One error, it's over
|
set -e # One error, it's over
|
||||||
|
@ -14,24 +16,25 @@ set -u # One variable unset, it's over
|
||||||
HARDENING_LEVEL=4
|
HARDENING_LEVEL=4
|
||||||
|
|
||||||
FILES='/etc/crontab /etc/cron.d/*'
|
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
|
# This function will be called if the script status is on enabled / audit mode
|
||||||
audit () {
|
audit () {
|
||||||
does_pattern_exist_in_file "$FILES" "$PATTERN"
|
does_pattern_exist_in_file "$FILES" "$PATTERN"
|
||||||
if [ $FNRET != 0 ]; then
|
if [ $FNRET != 0 ]; then
|
||||||
crit "$PATTERN is not present in $FILES"
|
crit "$PATTERN is not present in $FILES"
|
||||||
|
FNRET=1
|
||||||
else
|
else
|
||||||
ok "$PATTERN is present in $FILES"
|
ok "$PATTERN is present in $FILES"
|
||||||
|
FNRET=0
|
||||||
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 () {
|
||||||
does_pattern_exist_in_file "$FILES" "$PATTERN"
|
|
||||||
if [ $FNRET != 0 ]; then
|
if [ $FNRET != 0 ]; then
|
||||||
warn "$PATTERN is not present in $FILES, setting tripwire cron"
|
warn "$PATTERN is not present in $FILES, setting aide cron"
|
||||||
echo "0 10 * * * root /usr/sbin/tripwire --check > /dev/shm/tripwire_check 2>&1 " > /etc/cron.d/CIS_8.3.2_tripwire
|
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 "$PATTERN is present in $FILES"
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in New Issue