Skip to content

[template] Allow oval template of audit_rules_dac_modification to check both auid>=1000 auid=0 exist - #15107

Open
alanmcanonical wants to merge 2 commits into
ComplianceAsCode:masterfrom
alanmcanonical:audit_dac
Open

alanmcanonical wants to merge 2 commits into
ComplianceAsCode:masterfrom
alanmcanonical:audit_dac

Conversation

@alanmcanonical

@alanmcanonical alanmcanonical commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Description:

  • Check both auid>=1000 auid=0 exist
  • Update audit_rules_dac_modification and audit_rules_unsuccessful_file_modification OVAL template to allow auid to be not equal to -1 See Update privileged commands templates #8383

Signed-off-by: Alan Moore <alan.moore@canonical.com>
@openshift-ci openshift-ci Bot added the needs-ok-to-test Used by openshift-ci bot. label Sep 9, 2026
@openshift-ci

openshift-ci Bot commented Sep 9, 2026

Copy link
Copy Markdown

Hi @alanmcanonical. 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.

Tip

We noticed you've done this a few times! Consider joining the org to skip this step and gain /lgtm and other bot rights. We recommend asking approvers on your previous PRs to sponsor you.

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.

@alanmcanonical

Copy link
Copy Markdown
Contributor Author

test result:

INFO - xccdf_org.ssgproject.content_rule_audit_rules_dac_modification_fremovexattr
INFO - Script wrong_list_action.fail.sh using profile (all) OK
INFO - Script wrong_syscall.fail.sh using profile (all) OK
INFO - Script rules_not_there.fail.sh using profile (all) OK
INFO - Script correct_rules.pass.sh using profile (all) OK

Update audit_rules_dac_modification and audit_rules_unsuccessful_file_modification
OVAL template to match '-1'
Follow 8d49c69 in pr ComplianceAsCode#8383

Signed-off-by: Alan Moore <alan.moore@canonical.com>
@macko1

macko1 commented Sep 15, 2026

Copy link
Copy Markdown
Collaborator

Hi @alanmcanonical, could you update the PR title and description to follow the template? Please also describe the test scenarios, as that will speed up the review. Thanks!

@alanmcanonical alanmcanonical changed the title Check both auid>=1000 auid=0 exist [template] Allow oval template of audit_rules_dac_modification to check both auid>=1000 auid=0 exist Sep 15, 2026
@macko1 macko1 self-assigned this Sep 16, 2026
@macko1

macko1 commented Sep 21, 2026

Copy link
Copy Markdown
Collaborator

@alanmcanonical Please fix the CI errors before marking the PR as ready for review.
Also please describe the scenario what lead to this error, describe the fix and test all rules implementing this template (Ideally provide the scenarios so reviewers can follow the same testing path as you).

Thanks a lot 🙏.

@@ -12,14 +12,15 @@
{{% endif %}}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

See comment ^

@alanmcanonical

Copy link
Copy Markdown
Contributor Author

In noble stig v1r6, rule UBTU-24-900130 reuqires

-a always,exit -F arch=b32 -S
setxattr,fsetxattr,lsetxattr,removexattr,fremovexattr,lremovexattr -F auid>=1000 -F auid!
=-1 -k perm_mod
-a always,exit -F arch=b32 -S
setxattr,fsetxattr,lsetxattr,removexattr,fremovexattr,lremovexattr -F auid=0 -k perm_mod
-a always,exit -F arch=b64 -S
setxattr,fsetxattr,lsetxattr,removexattr,fremovexattr,lremovexattr -F auid>=1000 -F auid!
=-1 -k perm_mod
-a always,exit -F arch=b64 -S
setxattr,fsetxattr,lsetxattr,removexattr,fremovexattr,lremovexattr -F auid=0 -k perm_mod

there are both filter -F auid>=1000 and -F auid!=-1 which leads to change https://github.com/ComplianceAsCode/content/pull/15107/changes#diff-c9ad57ea9e0cdf649fda88a9e8e66507440b5fa8e21d4633e77e6a70d3a93289R64

CHECK_ROOT_USER means oval should check both test_64bit_ardm_{{{ ATTR }}}_augenrules AND test_64bit_ardm_{{{ ATTR }}}_augenrules_auid_0 so connect them using logic AND

@alanmcanonical

Copy link
Copy Markdown
Contributor Author

the failed test plan

Installed:
  contest-pack-1-1.noarch                                                       

Complete!
Traceback (most recent call last):
  File "/var/ARTIFACTS/work-cui_xkr18ks/plans/upstream-parallel/ansible/cui/discover/default-0/tests/lib/runtest.py", line 37, in <module>
    runpy.run_path(str(test_script), run_name='__main__')
  File "<frozen runpy>", line 287, in run_path
  File "<frozen runpy>", line 98, in _run_module_code
  File "<frozen runpy>", line 88, in _run_code
  File "/var/ARTIFACTS/work-cui_xkr18ks/plans/upstream-parallel/ansible/cui/discover/default-0/tests/hardening/host-os/ansible/test.py", line 27, in <module>
    playbook = util.get_playbook(profile)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/var/ARTIFACTS/work-cui_xkr18ks/plans/upstream-parallel/ansible/cui/discover/default-0/tests/lib/util/content.py", line 135, in get_playbook
    raise RuntimeError(f"cound not find playbook as {playbook}")
RuntimeError: cound not find playbook as /usr/share/scap-security-guide/ansible/cs10-playbook-cui.yml
2026-09-09 12:21:42 runtest.py:40: lib.waive.collect_waivers:150: using /var/ARTIFACTS/work-cui_xkr18ks/plans/upstream-parallel/ansible/cui/discover/default-0/tests/conf/waivers for waiving
2026-09-09 12:21:42 runtest.py:40: lib.results.report_plain:244: ERROR / (RuntimeError: cound not find playbook as /usr/share/scap-security-guide/ansible/cs10-playbook-cui.yml)
Shared connection to 13.59.182.132 closed.

doesn't relate to this pr changs

This branch has not been deployed

No deployments
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