-
Notifications
You must be signed in to change notification settings - Fork 684
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
Simplify generated augen bash expressions #8254
Conversation
Certain checks can be performed at expansion time rather than at execution time
This datastream diff is auto generated by the check Click here to see the full diffbash remediation for rule 'xccdf_org.ssgproject.content_rule_audit_rules_privileged_commands' differs:
--- old datastream
+++ new datastream
@@ -106,8 +106,8 @@
# searched all of the files from /etc/audit/rules.d/*.rules location (since that audit rule can be defined
# in any of those files and if not, we want it to be inserted only once into /etc/audit/rules.d/privileged.rules file)
#
- elif [ "auditctl" == "auditctl" ] || [[ "auditctl" == "augenrules" && $count_of_inspected_files -eq "${#files_to_inspect[@]}" ]]
- then
+
+ else
# Check if this sbinary wasn't already handled in some of the previous afile iterations
# Return match only if whole sbinary definition matched (not in the case just prefix matched!!!)
if [[ ! $(sed -ne "\|${sbinary}|p" <<< "${sbinaries_to_skip[*]}") ]]
@@ -224,8 +224,9 @@
# searched all of the files from /etc/audit/rules.d/*.rules location (since that audit rule can be defined
# in any of those files and if not, we want it to be inserted only once into /etc/audit/rules.d/privileged.rules file)
#
- elif [ "augenrules" == "auditctl" ] || [[ "augenrules" == "augenrules" && $count_of_inspected_files -eq "${#files_to_inspect[@]}" ]]
+ elif [[ $count_of_inspected_files -eq "${#files_to_inspect[@]}" ]]
then
+
# Check if this sbinary wasn't already handled in some of the previous afile iterations
# Return match only if whole sbinary definition matched (not in the case just prefix matched!!!)
if [[ ! $(sed -ne "\|${sbinary}|p" <<< "${sbinaries_to_skip[*]}") ]] |
@matejak: The following tests failed, say
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test scenarios pass locally, probably due to the container used in GH CI.
Certain checks can be performed at expansion time rather than at execution time.
The datastream diff is a good helper to see what this fix is about.