Information
The unlock_time option, set in /etc/security/faillock.conf, controls how long a locked account remains locked before access is automatically re-enabled. Access is restored unlock_time seconds after the account is locked. A value of 0 means the account is never automatically unlocked and access can only be restored by resetting the faillock entries with the faillock(8) command.
A nonzero unlock_time automatically restores access after the configured interval, balancing protection against brute force attacks with the operational cost of locked-out accounts and reducing administrative overhead. Setting unlock_time to 0 maximizes protection by keeping an account locked until an administrator resets it, at the cost of requiring manual recovery.
Solution
Set password unlock time to conform to site policy. unlock_time should be 0 (never), or 900 seconds or greater.
Edit /etc/security/faillock.conf and update or add the following line:
unlock_time = 900
Run the following script to remove the unlock_time argument from the pam_faillock.so module in the PAM files:
#!/usr/bin/env bash
{
for l_pam_file in system-auth password-auth; do
l_authselect_file="/etc/authselect/$(head -1 /etc/authselect/authselect.conf | grep 'custom/')/$l_pam_file"
sed -ri 's/(^\s*auth\s+(requisite|required|sufficient)\s+pam_faillock\.so.*)(\s+unlock_time\s*=\s*\S+)(.*$)/\1\4/' "$l_authselect_file"
done
authselect apply-changes
}
Impact:
Use of unlock_time=0 may allow an attacker to cause denial of service to legitimate users. This will also require a systems administrator with elevated privileges to unlock the account.