Ubuntu 22.04 LTS must require the change of at least eight characters when passwords are changed.

STIG ID: UBTU-22-611040  |  SRG: SRG-OS-000072-GPOS-00040 |  Severity: medium |  CCI: CCI-000195 |  Vulnerability Id: V-260566 | 

Vulnerability Discussion

If the operating system allows the user to consecutively reuse extensive portions of passwords, this increases the chances of password compromise by increasing the window of opportunity for attempts at guessing and brute-force attacks.

The number of changed characters refers to the number of changes required with respect to the total number of positions in the current password. In other words, characters may be the same within the two passwords; however, the positions of the like characters must be different.

If the password length is an odd number then number of changed characters must be rounded up. For example, a password length of 15 characters must require the change of at least eight characters.

Check

Verify Ubuntu 22.04 LTS requires the change of at least eight characters when passwords are changed by using the following command:

$ grep -i difok /etc/security/pwquality.conf
difok = 8

If "difok" is less than "8", is commented out, or is missing, this is a finding.

Fix

Configure Ubuntu 22.04 LTS to require the change of at least eight characters when passwords are changed.

Add or modify the following line in the "/etc/security/pwquality.conf" file:

difok = 8