Skip to content

Stabilization: Add RHEL9-specific audit rules for faillock and lastlog with auid filter - #15035

Merged
jan-cerny merged 1 commit into
ComplianceAsCode:stabilizationfrom
ggbecker:backport_15016
Aug 24, 2026
Merged

Stabilization: Add RHEL9-specific audit rules for faillock and lastlog with auid filter#15035
jan-cerny merged 1 commit into
ComplianceAsCode:stabilizationfrom
ggbecker:backport_15016

Conversation

@ggbecker

Copy link
Copy Markdown
Member

Backport #15016

RHEL9 STIG v2r9 requires auid filters for the following audit rules:
- RHEL-09-654250: audit_rules_login_events_faillock
- RHEL-09-654255: audit_rules_login_events_lastlog

RHEL10 STIG v1r2 does NOT require auid filters for the equivalent rules:
- RHEL-10-500750
- RHEL-10-500760

This commit removes the templates from rule.yml and provides:

1. **shared.sh/yml/xml** - Template-derived content (no auid filters) used by:
   - rhel8, rhel10, ol7, ol8, ol9, ol10, rhcos4, rhv4
   - almalinux9, anolis8, anolis23, fedora
   - debian11, ubuntu2204, ubuntu2404
   - sle12, sle15

2. **rhel9.sh/yml/xml** - Custom RHEL9 content with required auid filters:
   - Bash: Uses bash_fix_audit_syscall_rule macro with AUID_FILTERS
   - Ansible: Adds auid>=1000 and auid!=unset to rule patterns
   - OVAL: Requires auid>=1000 and auid!=unset in pattern matching

The generated RHEL9 rules include:
```
-a always,exit -F arch=b32 -F path=/var/run/faillock -F perm=wa -F auid>=1000 -F auid!=unset -k logins
-a always,exit -F arch=b64 -F path=/var/run/faillock -F perm=wa -F auid>=1000 -F auid!=unset -k logins
```

And similar for /var/log/lastlog.

Test scenarios verify both passing and failing cases for RHEL9.

This is a temporary solution until DISA clarifies why RHEL10 STIG doesn't
require the auid parameter. If DISA updates RHEL10 to match RHEL9, the custom
content can be updated accordingly.

Fixes: Missed requirement in PR ComplianceAsCode#15000
References: https://stigaview.com/products/rhel9/v2r9/RHEL-09-654250/
References: https://stigaview.com/products/rhel9/v2r9/RHEL-09-654255/
References: https://stigaview.com/products/rhel10/v1r2/RHEL-10-500750
References: https://stigaview.com/products/rhel10/v1r2/RHEL-10-500760
(cherry picked from commit 6be7f90)
@jan-cerny jan-cerny added this to the 0.1.82 milestone Aug 24, 2026
@jan-cerny jan-cerny self-assigned this Aug 24, 2026
@jan-cerny
jan-cerny merged commit b0b8463 into ComplianceAsCode:stabilization Aug 24, 2026
57 of 58 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants