Skip to content

Add missing OCIL to three PCI-DSS RHEL8 rules (#4913) - #15125

Open
raviaxo wants to merge 1 commit into
ComplianceAsCode:masterfrom
raviaxo:ocil-pcidss-rhel8-4913
Open

raviaxo wants to merge 1 commit into
ComplianceAsCode:masterfrom
raviaxo:ocil-pcidss-rhel8-4913

Conversation

@raviaxo

@raviaxo raviaxo commented Sep 15, 2026

Copy link
Copy Markdown

Description:

  • Adds the missing ocil and ocil_clause to three rules in the PCI-DSS RHEL8 profile:

    • audit_rules_session_events — a single auditctl -l | grep -E command matching /var/run/utmp, /var/log/btmp and /var/log/wtmp at once, following the pattern already used by audit_rules_usergroup_modification.
    • chronyd_or_ntpd_specify_multiple_servers — checks for two or more server lines for whichever NTP daemon is in use, using the chrony_conf_path product variable rather than a hardcoded path, since it differs on Debian-family products.
    • disable_prelink — follows the OVAL, which is an OR of "prelink package not installed" and PRELINKING=no in /etc/sysconfig/prelink, so the OCIL checks the package first and the setting second.
  • Two of the five rules named in the issue already have OCIL on current master and are left untouched: audit_rules_immutable and security_patches_up_to_date.

Rationale:

Review Hints:

  • The only difference from Add missing OCIL to three PCI-DSS RHEL8 rules (#4913) #15033 is audit_rules_session_events. That rule previously called ocil_audit_rules_watch() once per watched file, which repeated the same "Verify ... with the following command" instruction three times. It is now custom text with one grep, as requested in review.

  • The path alternation is deliberately style-agnostic: each path appears in the auditctl -l output whether the rule renders as -w <path> -p wa -k session or as -a always,exit -F path=<path> -F perm=wa -F key=session, so the text does not need to branch on audit_watches_style. The wording says "lines" rather than "a line" because the modern style emits a b32 and a b64 line per file.

  • ocil_clause on that rule is left as there is not output, unchanged from master.

Issue ComplianceAsCode#4913 lists five rules in the PCI-DSS RHEL8 profile as missing OCIL.
Two of them already have it on current master and are left untouched:

  audit_rules_immutable        - has ocil_clause + ocil
  security_patches_up_to_date  - has ocil_clause + ocil

The remaining three are addressed here:

  audit_rules_session_events                 uses a single
      "auditctl -l | grep -E" command matching /var/run/utmp,
      /var/log/btmp and /var/log/wtmp at once, following the pattern
      already used by audit_rules_usergroup_modification. The path
      alternation works under both watch styles, since each path appears
      in the auditctl output whether the rule renders as "-w <path>" or
      as "-a always,exit -F path=<path>".

  chronyd_or_ntpd_specify_multiple_servers   checks for two or more
      "server" lines for whichever NTP daemon is in use. Uses the
      chrony_conf_path product variable rather than a hardcoded path,
      since it differs on Debian-family products.

  disable_prelink                            follows the OVAL, which is an
      OR of "prelink package not installed" and "PRELINKING=no in
      /etc/sysconfig/prelink", so the OCIL checks the package first and
      the setting second.

Each ocil_clause is phrased so it reads as the failure condition, matching
the surrounding rules.
@openshift-ci openshift-ci Bot added the needs-ok-to-test Used by openshift-ci bot. label Sep 15, 2026
@openshift-ci

openshift-ci Bot commented Sep 15, 2026

Copy link
Copy Markdown

Hi @raviaxo. Thanks for your PR.

I'm waiting for a ComplianceAsCode member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work.

Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

@macko1

macko1 commented Sep 18, 2026

Copy link
Copy Markdown
Collaborator

@jan-cerny PTAL, seems this is a conclusion of your review in #15033

Thanks 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-ok-to-test Used by openshift-ci bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Some rules in PCI-DSS profile are missing OCIL (RHEL8)

3 participants