Skip to content

Commit

Permalink
Merge pull request #12906 from alanmcanonical/ubt24_53313
Browse files Browse the repository at this point in the history
Ubuntu 24.04: Implement rule 5.3.3.1.3 Ensure password failed attempts lockout includes root account
  • Loading branch information
dodys authored Jan 27, 2025
2 parents f0771a3 + 5dfdd22 commit 02af5e0
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 2 deletions.
1 change: 1 addition & 0 deletions components/pam.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ rules:
- accounts_passwords_pam_faillock_enforce_local
- accounts_passwords_pam_faillock_interval
- accounts_passwords_pam_faillock_silent
- accounts_passwords_pam_faillock_root_unlock_time
- accounts_passwords_pam_faillock_unlock_time
- accounts_passwords_pam_faillock_enabled
- accounts_passwords_pam_tally2
Expand Down
6 changes: 4 additions & 2 deletions controls/cis_ubuntu2404.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1913,8 +1913,10 @@ controls:
levels:
- l2_server
- l2_workstation
status: planned
notes: TODO. Rule does not seem to be implemented, nor does it map to any rules in ubuntu2204 profile.
rules:
- var_accounts_passwords_pam_faillock_unlock_time=900
- accounts_passwords_pam_faillock_root_unlock_time
status: automated

- id: 5.3.3.2.1
title: Ensure password number of changed characters is configured (Automated)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
documentation_complete: true


title: 'Set Root Lockout Time for Failed Password Attempts'

description: |-
This rule configures the system to lock out root during a specified time period after a
number of incorrect login attempts using <tt>pam_faillock.so</tt>.
Ensure that the file <tt>/etc/security/faillock.conf</tt> contains the following entry:
<tt>root_unlock_time=&lt;interval-in-seconds&gt;</tt> where
<tt>interval-in-seconds</tt> is <tt>{{{xccdf_value("var_accounts_passwords_pam_faillock_unlock_time") }}}</tt> or greater.
If <tt>root_unlock_time</tt> is set to <tt>0</tt>, it may enable attacker to
apply denial of service to legitimate users.
rationale: |-
By limiting the number of failed logon attempts the risk of unauthorized root
access via password guessing, otherwise known as brute-forcing, is reduced.
Limits are imposed by locking the account.
severity: medium

platform: package[pam]

template:
name: pam_account_password_faillock
vars:
prm_name: root_unlock_time
prm_regex_conf: ^[\s]*root_unlock_time[\s]*=[\s]*([0-9]+)
prm_regex_pamd: ^[\s]*auth[\s]+.+[\s]+pam_faillock.so[\s]+[^\n]*root_unlock_time=([0-9]+)
ext_variable: var_accounts_passwords_pam_faillock_unlock_time
description: The unlock time after number of failed logins should be set correctly.
variable_lower_bound: use_ext_variable

0 comments on commit 02af5e0

Please sign in to comment.