5.5.2 Ensure lockout for failed password attempts is configured - deny

Information

Lock out users after n unsuccessful consecutive login attempts.

deny=<n> - Number of attempts before the account is locked

unlock_time=<n> - Time in seconds before the account is unlocked

Note: The maximum configurable value for unlock_time is 604800

Rationale:

Locking out user IDs after n unsuccessful consecutive login attempts mitigates brute force password attacks against your systems.

Impact:

Use of unlock_time=0 may allow an attacker to cause denial of service to legitimate users.

Solution

Set password lockouts and unlock times to conform to site policy. deny should be greater than 0 and no greater than 5. unlock_time should be 0 (never), or 900 seconds or greater.
Edit /etc/security/faillock.conf and update or add the following lines:

deny = 5
unlock_time = 900

Default Value:

deny = 3

unlock_time = 600

Additional Information:

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 --user <USERNAME> --reset. This command sets the failed count to 0, effectively unlocking the user.

Use of the 'audit' keyword may log credentials in the case of user error during authentication. This risk should be evaluated in the context of the site policies of your organization.

See Also

https://workbench.cisecurity.org/files/4230