Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SLE15 SP4 audit_rules_augenrules broken. #9130

Merged
merged 1 commit into from
Jul 12, 2022

Conversation

brett060102
Copy link
Contributor

SLE 15 SP4 changed how augenrules was enabled
in file /usr/lib/systemd/system/auditd.service
pre-SLE15 SP4 had:
ExecStartPost=-/sbin/augenrules --load

This changed in SLE15 SP4 to:
Requires=augenrules.service

Changes:
shared/checks/oval/audit_rules_augenrules.xml change to allow for Requires=augenrules.service

linux_os/guide/system/auditing/auditd_configure_rules/audit_rules_enable_syscall_auditing/ansible/shared.yml
linux_os/guide/system/auditing/auditd_configure_rules/audit_rules_enable_syscall_auditing/bash/shared.sh
These remdiations also checked for "ExecStartPost=-/sbin/augenrules --load"
and were updated to allow for "Requires=augenrules.service"

Description:

  • allow for either:
    ExecStartPost=-/sbin/augenrules --load
    or
    Requires=augenrules.service

to specify augenrules in /usr/lib/systemd/system/auditd.service

Rationale:

  • SLE 15 SP4 uses Requires=augenrules.service tu specify augenrules

SLE 15 SP4 changed how augenrules was enabled
in file /usr/lib/systemd/system/auditd.service
pre-SLE15 SP4 had:
ExecStartPost=-/sbin/augenrules --load

This changed in SLE15 SP4 to:
Requires=augenrules.service

Changes:
shared/checks/oval/audit_rules_augenrules.xml change to allow for Requires=augenrules.service

linux_os/guide/system/auditing/auditd_configure_rules/audit_rules_enable_syscall_auditing/ansible/shared.yml
linux_os/guide/system/auditing/auditd_configure_rules/audit_rules_enable_syscall_auditing/bash/shared.sh
These remdiations also checked for "ExecStartPost=-/sbin/augenrules --load"
and were updated to allow for "Requires=augenrules.service"
@openshift-ci openshift-ci bot added the needs-ok-to-test Used by openshift-ci bot. label Jul 11, 2022
@openshift-ci
Copy link

openshift-ci bot commented Jul 11, 2022

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

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/test-infra repository.

@github-actions
Copy link

Start a new ephemeral environment with changes proposed in this pull request:

sle12 (from CTF) Environment (using Fedora as testing environment)
Open in Gitpod

Fedora Testing Environment
Open in Gitpod

Oracle Linux 8 Environment
Open in Gitpod

@github-actions
Copy link

This datastream diff is auto generated by the check Compare DS/Generate Diff

Click here to see the full diff
bash remediation for rule 'xccdf_org.ssgproject.content_rule_audit_rules_enable_syscall_auditing' differs:
--- old datastream
+++ new datastream
@@ -2,9 +2,9 @@
 if rpm --quiet -q audit; then
 
 if [ -f "/usr/lib/systemd/system/auditd.service" ] ; then
- EXECSTARTPOST_SCRIPT=$(grep '^ExecStartPost=' /usr/lib/systemd/system/auditd.service | sed 's/ExecStartPost=//')
+ IS_AUGENRULES=$(grep -E "^(ExecStartPost=|Requires=augenrules\.service)" /usr/lib/systemd/system/auditd.service)
 
