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

Fix bash remediation in rsyslog_remote_access_monitoring rule #9253

Conversation

marcusburghardt
Copy link
Member

Description:

In cases where a reference line is not found, a new line was included with invalid syntax.
Removed the escape characters only necessary in the sed command used by this remediation.

Rationale:

In cases where a reference line is not found, a new line was included
with invalid syntax. Removed the escape characters only necessary in
the sed command used by this remediation.
@marcusburghardt marcusburghardt added bugfix Fixes to reported bugs. Bash Bash remediation update. labels Jul 28, 2022
@marcusburghardt marcusburghardt added this to the 0.1.64 milestone Jul 28, 2022
@github-actions
Copy link

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

rhel8 (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_rsyslog_remote_access_monitoring' differs:
--- old datastream
+++ new datastream
@@ -20,7 +20,7 @@
 # Add selector to file
 sed -r -i "0,/^(\S+\s+\/var\/log\/secure$)/s//\1\n${K} \/var\/log\/secure/" /etc/rsyslog.conf
 else
- echo "${K} \/var\/log\/secure/" >> /etc/rsyslog.conf
+ echo "${K} /var/log/secure" >> /etc/rsyslog.conf
 fi
 fi
 done

@codeclimate
Copy link

codeclimate bot commented Jul 28, 2022

Code Climate has analyzed commit aff1de7 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.

@openshift-ci
Copy link

openshift-ci bot commented Jul 28, 2022

@marcusburghardt: 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-rhcos4-high aff1de7 link true /test e2e-aws-rhcos4-high
ci/prow/e2e-aws-rhcos4-moderate aff1de7 link true /test e2e-aws-rhcos4-moderate

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 Jul 29, 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.

Can you add a test scenario covering this situation?

@marcusburghardt
Copy link
Member Author

Can you add a test scenario covering this situation?

The OVAL is not checking the destination of the logs but only if they are collected.
To include a test scenario, it would also be necessary to modify the OVAL to consider all possible values of log destination. I think it would create unnecessary complexity for the moment.

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.

That makes sense.

Basically, we can only test bugs that cause not passing OVAL check.

@jan-cerny jan-cerny merged commit f4e3e22 into ComplianceAsCode:master Aug 2, 2022
@marcusburghardt marcusburghardt deleted the rsyslog_remote_access_monitoring branch August 16, 2022 12:11
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.

rsyslog_remote_access_monitoring bash remediation mangles config file in some cases
2 participants