mirror of
https://github.com/CISOfy/lynis.git
synced 2025-07-28 00:04:16 +02:00
Log weak banner and code enhancements
This commit is contained in:
parent
57dd96f6c6
commit
551f89c63b
@ -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"
|
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
|
if [ ${SKIPTEST} -eq 0 ]; then
|
||||||
N=0
|
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
|
for I in ${LEGAL_BANNER_STRINGS}; do
|
||||||
FIND=`${GREPBINARY} -i "${I}" /etc/issue`
|
FIND=$(${GREPBINARY} -i "${I}" ${FILE})
|
||||||
if [ ! "${FIND}" = "" ]; then
|
if [ ! -z "${FIND}" ]; then
|
||||||
LogText "Result: found string '${I}'"
|
LogText "Result: found string '${I}'"
|
||||||
N=$((N + 1))
|
N=$((N + 1))
|
||||||
fi
|
fi
|
||||||
@ -160,13 +161,14 @@
|
|||||||
# Check if we have 5 or more key words
|
# Check if we have 5 or more key words
|
||||||
if [ ${N} -gt 4 ]; then
|
if [ ${N} -gt 4 ]; then
|
||||||
LogText "Result: Found ${N} key words (5 or more suggested), to warn unauthorized users"
|
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
|
AddHP 2 2
|
||||||
else
|
else
|
||||||
LogText "Result: Found only ${N} key words (5 or more suggested), to warn unauthorized users and could be increased"
|
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
|
Display --indent 4 --text "- ${FILE} contents" --result WEAK --color YELLOW
|
||||||
ReportSuggestion ${TEST_NO} "Add a legal banner to /etc/issue, to warn unauthorized users"
|
ReportSuggestion ${TEST_NO} "Add a legal banner to ${FILE}, to warn unauthorized users"
|
||||||
AddHP 0 1
|
AddHP 0 1
|
||||||
|
Report "weak_banner_file[]=${FILE}"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
#
|
#
|
||||||
|
Loading…
x
Reference in New Issue
Block a user