-
Notifications
You must be signed in to change notification settings - Fork 1
/
08_pam.sh
executable file
·34 lines (26 loc) · 1.11 KB
/
08_pam.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/usr/bin/env bash
# Copyright (C) 2008 Red Hat, Inc.
# Written by Tomas Heinrich <[email protected]>
# Adapted for SCE by Martin Preisler <[email protected]>
SYSTEM_AUTH_CFG="/etc/pam.d/system-auth"
PARANOID=0
if [[ ! -f ${SYSTEM_AUTH_CFG} ]]; then
echo "Configuration file \"${SYSTEM_AUTH_CFG}\" doesn't exist."
exit $XCCDF_RESULT_FAIL
fi
RET=$XCCDF_RESULT_PASS
sed -n -e ':a; /\\$/N; s/\\\n//; ta; s/^[ \t]*password[^#]*pam_cracklib.so.*//; T; q 1' ${SYSTEM_AUTH_CFG}
if [[ "$?" -eq "0" ]]; then
echo "New passwords for system services aren't checked with cracklib."
echo "Add a call to pam_cracklib to '${SYSTEM_AUTH_CFG}'. Please see 'man pam_cracklib' for details."
RET=$XCCDF_RESULT_INFORMATIONAL
fi
if (( ${PARANOID} == 1 )); then
sed -n -e ':a; /\\$/N; s/\\\n//; ta; s/^[ \t]*auth[^#]*pam_tally\.so.*//p; T; q 1' ${SYSTEM_AUTH_CFG}
if [[ "$?" -eq "0" ]]; then
echo "Account lockout after repetitive failed login attempts is not configured."
echo "Add a call to pam_tally to '${SYSTEM_AUTH_CFG}'. Please see 'man pam_tally' for details."
RET=$XCCDF_RESULT_INFORMATIONAL
fi
fi
exit $RET