Skip to content

Mark missing_auid tests as pass for lastlog/faillock audit rules - #15058

Merged
Mab879 merged 2 commits into
ComplianceAsCode:masterfrom
ggbecker:fix-audit-lastlog-auid-test-master
Aug 26, 2026
Merged

Mark missing_auid tests as pass for lastlog/faillock audit rules#15058
Mab879 merged 2 commits into
ComplianceAsCode:masterfrom
ggbecker:fix-audit-lastlog-auid-test-master

Conversation

@ggbecker

Copy link
Copy Markdown
Member

Description:

  • Convert the rhel9_missing_auid Automatus scenarios of the
    audit_rules_login_events_lastlog and audit_rules_login_events_faillock
    rules from .fail tests to .pass tests. On rhel9 (which uses the modern
    audit watch style), the OVAL check accepts audit rules with or without the
    auid filters (-F auid>=1000 -F auid!=unset), so an audit rule that omits
    them must pass the scan.

Rationale:

  • Both rules use the audit_rules_watch template, which generates a pattern
    ending in -F perm=wa.*$ for the -a always,exit rule form. The trailing
    .*$ makes the auid filters optional, so a rule like
    -a always,exit -F arch=b32 -F path=<watched_path> -F perm=wa -F key=logins
    matches and the scan passes. The scenarios were previously classified as
    failures, which contradicts each rule's own warnings: note stating the OVAL
    accepts audit rules with or without the auid filters. This mismatch caused a
    false test expectation.

Review Hints:

  • The behavior can be confirmed from each rule's warnings: block in its
    rule.yml and from the generated regex in
    shared/templates/audit_rules_watch/oval.template.
  • To verify with Automatus:
    python tests/automatus.py rule --libvirt qemu:///system <VM> audit_rules_login_events_lastlog audit_rules_login_events_faillock
  • Each change is a single-file rename (.fail.sh.pass.sh) plus a one-line
    comment update; the -master and -stabilization branches are identical.

The OVAL check for audit_rules_login_events_lastlog on rhel9 (modern
audit watch style) matches audit rules with or without the auid filters
(-F auid>=1000 -F auid!=unset), since the generated pattern ends with
'perm=wa.*$'. A rule that omits the auid filters therefore passes the
scan, so the rhel9_missing_auid scenario must be a pass test, not a fail.
Like audit_rules_login_events_lastlog, this rule uses the audit_rules_watch
template and on rhel9 (modern audit watch style) the OVAL check matches
audit rules with or without the auid filters (-F auid>=1000 -F auid!=unset),
since the generated pattern ends with 'perm=wa.*$'. A rule that omits the
auid filters therefore passes the scan, so the rhel9_missing_auid scenario
must be a pass test, not a fail.
@ggbecker ggbecker added this to the 0.1.83 milestone Aug 26, 2026
@ggbecker ggbecker added the RHEL Red Hat Enterprise Linux product related. label Aug 26, 2026
@ggbecker ggbecker added backported-into-stabilization PRs which were cherry-picked during stabilization process. STIG STIG Benchmark related. labels Aug 26, 2026
@openshift-ci

openshift-ci Bot commented Aug 26, 2026

Copy link
Copy Markdown

@ggbecker: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-aws-openshift-platform-compliance 10d6a9a link true /test e2e-aws-openshift-platform-compliance

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@Mab879
Mab879 merged commit 0f38142 into ComplianceAsCode:master Aug 26, 2026
71 of 74 checks passed
@Mab879 Mab879 self-assigned this Aug 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backported-into-stabilization PRs which were cherry-picked during stabilization process. RHEL Red Hat Enterprise Linux product related. STIG STIG Benchmark related.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants