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

Simplify generated augen bash expressions #8254

Merged
merged 1 commit into from
Feb 23, 2022

Conversation

matejak
Copy link
Member

@matejak matejak commented Feb 22, 2022

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.

Certain checks can be performed at expansion time
rather than at execution time
@matejak matejak added bugfix Fixes to reported bugs. Bash Bash remediation update. labels Feb 22, 2022
@matejak matejak added this to the 0.1.61 milestone Feb 22, 2022
@matejak matejak changed the title Simplify generated expressions Simplify generated augen bash expressions Feb 22, 2022
@github-actions
Copy link

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

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_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[*]}") ]]

@openshift-ci
Copy link

openshift-ci bot commented Feb 22, 2022

@matejak: 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-e8 a3a9446 link true /test e2e-aws-ocp4-e8
ci/prow/e2e-aws-ocp4-moderate-node a3a9446 link true /test e2e-aws-ocp4-moderate-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.

@jan-cerny jan-cerny self-assigned this Feb 23, 2022
Copy link
Collaborator

@jan-cerny jan-cerny left a 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.

@jan-cerny jan-cerny merged commit e16b72b into ComplianceAsCode:master Feb 23, 2022
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bash Bash remediation update. bugfix Fixes to reported bugs.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants