Stabilization: Adjust file rules to not follow symlinks - #15031
Merged
Conversation
Following symlinks can lead to issues
|
This datastream diff is auto generated by the check Click here to see the full diffansible remediation for rule 'xccdf_org.ssgproject.content_rule_accounts_users_home_files_groupownership' differs.
--- xccdf_org.ssgproject.content_rule_accounts_users_home_files_groupownership
+++ xccdf_org.ssgproject.content_rule_accounts_users_home_files_groupownership
@@ -66,6 +66,7 @@
path: '{{ item.0.value[4] }}'
group: '{{ item.0.value[2] }}'
recurse: true
+ follow: false
loop: '{{ local_users|zip(path_exists.results)|list }}'
when:
- '"kernel-core" in ansible_facts.packages'
ansible remediation for rule 'xccdf_org.ssgproject.content_rule_accounts_users_home_files_ownership' differs.
--- xccdf_org.ssgproject.content_rule_accounts_users_home_files_ownership
+++ xccdf_org.ssgproject.content_rule_accounts_users_home_files_ownership
@@ -62,6 +62,7 @@
path: '{{ item.0.value[4] }}'
owner: '{{ item.0.value[1] }}'
recurse: true
+ follow: false
loop: '{{ local_users|zip(path_exists.results)|list }}'
when:
- '"kernel-core" in ansible_facts.packages'
bash remediation for rule 'xccdf_org.ssgproject.content_rule_accounts_users_netrc_file_permissions' differs.
--- xccdf_org.ssgproject.content_rule_accounts_users_netrc_file_permissions
+++ xccdf_org.ssgproject.content_rule_accounts_users_netrc_file_permissions
@@ -1,5 +1,5 @@
for user in $(awk -F':' '{ if ($3 >= 1000 && $3 != 65534) print $1 }' /etc/passwd); do
home_dir=$(getent passwd "$user" | cut -d: -f6)
- find "${home_dir}/.netrc" -exec chmod 0600 {} \;
+ find "${home_dir}/.netrc" -type f -exec chmod 0600 {} \;
done
ansible remediation for rule 'xccdf_org.ssgproject.content_rule_accounts_users_netrc_file_permissions' differs.
--- xccdf_org.ssgproject.content_rule_accounts_users_netrc_file_permissions
+++ xccdf_org.ssgproject.content_rule_accounts_users_netrc_file_permissions
@@ -47,7 +47,7 @@
mode: '0600'
state: file
loop: '{{ path_exists.results }}'
- when: item.stat is defined and item.stat.exists
+ when: item.stat is defined and item.stat.exists and not item.stat.islnk
tags:
- CCE-87369-5
- accounts_users_netrc_file_permissions |
jan-cerny
approved these changes
Aug 24, 2026
jan-cerny
merged commit Aug 24, 2026
d067187
into
ComplianceAsCode:stabilization
57 of 58 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport #15018