From 47857774b495ec1f662e815cb2b3714b5c65336f Mon Sep 17 00:00:00 2001 From: Charles Herlin Date: Fri, 9 Feb 2018 13:49:38 +0100 Subject: [PATCH] Fix SOC-28, add test if file exist, if not issue error --- bin/hardening/11.1_warning_banners.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/bin/hardening/11.1_warning_banners.sh b/bin/hardening/11.1_warning_banners.sh index 19fb524..ad4e390 100755 --- a/bin/hardening/11.1_warning_banners.sh +++ b/bin/hardening/11.1_warning_banners.sh @@ -21,6 +21,11 @@ FILES='/etc/motd /etc/issue /etc/issue.net' # This function will be called if the script status is on enabled / audit mode audit () { for FILE in $FILES; do + does_file_exist $FILE + if [ $FNRET != 0 ]; then + crit "$FILE does not exist" + continue + fi has_file_correct_ownership $FILE $USER $GROUP if [ $FNRET = 0 ]; then ok "$FILE has correct ownership"