Skip to content

Fix broken remediation in file_ownership_var_log_audit_stig - #15130

Open
jan-cerny wants to merge 1 commit into
ComplianceAsCode:masterfrom
jan-cerny:issue15129
Open

jan-cerny wants to merge 1 commit into
ComplianceAsCode:masterfrom
jan-cerny:issue15129

Conversation

@jan-cerny

Copy link
Copy Markdown
Member

The chown command contained duplicate directory path, which caused that the file woner on the log file wasn't changed.

In addition, enable Ansible remediation for this rule on RHEL.

Fixes: #15129

Review Hints:

  • Run automatus tests for the rule file_ownership_var_log_audit_stig before and after this change, with both Bash and Ansible.

The `chown` command contained duplicate directory path, which caused
that the file woner on the log file wasn't changed.

In addition, enable Ansible remediation for this rule on RHEL.

Fixes: ComplianceAsCode#15129
@jan-cerny jan-cerny added this to the 0.1.83 milestone Sep 18, 2026
@github-actions

Copy link
Copy Markdown
Contributor

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_file_ownership_var_log_audit_stig' differs.
--- xccdf_org.ssgproject.content_rule_file_ownership_var_log_audit_stig
+++ xccdf_org.ssgproject.content_rule_file_ownership_var_log_audit_stig
@@ -6,7 +6,7 @@
 fi
 
 FILE=${FILE:-/var/log/audit/audit.log}
-chown root "$(dirname "$FILE")"/"${FILE}"*
+chown root "${FILE}"*
 
 else
     >&2 echo 'Remediation is not applicable, nothing was done'

@openshift-ci

openshift-ci Bot commented Sep 18, 2026

Copy link
Copy Markdown

@jan-cerny: 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/4.12-images f5dc275 link true /test 4.12-images

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.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

file_ownership_var_log_audit_stig/wrong_value.fail test scenario fails

1 participant