Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/CISOfy/lynis.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Boelen <michael.boelen@cisofy.com>2016-08-22 13:21:43 +0300
committerMichael Boelen <michael.boelen@cisofy.com>2016-08-22 13:21:43 +0300
commitb85c782faecfb6fc4f58c4195db837411b628dbf (patch)
tree1ca5b062544da0366121384dc13eb1352c95a586 /include/tests_logging
parentc061d31bdea8ef8cc7e738aeb783c1bcc826c2cb (diff)
Added LOGG-2192 test
Diffstat (limited to 'include/tests_logging')
-rw-r--r--include/tests_logging18
1 files changed, 18 insertions, 0 deletions
diff --git a/include/tests_logging b/include/tests_logging
index 9f6398c2..be84fb41 100644
--- a/include/tests_logging
+++ b/include/tests_logging
@@ -507,6 +507,24 @@
#
#################################################################################
#
+ # Test : LOGG-2192
+ # Description : Check for open log files which are empty. This may indicate a problem with log rotation, or unused services
+ if [ ! "${LSOFBINARY}" = "" ]; then PREQS_MET="YES"; else PREQS_MET="NO"; fi
+ Register --test-no LOGG-2192 --preqs-met ${PREQS_MET} --weight L --network NO --category security --description "Checking for open log files that are empty"
+ if [ ${SKIPTEST} -eq 0 ]; then
+ FIND=$(${LSOFBINARY} -n -w | awk '{if ($5=="REG" && $7=="0" && $9 ~ /log$/) {print $1","$9}}' | sort | uniq)
+ if [ ! -z "${FIND}" ]; then
+ for I in ${FIND}; do
+ LogText "Found an opened logfile that is empty: ${I}"
+ Report "open_empty_log_file[]=${I}"
+ done
+ else
+ LogText "Result: all opened log files are bigger than zero bytes in size"
+ fi
+ fi
+#
+#################################################################################
+#
Report "log_rotation_config_found=${LOGROTATE_CONFIG_FOUND}"
Report "log_rotation_tool=${LOGROTATE_TOOL}"