mirror of https://github.com/CISOfy/lynis.git
No warnings for SSH configuration, instead only use suggestions. Plus logging of details.
This commit is contained in:
parent
e75569babf
commit
7d0f5acc54
|
@ -99,16 +99,12 @@
|
|||
X11Forwarding:NO,,YES\
|
||||
PrintLastLog:YES,,NO"
|
||||
|
||||
for I in ${SSHOPS};
|
||||
do
|
||||
for I in ${SSHOPS}; do
|
||||
OPTIONNAME=`echo ${I} | cut -d ':' -f1`
|
||||
|
||||
EXPECTEDVALUE=`echo ${I} | cut -d ':' -f2 | cut -d',' -f1`
|
||||
MEDIUMSCOREDVALUE=`echo ${I} | cut -d ':' -f2 | cut -d',' -f2`
|
||||
WRONGVALUE=`echo ${I} | cut -d ':' -f2 | cut -d',' -f3`
|
||||
|
||||
FOUNDVALUE=`awk -v OPT="${OPTIONNAME}" 'index($0, OPT) == 1 { print toupper($2) }' ${SSH_DAEMON_CONFIG}`
|
||||
|
||||
logtext "Test: Checking ${OPTIONNAME} in ${SSH_DAEMON_CONFIG}"
|
||||
|
||||
if [ ! "${FOUNDVALUE}" = "" ]; then
|
||||
|
@ -119,23 +115,21 @@
|
|||
logtext "Result: SSH option ${OPTIONNAME} is configured very well"
|
||||
Display --indent 4 --text "- SSH option: ${OPTIONNAME}" --result OK --color GREEN
|
||||
AddHP 3 3
|
||||
|
||||
elif [ "${FOUNDVALUE}" = "${MEDIUMSCOREDVALUE}" ]; then
|
||||
logtext "Result: SSH option ${OPTIONNAME} is configured totally wrong"
|
||||
ReportSuggestion ${TEST_NO} "Harder SSH option: ${OPTIONNAME}"
|
||||
ReportSuggestion ${TEST_NO} "Consider hardening of SSH configuration" "${OPTIONNAME}" "-"
|
||||
Display --indent 4 --text "- SSH option: ${OPTIONNAME}" --result "MEDIUM" --color YELLOW
|
||||
AddHP 1 3
|
||||
|
||||
elif [ "${FOUNDVALUE}" = "${WRONGVALUE}" ]; then
|
||||
logtext "Result: SSH option ${OPTIONNAME} is configured totally wrong"
|
||||
ReportWarning ${TEST_NO} "M" "Unsafe configured SSH option: ${OPTIONNAME}"
|
||||
ReportSuggestion ${TEST_NO} "Reconfigure ${OPTIONNAME}"
|
||||
#ReportWarning ${TEST_NO} "M" "Unsafe configured SSH option: ${OPTIONNAME}"
|
||||
ReportSuggestion ${TEST_NO} "Consider hardening SSH configuration" "${OPTIONNAME}" "-"
|
||||
Display --indent 4 --text "- SSH option: ${OPTIONNAME}" --result WARNING --color RED
|
||||
AddHP 0 3
|
||||
|
||||
else
|
||||
logtext "Result: Value of SSH option ${OPTIONNAME} is unknown (not defined)"
|
||||
Display --indent 4 --text "- SSH option: ${OPTIONNAME}" --result DEFAULT --color WHITE
|
||||
#ReportException "SSH-7408:01" "Unknown SSH option"
|
||||
fi
|
||||
|
||||
else
|
||||
|
|
Loading…
Reference in New Issue