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

Update ensure_logrotate_activated for image mode #12645

Merged

Conversation

jan-cerny
Copy link
Collaborator

This rule will be reworked to work well during a bootable container image build. First, the OVAL will use an internal check for the logrotate timer instead of extend_definition which uses OVAL systemdunitproperty test which doesn't work in that environment. Second, we will installed crontabs package to make sure that the files required by the bash remediation are present.

This rule will be reworked to work well during a bootable container
image build. First, the OVAL will use an internal check for the
logrotate timer instead of extend_definition which uses OVAL
systemdunitproperty test which doesn't work in that environment.
Second, we will installed crontabs package to make sure
that the files required by the bash remediation are present.
@jan-cerny jan-cerny added OVAL OVAL update. Related to the systems assessments. Bash Bash remediation update. Image Mode Bootable containers and Image Mode RHEL labels Nov 27, 2024
@jan-cerny jan-cerny added this to the 0.1.76 milestone Nov 27, 2024
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

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_ensure_logrotate_activated' differs.
--- xccdf_org.ssgproject.content_rule_ensure_logrotate_activated
+++ xccdf_org.ssgproject.content_rule_ensure_logrotate_activated
@@ -3,6 +3,9 @@
 
 LOGROTATE_CONF_FILE="/etc/logrotate.conf"
 
+if ! rpm -q --quiet "crontabs" ; then
+    yum install -y "crontabs"
+fi
 CRON_DAILY_LOGROTATE_FILE="/etc/cron.daily/logrotate"
 
 

Copy link
Member

@Mab879 Mab879 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Waving automatus as they pass locally.

Thanks!

@Mab879 Mab879 merged commit 4c8b22c into ComplianceAsCode:master Dec 2, 2024
96 of 101 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bash Bash remediation update. Image Mode Bootable containers and Image Mode RHEL OVAL OVAL update. Related to the systems assessments.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants