4.4.4 Ensure strong password hashing algorithm is configured

Information

Hash functions behave as one-way functions by using mathematical operations that are extremely difficult and cumbersome to revert

When a user is created, the password is run through a one-way hashing algorithm before being stored. When the user logs in, the password sent is run through the same one-way hashing algorithm and compared to the hash connected with the provided username. If the hashed password and the stored hash match, the login is valid.

The SHA512 hashing algorithm provides stronger hashing than previous available algorithms like MD5 thus providing additional protection to the system by increasing the level of effort for an attacker to successfully determine passwords.

Solution

Note:

- Pay special attention to the configuration. Incorrect configuration can cause system lock outs.
- This is an example configuration. Your configuration may differ based on previous changes to the files.
- The encryption method on the password success line for pam_unix.so and the ENCRYPT_METHOD line in /etc/login.defs should match.

Edit the /etc/pam.d/common-password file and ensure that sha512 is included and the pam_unix.so success line:

Example:

password [success=1 default=ignore] pam_unix.so obscure sha512 use_authtok

Edit /etc/login.defs and ensure that ENCRYPT_METHOD is set to SHA512

ENCRYPT_METHOD SHA512

See Also

https://workbench.cisecurity.org/benchmarks/15023

Item Details

Category: IDENTIFICATION AND AUTHENTICATION, SYSTEM AND COMMUNICATIONS PROTECTION

References: 800-53|IA-5(1), 800-53|SC-28, 800-53|SC-28(1), CSCv7|16.4

Plugin: Unix

Control ID: e59fd87addf1b92fd710d504b7f928e94969bffa437409156367356e2f62ce7e