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 file_permissions_etc_chrony_keys #12521

Conversation

Mab879
Copy link
Member

@Mab879 Mab879 commented Oct 21, 2024

Description:

file_permissions_etc_chrony_keys to 644

Rationale:

Make it so that chrony can still read it once it drops root

@Mab879 Mab879 added the Update Rule Issues or pull requests related to Rules updates. label Oct 21, 2024
@Mab879 Mab879 added this to the 0.1.75 milestone Oct 21, 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

github-actions bot commented Oct 21, 2024

This datastream diff is auto generated by the check Compare DS/Generate Diff

Click here to see the full diff
New content has different text for rule 'xccdf_org.ssgproject.content_rule_file_permissions_etc_chrony_keys'.
--- xccdf_org.ssgproject.content_rule_file_permissions_etc_chrony_keys
+++ xccdf_org.ssgproject.content_rule_file_permissions_etc_chrony_keys
@@ -3,7 +3,7 @@
 Verify Permissions On /etc/chrony.keys File
 
 [description]:
-To properly set the permissions of /etc/chrony.keys, run the command: $ sudo chmod 0600 /etc/chrony.keys
+To properly set the permissions of /etc/chrony.keys, run the command: $ sudo chmod 0644 /etc/chrony.keys
 
 [reference]:
 R50

OCIL for rule 'xccdf_org.ssgproject.content_rule_file_permissions_etc_chrony_keys' differs.
--- ocil:ssg-file_permissions_etc_chrony_keys_ocil:questionnaire:1
+++ ocil:ssg-file_permissions_etc_chrony_keys_ocil:questionnaire:1
@@ -2,6 +2,6 @@
 run the command:
 $ ls -l /etc/chrony.keys
 If properly configured, the output should indicate the following permissions:
-0600
-      Is it the case that /etc/chrony.keys does not have unix mode 0600?
+0644
+      Is it the case that /etc/chrony.keys does not have unix mode 0644?
       
bash remediation for rule 'xccdf_org.ssgproject.content_rule_file_permissions_etc_chrony_keys' differs.
--- xccdf_org.ssgproject.content_rule_file_permissions_etc_chrony_keys
+++ xccdf_org.ssgproject.content_rule_file_permissions_etc_chrony_keys
@@ -1,7 +1,7 @@
 # Remediation is applicable only in certain platforms
 if rpm --quiet -q kernel; then
 
-chmod u-xs,g-xwrs,o-xwrt /etc/chrony.keys
+chmod u-xs,g-xws,o-xwt /etc/chrony.keys
 
 else
     >&2 echo 'Remediation is not applicable, nothing was done'

ansible remediation for rule 'xccdf_org.ssgproject.content_rule_file_permissions_etc_chrony_keys' differs.
--- xccdf_org.ssgproject.content_rule_file_permissions_etc_chrony_keys
+++ xccdf_org.ssgproject.content_rule_file_permissions_etc_chrony_keys
@@ -24,10 +24,10 @@
   - medium_severity
   - no_reboot_needed
 
-- name: Ensure permission u-xs,g-xwrs,o-xwrt on /etc/chrony.keys
+- name: Ensure permission u-xs,g-xws,o-xwt on /etc/chrony.keys
   file:
     path: /etc/chrony.keys
-    mode: u-xs,g-xwrs,o-xwrt
+    mode: u-xs,g-xws,o-xwt
   when:
   - '"kernel" in ansible_facts.packages'
   - file_exists.stat is defined and file_exists.stat.exists

@jan-cerny jan-cerny self-assigned this Oct 22, 2024
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.

Please change also the description, OCIL, etc.

Also, the PR description is different than the actual change.

Make it so that chrony can still read it once it drops root
@Mab879 Mab879 force-pushed the adjust_file_permissions_etc_chrony_keys branch from 3163263 to 396c235 Compare October 22, 2024 14:56
Copy link

codeclimate bot commented Oct 22, 2024

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

@jan-cerny jan-cerny merged commit 84b8191 into ComplianceAsCode:master Oct 23, 2024
102 of 104 checks passed
@Mab879 Mab879 deleted the adjust_file_permissions_etc_chrony_keys branch October 23, 2024 14:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Update Rule Issues or pull requests related to Rules updates.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants