Skip to content

Set Account Expiration Following Inactivity in password-auth

An XCCDF Rule

Description

Verify the account identifiers (individuals, groups, roles, and devices) are disabled after or less days of inactivity by checking the account inactivity value with the following command:

grep 'inactive\|pam_unix' /etc/pam.d/password-auth | grep -w auth

auth required pam_lastlog.so inactive=35
auth sufficient pam_unix.so
The line with the inactive parameter should be placed before pam_unix.so module as in the example output.

warning alert: Warning

If the system relies on authselect tool to manage PAM settings, the remediation will also use authselect tool. However, if any manual modification was made in PAM files, the authselect integrity check will fail and the remediation will be aborted in order to preserve intentional changes. In this case, an informative message will be shown in the remediation report.

Rationale

Inactive identifiers pose a risk to systems and applications because attackers may exploit an inactive identifier and potentially obtain undetected access to the system. Owners of inactive accounts will not notice if unauthorized access to their user account has been obtained.

ID
xccdf_org.ssgproject.content_rule_account_disable_inactivity_password_auth
Severity
Medium
References
Updated



Remediation - Shell Script

# Remediation is applicable only in certain platforms
if rpm --quiet -q pam; then

PAM_FILE_PATH="/etc/pam.d/password-auth"
if [ -f /usr/bin/authselect ]; then
    if ! authselect check; then