Wrote 'AUTH-9407' - logging failed login attempts.

This commit is contained in:
Kamil Boratyński 2015-09-07 04:12:58 +02:00
parent a9966ac4ba
commit 0e97f7936f
1 changed files with 21 additions and 0 deletions

View File

@ -1077,6 +1077,27 @@
fi fi
# #
################################################################################# #################################################################################
#
# Test : AUTH-9407
# Description : Logging failed login attempts
if [ -f /etc/login.defs ]; then PREQS_MET="YES"; else PREQS_MET="NO"; fi
Register --test-no AUTH-9407 --os Linux --preqs-met ${PREQS_MET} --weight L --network NO --description "Logging failed login attempts"
if [ ${SKIPTEST} -eq 0 ]; then
logtext "Test: Checking FAILLOG_ENAB option in /etc/login.defs "
FIND=`grep "^FAILLOG_ENAB" /etc/login.defs | awk '{ if ($1=="FAILLOG_ENAB") { print $2 } }'`
if [ "${FIND}" = "" -o "${FIND}" = "no" ]; then
logtext "Result: failed login attempts are not logged"
Display --indent 2 --text "- Logging failed login attempts" --result DISABLED --color YELLOW
ReportSuggestion ${TEST_NO} "Configure failed login attempts to be logged in /var/log/faillog"
AddHP 0 1
else
logtext "Result: failed login attempts are logged in /var/log/faillog"
Display --indent 2 --text "- Logging failed login attempts" --result OK --color GREEN
AddHP 3 3
fi
fi
#
#################################################################################
# #
report "ldap_auth_enabled=${LDAP_AUTH_ENABLED}" report "ldap_auth_enabled=${LDAP_AUTH_ENABLED}"