======5.3.2 Ensure lockout for failed password attempts is configured (Not Scored)======
=====Profile Applicability=====
Level 1 - Server
Level 1 - Workstation
=====Description=====
Lock out users after //n// unsuccessful consecutive login attempts. The first sets of changes are made to the PAM configuration files. The second set of changes are applied to the program specific PAM configuration file. The second set of changes must be applied to each program that will lock out users. Check the documentation for each secondary program for instructions on how to configure them to work with PAM. \\ \\
Set the lockout number to the policy in effect at your site.
=====Rationale=====
Locking out user IDs after //n// unsuccessful consecutive login attempts mitigates brute force password attacks against your systems.
=====Audit=====
Review the ''/etc/pam.d/password-auth'' and ''/etc/pam.d/system-auth'' files and verify the following ''pam_faillock.so'' lines appear surrounding a ''pam_unix.so'' line and the ''pam_unix.so'' is ''[success=1 default=bad]'' as listed in both:
auth required pam_faillock.so preauth audit silent deny=5 unlock_time=900
auth [success=1 default=bad] pam_unix.so
auth [default=die] pam_faillock.so authfail audit deny=5 unlock_time=900
auth sufficient pam_faillock.so authsucc audit deny=5 unlock_time=900
=====Remediation=====
Edit the ''/etc/pam.d/password-auth'' and ''/etc/pam.d/system-auth'' files and add the following ''pam_faillock.so'' lines surrounding a ''pam_unix.so'' line modify the ''pam_unix.so'' is ''[success=1 default=bad]'' as listed in both:
auth required pam_faillock.so preauth audit silent deny=5 unlock_time=900
auth [success=1 default=bad] pam_unix.so
auth [default=die] pam_faillock.so authfail audit deny=5 unlock_time=900
auth sufficient pam_faillock.so authsucc audit deny=5 unlock_time=900
=====Notes=====
Additional module options may be set, recommendation only covers those listed here. \\ \\
If a user has been locked out because they have reached the maximum consecutive failure count defined by ''deny='' in the ''pam_faillock.so'' module, the user can be unlocked by issuing the command ''faillock -u --reset'' respectively. This command sets the failed count to 0, effectively unlocking the user.