- if [[ "$EXECSTARTPOST_SCRIPT" == *"augenrules"* ]] ; then
+ if [[ "$IS_AUGENRULES" == *"augenrules"* ]] ; then
 for f in /etc/audit/rules.d/*.rules ; do
 sed -E -i --follow-symlinks 's/^(\s*-a\s+task,never)/#\1/' "$f"
 done

ansible remediation for rule 'xccdf_org.ssgproject.content_rule_audit_rules_enable_syscall_auditing' differs:
--- old datastream
+++ new datastream
@@ -25,7 +25,7 @@
 - restrict_strategy
 
 - name: Check the rules script being used
- command: grep '^ExecStartPost' /usr/lib/systemd/system/auditd.service
+ command: grep -E '^(ExecStartPost|Requires)' /usr/lib/systemd/system/auditd.service
 register: check_rules_scripts_result
 when: '"audit" in ansible_facts.packages'
 tags:

@codeclimate
Copy link

codeclimate bot commented Jul 11, 2022

Code Climate has analyzed commit 1e1d0d2 and detected 0 issues on this pull request.

The test coverage on the diff in this pull request is 100.0% (50% is the threshold).

This pull request will bring the total coverage in the repository to 42.7% (0.0% change).

View more on Code Climate.

@Mab879
Copy link
Member

Mab879 commented Jul 11, 2022

/ok-to-test

@openshift-ci openshift-ci bot added ok-to-test Used by openshift-ci bot. and removed needs-ok-to-test Used by openshift-ci bot. labels Jul 11, 2022
@Mab879
Copy link
Member

Mab879 commented Jul 11, 2022

/retest

@openshift-ci
Copy link

openshift-ci bot commented Jul 11, 2022

@brett060102: The following tests 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-ocp4-moderate-node 1e1d0d2 link true /test e2e-aws-ocp4-moderate-node
ci/prow/e2e-aws-ocp4-high 1e1d0d2 link true /test e2e-aws-ocp4-high
ci/prow/e2e-aws-ocp4-pci-dss-node 1e1d0d2 link true /test e2e-aws-ocp4-pci-dss-node
ci/prow/e2e-aws-rhcos4-moderate 1e1d0d2 link true /test e2e-aws-rhcos4-moderate
ci/prow/e2e-aws-ocp4-stig-node 1e1d0d2 link true /test e2e-aws-ocp4-stig-node
ci/prow/e2e-aws-ocp4-e8 1e1d0d2 link true /test e2e-aws-ocp4-e8
ci/prow/e2e-aws-ocp4-cis-node 1e1d0d2 link true /test e2e-aws-ocp4-cis-node
ci/prow/e2e-aws-rhcos4-e8 1e1d0d2 link true /test e2e-aws-rhcos4-e8
ci/prow/e2e-aws-ocp4-cis 1e1d0d2 link true /test e2e-aws-ocp4-cis
ci/prow/e2e-aws-rhcos4-high 1e1d0d2 link true /test e2e-aws-rhcos4-high
ci/prow/e2e-aws-ocp4-pci-dss 1e1d0d2 link true /test e2e-aws-ocp4-pci-dss
ci/prow/e2e-aws-ocp4-moderate 1e1d0d2 link true /test e2e-aws-ocp4-moderate
ci/prow/e2e-aws-ocp4-stig 1e1d0d2 link true /test e2e-aws-ocp4-stig
ci/prow/e2e-aws-ocp4-high-node 1e1d0d2 link true /test e2e-aws-ocp4-high-node

Full PR test history. Your PR dashboard.

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/test-infra repository. I understand the commands that are listed here.

@brett060102
Copy link
Contributor Author

/retest

@brett060102
Copy link
Contributor Author

@Mab879
I have looked over the the failing tests:
Gate (AR / RHEL) / Build, Lint Ansible Roles on Fedora Latest : Don't think this is from my change. My changes don't add any new pipes in the ansible code.

Automatus CS8 / Run Tests (pull_request) and Automatus CS9 / Run Tests (pull_request)
failing because rule_audit_rules_enable_syscall_auditing not in RHEL benchmark and it is not in the profile, but not related to my change.

ci/prow/e2e-aws-ocp4-* tests, I can't really tell why these are failing, but does not look like it is related to my changes.

@Mab879
Copy link
Member

Mab879 commented Jul 12, 2022

@Mab879 I have looked over the the failing tests: Gate (AR / RHEL) / Build, Lint Ansible Roles on Fedora Latest : Don't think this is from my change. My changes don't add any new pipes in the ansible code.

Correct. This is being fixed in #9123.

Automatus CS8 / Run Tests (pull_request) and Automatus CS9 / Run Tests (pull_request) failing because rule_audit_rules_enable_syscall_auditing not in RHEL benchmark and it is not in the profile, but not related to my change.

Agreed.

ci/prow/e2e-aws-ocp4-* tests, I can't really tell why these are failing, but does not look like it is related to my changes.

I would agree, it seems to issue with the test itself.

Thanks for double-checking on this.

@Mab879 Mab879 merged commit 23e13e0 into ComplianceAsCode:master Jul 12, 2022
@Mab879 Mab879 added Ansible Ansible remediation update. SLES SUSE Linux Enterprise Server product related. OVAL OVAL update. Related to the systems assessments. Bash Bash remediation update. labels Jul 12, 2022
@Mab879 Mab879 added this to the 0.1.63 milestone Jul 12, 2022
@brett060102
Copy link
Contributor Author

@Mab879 Thank you. How do new tags get created. We package from the tags. So, I was wondering when a tag with this change included might be created?

@Mab879
Copy link
Member

Mab879 commented Jul 12, 2022

@Mab879 Thank you. How do new tags get created. We package from the tags. So, I was wondering when a tag with this change included might be created?

We release the project every two months. The next stabilization period starts on Monday, July 18, 2022. With an expected release date of July 29, 2022. That release date may be subject to change, usually, at most we will slip by a week. We put the release dates on the milestone page as well.

Thanks all for your contributions to the project!

@brett060102
Copy link
Contributor Author

@Mab879 Thank you very much.

@brett060102 brett060102 deleted the SUSE_FIX_SP4 branch June 28, 2023 20:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Ansible Ansible remediation update. Bash Bash remediation update. ok-to-test Used by openshift-ci bot. OVAL OVAL update. Related to the systems assessments. SLES SUSE Linux Enterprise Server product related.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants