-
Notifications
You must be signed in to change notification settings - Fork 734
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
Fix accounts_user_dot_user/group_ownership to only remediate regular files #13178
Conversation
Hi @mpurg. Thanks for your PR. I'm waiting for a ComplianceAsCode member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
This datastream diff is auto generated by the check Click here to see the full diffbash remediation for rule 'xccdf_org.ssgproject.content_rule_accounts_user_dot_group_ownership' differs.
--- xccdf_org.ssgproject.content_rule_accounts_user_dot_group_ownership
+++ xccdf_org.ssgproject.content_rule_accounts_user_dot_group_ownership
@@ -1,2 +1,2 @@
-awk -F: '{if ($4 >= 1000 && $4 != 65534) print $4":"$6}' /etc/passwd | while IFS=: read -r gid home; do find "$home" -maxdepth 1 -name "\.[^.]*" -exec chgrp -f $gid "{}" \;; done
+awk -F: '{if ($4 >= 1000 && $4 != 65534) print $4":"$6}' /etc/passwd | while IFS=: read -r gid home; do find -P "$home" -maxdepth 1 -type f -name "\.[^.]*" -exec chgrp -f --no-dereference -- $gid "{}" \;; done
ansible remediation for rule 'xccdf_org.ssgproject.content_rule_accounts_user_dot_group_ownership' differs.
--- xccdf_org.ssgproject.content_rule_accounts_user_dot_group_ownership
+++ xccdf_org.ssgproject.content_rule_accounts_user_dot_group_ownership
@@ -2,8 +2,8 @@
files
ansible.builtin.shell:
cmd: 'awk -F: ''{if ($4 >= 1000 && $4 != 65534) print $4":"$6}'' /etc/passwd |
- while IFS=: read -r gid home; do find "$home" -maxdepth 1 -name "\.[^.]*" -exec
- chgrp -f $gid "{}" \;; done'
+ while IFS=: read -r gid home; do find -P "$home" -maxdepth 1 -type f -name "\.[^.]*"
+ -exec chgrp -f --no-dereference -- $gid "{}" \;; done'
tags:
- CCE-86314-2
- accounts_user_dot_group_ownership
bash remediation for rule 'xccdf_org.ssgproject.content_rule_accounts_user_dot_user_ownership' differs.
--- xccdf_org.ssgproject.content_rule_accounts_user_dot_user_ownership
+++ xccdf_org.ssgproject.content_rule_accounts_user_dot_user_ownership
@@ -1,2 +1,2 @@
-awk -F: '{if ($3 >= 1000 && $3 != 65534) print $3":"$6}' /etc/passwd | while IFS=: read -r uid home; do find "$home" -maxdepth 1 -name "\.[^.]*" -exec chown -f $uid "{}" \;; done
+awk -F: '{if ($3 >= 1000 && $3 != 65534) print $3":"$6}' /etc/passwd | while IFS=: read -r uid home; do find -P "$home" -maxdepth 1 -type f -name "\.[^.]*" -exec chown -f --no-dereference -- $uid "{}" \;; done
ansible remediation for rule 'xccdf_org.ssgproject.content_rule_accounts_user_dot_user_ownership' differs.
--- xccdf_org.ssgproject.content_rule_accounts_user_dot_user_ownership
+++ xccdf_org.ssgproject.content_rule_accounts_user_dot_user_ownership
@@ -2,8 +2,8 @@
files
ansible.builtin.shell:
cmd: 'awk -F: ''{if ($3 >= 1000 && $3 != 65534) print $3":"$6}'' /etc/passwd |
- while IFS=: read -r uid home; do find "$home" -maxdepth 1 -name "\.[^.]*" -exec
- chown -f $uid "{}" \;; done'
+ while IFS=: read -r uid home; do find -P "$home" -maxdepth 1 -type f -name "\.[^.]*"
+ -exec chown -f --no-dereference -- $uid "{}" \;; done'
tags:
- CCE-86316-7
- accounts_user_dot_user_ownership |
Change in Ansible Please consider using more suitable Ansible module than |
145bed5
to
ec7d08c
Compare
Change in Ansible Please consider using more suitable Ansible module than |
Code Climate has analyzed commit ec7d08c 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 61.9% (0.0% change). View more on Code Climate. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, thanks!
@ComplianceAsCode/red-hatters |
Description:
accounts_user_dot_user_ownership
andaccounts_user_dot_group_ownership
to only remediate regular filesRationale: