Vulnerability Discussion
Any password, no matter how complex, can eventually be cracked. Therefore, passwords must be changed periodically. If the operating system does not limit the lifetime of passwords and force users to change their passwords, there is the risk that the operating system passwords could be compromised.
Check
Verify that AlmaLinux OS 9 enforces a 60-day maximum password lifetime for new user accounts by running the following command:
$ grep PASS_MAX_DAYS /etc/login.defs
PASS_MAX_DAYS 60
If the "PASS_MAX_DAYS" parameter value is greater than "60", is not set, or is commented out, this is a finding.
Fix
Configure AlmaLinux OS 9 to enforce a 60-day maximum password lifetime.
Modify the "/etc/login.defs" file to set the "PASS_MAX_DAYS" parameter to 60 or greater:
PASS_MAX_DAYS 60