Skip to content

Set Lockout Time for Failed Password Attempts using pam_tally2

An XCCDF Rule

Description

This rule configures the system to lock out accounts during a specified time period after a number of incorrect login attempts using pam_tally2.so.

Rationale

By limiting the number of failed logon attempts, the risk of unauthorized system access via user password guessing, also known as brute-forcing, is reduced. Limits are imposed by locking the account.

ID
xccdf_org.ssgproject.content_rule_accounts_passwords_pam_tally2_unlock_time
Severity
Medium
References
Updated



Remediation - Ansible

- name: Gather the package facts
  package_facts:
    manager: auto
  tags:
  - CCE-91282-4
  - NIST-800-53-AC-7(b)

Remediation - Shell Script

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

var_accounts_passwords_pam_tally2_unlock_time='<xccdf-1.2:sub xmlns:xccdf-1.2="http://checklists.nist.gov/xccdf/1.2" idref="xccdf_org.ssgproject.content_value_var_accounts_passwords_pam_tally2_unlock_time" use="legacy"/>'

# Use a non-number regexp to force update of the value of the deny option