mirror of https://github.com/CISOfy/lynis.git
LDAP support for Red Hat and others (fix issue #612)
This commit is contained in:
parent
20da48bdfe
commit
f9bcf26f25
|
@ -700,23 +700,29 @@
|
||||||
# Description : Search LDAP support in PAM files
|
# Description : Search LDAP support in PAM files
|
||||||
Register --test-no AUTH-9278 --weight L --network NO --category security --description "Checking LDAP pam status"
|
Register --test-no AUTH-9278 --weight L --network NO --category security --description "Checking LDAP pam status"
|
||||||
if [ ${SKIPTEST} -eq 0 ]; then
|
if [ ${SKIPTEST} -eq 0 ]; then
|
||||||
LogText "Test: checking presence /etc/pam.d/common-auth"
|
AUTH_FILES="/etc/pam.d/common-auth /etc/pam.d/system-auth"
|
||||||
if [ -f /etc/pam.d/common-auth ]; then
|
for FILE in ${AUTH_FILES}; do
|
||||||
LogText "Result: file /etc/pam.d/common-auth exists"
|
LogText "Test: checking presence ${FILE}"
|
||||||
|
if [ -f ${FILE} ]; then
|
||||||
|
LogText "Result: file ${FILE} exists"
|
||||||
LogText "Test: checking presence LDAP module"
|
LogText "Test: checking presence LDAP module"
|
||||||
FIND=$(${GREPBINARY} "^auth.*ldap" /etc/pam.d/common-auth)
|
FIND=$(${GREPBINARY} "^auth.*ldap" ${FILE})
|
||||||
if [ ! "${FIND}" = "" ]; then
|
if [ ! "${FIND}" = "" ]; then
|
||||||
LogText "Result: LDAP module present"
|
LogText "Result: LDAP module present"
|
||||||
LogText "Output: ${FIND}"
|
LogText "Output: ${FIND}"
|
||||||
Display --indent 2 --text "- LDAP module in PAM" --result "${STATUS_FOUND}" --color GREEN
|
|
||||||
LDAP_AUTH_ENABLED=1
|
LDAP_AUTH_ENABLED=1
|
||||||
LDAP_PAM_ENABLED=1
|
LDAP_PAM_ENABLED=1
|
||||||
else
|
else
|
||||||
LogText "Result: LDAP module not found"
|
LogText "Result: LDAP module not found"
|
||||||
Display --indent 2 --text "- LDAP module in PAM" --result "${STATUS_NOT_FOUND}" --color WHITE
|
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
LogText "Result: file /etc/pam.d/common-auth not found, skipping test"
|
LogText "Result: file ${FILE} not found, skipping test"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
if [ ${LDAP_PAM_ENABLED} -eq 1 ]; then
|
||||||
|
Display --indent 2 --text "- LDAP module in PAM" --result "${STATUS_FOUND}" --color GREEN
|
||||||
|
else
|
||||||
|
Display --indent 2 --text "- LDAP module in PAM" --result "${STATUS_NOT_FOUND}" --color WHITE
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
#
|
#
|
||||||
|
|
Loading…
Reference in New Issue