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

SLE15 related fixes in ntp and aide rules #12548

Merged

Conversation

teacup-on-rockingchair
Copy link
Contributor

Description:

  • Some bug fixes for SLE platform in remediations for ntp and aide rules

Rationale:

  • Fix maxpoll remediatian also for cases when maxpoll is negative
  • Fix bug with register ansible variable in permissions_local_var_log_audit rule, causing exception
  • Remediate AIDE periodic cron check in SLE via settings in crontab file

@teacup-on-rockingchair teacup-on-rockingchair added Ansible Ansible remediation update. Bash Bash remediation update. SLES SUSE Linux Enterprise Server product related. labels Oct 27, 2024
@teacup-on-rockingchair teacup-on-rockingchair added this to the 0.1.75 milestone Oct 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_chronyd_or_ntpd_set_maxpoll' differs.
--- xccdf_org.ssgproject.content_rule_chronyd_or_ntpd_set_maxpoll
+++ xccdf_org.ssgproject.content_rule_chronyd_or_ntpd_set_maxpoll
@@ -20,7 +20,7 @@
 
 for config_file in "${CONFIG_FILES[@]}" ; do
     # Set maxpoll values to var_time_service_set_maxpoll
-    sed -i "s/^\(\(server\|pool\|peer\).*maxpoll\) [0-9][0-9]*\(.*\)$/\1 $var_time_service_set_maxpoll \3/" "$config_file"
+    sed -i "s/^\(\(server\|pool\|peer\).*maxpoll\) [0-9,-][0-9]*\(.*\)$/\1 $var_time_service_set_maxpoll \3/" "$config_file"
 done
 
 for config_file in "${CONFIG_FILES[@]}" ; do

ansible remediation for rule 'xccdf_org.ssgproject.content_rule_chronyd_or_ntpd_set_maxpoll' differs.
--- xccdf_org.ssgproject.content_rule_chronyd_or_ntpd_set_maxpoll
+++ xccdf_org.ssgproject.content_rule_chronyd_or_ntpd_set_maxpoll
@@ -172,7 +172,7 @@
 - name: Configure Time Service Maxpoll Interval - Update the maxpoll Values in /etc/chrony.d/
   ansible.builtin.replace:
     path: '{{ item.path }}'
-    regexp: ^((?:server|pool|peer).*maxpoll)[ ]+[0-9]+(.*)$
+    regexp: ^((?:server|pool|peer).*maxpoll)[ ]+[0-9,-]+(.*)$
     replace: \1 {{ var_time_service_set_maxpoll }}\2
   loop: '{{ chrony_d_conf_files.files }}'
   when:

Copy link

codeclimate bot commented Oct 27, 2024

Code Climate has analyzed commit ea19d37 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 60.9% (0.0% change).

View more on Code Climate.

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.

I have run test scenarios on a RHEL 9 VM abckend and they passed.

@jan-cerny jan-cerny merged commit 21a4c72 into ComplianceAsCode:master Oct 30, 2024
98 of 104 checks passed
@jan-cerny jan-cerny self-assigned this Oct 30, 2024
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants