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>2017-01-28 17:47:47 +0300
committerMichael Boelen <michael.boelen@cisofy.com>2017-01-28 17:47:47 +0300
commit551f89c63b08069ae78947580e6ce640fc10d7a3 (patch)
treee5b1da05c749cb4832e87fc4bf805eb4e9702ba5 /include/tests_banners
parent57dd96f6c6b373bef71a8905698cfdd0cecd52cf (diff)
Log weak banner and code enhancements
Diffstat (limited to 'include/tests_banners')
-rw-r--r--include/tests_banners14
1 files changed, 8 insertions, 6 deletions
diff --git a/include/tests_banners b/include/tests_banners
index d200b343..ee3e15a1 100644
--- a/include/tests_banners
+++ b/include/tests_banners
@@ -149,10 +149,11 @@
Register --test-no BANN-7126 --preqs-met ${PREQS_MET} --weight L --network NO --category security --description "Check issue banner file contents"
if [ ${SKIPTEST} -eq 0 ]; then
N=0
- LogText "Test: Checking file /etc/issue contents for legal key words"
+ FILE="${ROOTDIR}etc/issue"
+ LogText "Test: Checking file ${FILE} contents for legal key words"
for I in ${LEGAL_BANNER_STRINGS}; do
- FIND=`${GREPBINARY} -i "${I}" /etc/issue`
- if [ ! "${FIND}" = "" ]; then
+ FIND=$(${GREPBINARY} -i "${I}" ${FILE})
+ if [ ! -z "${FIND}" ]; then
LogText "Result: found string '${I}'"
N=$((N + 1))
fi
@@ -160,13 +161,14 @@
# Check if we have 5 or more key words
if [ ${N} -gt 4 ]; then
LogText "Result: Found ${N} key words (5 or more suggested), to warn unauthorized users"
- Display --indent 4 --text "- /etc/issue contents" --result "${STATUS_OK}" --color GREEN
+ Display --indent 4 --text "- ${FILE} contents" --result "${STATUS_OK}" --color GREEN
AddHP 2 2
else
LogText "Result: Found only ${N} key words (5 or more suggested), to warn unauthorized users and could be increased"
- Display --indent 4 --text "- /etc/issue contents" --result WEAK --color YELLOW
- ReportSuggestion ${TEST_NO} "Add a legal banner to /etc/issue, to warn unauthorized users"
+ Display --indent 4 --text "- ${FILE} contents" --result WEAK --color YELLOW
+ ReportSuggestion ${TEST_NO} "Add a legal banner to ${FILE}, to warn unauthorized users"
AddHP 0 1
+ Report "weak_banner_file[]=${FILE}"
fi
fi
#