Skip to content

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

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

Add missing OCIL to three PCI-DSS RHEL8 rules (#4913)#15033
raviaxo wants to merge 1 commit into
ComplianceAsCode:masterfrom
raviaxo:ocil-pcidss-rhel8-4913

Conversation

@raviaxo

@raviaxo raviaxo commented Aug 23, 2026

Copy link
Copy Markdown

Addresses #4913, which lists five rules in the PCI-DSS RHEL8 profile as missing OCIL.

Two of the five already have OCIL on current master and are left untouched:

  • audit_rules_immutable
  • security_patches_up_to_date

The remaining three are addressed here. In each case I followed the rule's existing check rather than writing fresh prose, so the manual check and the automated one describe the same thing:

  • audit_rules_session_events — uses the existing ocil_audit_rules_watch() macro for /var/run/utmp, /var/log/btmp and /var/log/wtmp with the session key, the same way audit_rules_sysadmin_actions renders its watches.
  • chronyd_or_ntpd_specify_multiple_servers — checks for two or more server lines for whichever NTP daemon is in use, matching the OVAL, which requires {2,} matches. 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 as the failure condition, matching the surrounding rules.

Not built locally, and I would rather say so than imply otherwise. The machine I wrote this on has neither yaml nor jinja2 available to the system Python, so I verified structurally rather than by building: the ocil_audit_rules_watch macro exists with that signature and is used identically elsewhere, chrony_conf_path is a defined product variable, the jinja braces balance, and both keys are present on each rule. I am relying on CI for the actual build. Two things I caught this way and fixed before pushing: an earlier draft referenced prelink_conf_path, which does not exist anywhere in the project, and hardcoded /etc/chrony.d/*.conf, which is wrong on Debian-family products.

Happy to adjust wording or split this if you would rather have one rule per PR.

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 the existing
      ocil_audit_rules_watch() macro for /var/run/utmp, /var/log/btmp and
      /var/log/wtmp with the "session" key, matching how
      audit_rules_sysadmin_actions renders its watches.

  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 Aug 23, 2026
@openshift-ci

openshift-ci Bot commented Aug 23, 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.

@jan-cerny jan-cerny self-assigned this Aug 24, 2026
@jan-cerny jan-cerny added this to the 0.1.83 milestone Aug 24, 2026
Comment on lines +57 to +59
{{{ ocil_audit_rules_watch("/var/run/utmp", "session") }}}
{{{ ocil_audit_rules_watch("/var/log/btmp", "session") }}}
{{{ ocil_audit_rules_watch("/var/log/wtmp", "session") }}}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The output that these macros create is really weird because it contains the instructions three times. It isn't really reader friendly. Instead, I'd prefer having here a custom text that contains just a single grep command that will find all 3 audit rules.

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.

2 participants