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

Modify SLE remediation for ensure_logrotate_activated #10481

Conversation

teacup-on-rockingchair
Copy link
Contributor

Description:

  • For logrotate enabled rule, in SLE context, prefer timer service over cron schedule

Rationale:

  • In SLE platforms it is preferred to utilize logrotate timer service for log rotation functionality. OVAL check remains sam, and will accept cron-based configuration, but in case of missing scheduled timer, timer service is preferred over cron.

In SLE platforms it is prefered to utilise logrotate timer service for log rotation functionality.
Check remains sam, and will accept cron-based configuration, but in case of missing scheduled timer,
timer service is prefered over cron.
@teacup-on-rockingchair teacup-on-rockingchair added Ansible Ansible remediation update. Bash Bash remediation update. SLES SUSE Linux Enterprise Server product related. labels Apr 23, 2023
@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

github-actions bot commented Apr 23, 2023

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_ensure_logrotate_activated' differs.
--- xccdf_org.ssgproject.content_rule_ensure_logrotate_activated
+++ xccdf_org.ssgproject.content_rule_ensure_logrotate_activated
@@ -2,13 +2,16 @@
 if [ ! -f /.dockerenv ] && [ ! -f /run/.containerenv ]; then
 
 LOGROTATE_CONF_FILE="/etc/logrotate.conf"
+
 CRON_DAILY_LOGROTATE_FILE="/etc/cron.daily/logrotate"
+
 
 # daily rotation is configured
 grep -q "^daily$" $LOGROTATE_CONF_FILE|| echo "daily" >> $LOGROTATE_CONF_FILE
 
 # remove any line configuring weekly, monthly or yearly rotation
 sed -i '/^\s*\(weekly\|monthly\|yearly\).*$/d' $LOGROTATE_CONF_FILE
+
 
 # configure cron.daily if not already
 if ! grep -q "^[[:space:]]*/usr/sbin/logrotate[[:alnum:][:blank:][:punct:]]*$LOGROTATE_CONF_FILE$" $CRON_DAILY_LOGROTATE_FILE; then

@teacup-on-rockingchair teacup-on-rockingchair marked this pull request as draft April 23, 2023 15:47
@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Used by openshift-ci bot. label Apr 23, 2023
@codeclimate
Copy link

codeclimate bot commented Apr 23, 2023

Code Climate has analyzed commit 8f09957 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 52.4% (0.0% change).

View more on Code Climate.

@teacup-on-rockingchair teacup-on-rockingchair marked this pull request as ready for review April 23, 2023 17:34
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Used by openshift-ci bot. label Apr 23, 2023
@marcusburghardt marcusburghardt added this to the 0.1.68 milestone Apr 24, 2023
@marcusburghardt marcusburghardt added the Update Rule Issues or pull requests related to Rules updates. label Apr 24, 2023
@marcusburghardt marcusburghardt self-assigned this Apr 24, 2023
@marcusburghardt marcusburghardt merged commit 910788e into ComplianceAsCode:master Apr 24, 2023
32 of 33 checks passed
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. SLES SUSE Linux Enterprise Server product related. Update Rule Issues or pull requests related to Rules updates.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants