-
Notifications
You must be signed in to change notification settings - Fork 680
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
bugfix: dir_perms_world_writable_root_owned: do not modify files under /proc #10563
bugfix: dir_perms_world_writable_root_owned: do not modify files under /proc #10563
Conversation
Hi @maage. 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/test-infra 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_dir_perms_world_writable_root_owned' differs.
--- xccdf_org.ssgproject.content_rule_dir_perms_world_writable_root_owned
+++ xccdf_org.ssgproject.content_rule_dir_perms_world_writable_root_owned
@@ -1,2 +1,4 @@
-find / -not -fstype afs -not -fstype ceph -not -fstype cifs -not -fstype smb3 -not -fstype smbfs -not -fstype sshfs -not -fstype ncpfs -not -fstype ncp -not -fstype nfs -not -fstype nfs4 -not -fstype gfs -not -fstype gfs2 -not -fstype glusterfs -not -fstype gpfs -not -fstype pvfs2 -not -fstype ocfs2 -not -fstype lustre -not -fstype davfs -not -fstype fuse.sshfs -type d -perm -0002 -uid +0 -exec chown root {} \;
+# At least under containerized env /proc can have files w/o possilibity to
+# modify even as root. And touching /proc is not good idea anyways.
+find / -path /proc -prune -o -not -fstype afs -not -fstype ceph -not -fstype cifs -not -fstype smb3 -not -fstype smbfs -not -fstype sshfs -not -fstype ncpfs -not -fstype ncp -not -fstype nfs -not -fstype nfs4 -not -fstype gfs -not -fstype gfs2 -not -fstype glusterfs -not -fstype gpfs -not -fstype pvfs2 -not -fstype ocfs2 -not -fstype lustre -not -fstype davfs -not -fstype fuse.sshfs -type d -perm -0002 -uid +0 -exec chown root {} \;
ansible remediation for rule 'xccdf_org.ssgproject.content_rule_dir_perms_world_writable_root_owned' differs.
--- xccdf_org.ssgproject.content_rule_dir_perms_world_writable_root_owned
+++ xccdf_org.ssgproject.content_rule_dir_perms_world_writable_root_owned
@@ -32,7 +32,8 @@
- name: Create empty list of excluded paths
set_fact:
- excluded_paths: []
+ excluded_paths:
+ - /proc
tags:
- CCE-83375-6
- DISA-STIG-RHEL-08-010700 |
This fail is because containers do not have capability to load kernel modules, here knfsd and start nfs-server. Unrelated issue, see #10387
|
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.
Could you also update the Ansible remediation to be aligned to the Bash, please?
…r /proc At least under containerized env (podman) /proc can have files that are not modifiable even with root. This makes test or bash remediate fail.
Updated, but ansible remediation needs to be checked. My ansible remediation test in now broken due to unrelated changes. Maybe I'm understanding something wrong, but in my view Edit: added missing not |
Code Climate has analyzed commit d7e90dc 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 52.4% (0.0% change). View more on Code Climate. |
@maage I'm looking into Ansible remediation. There is also issue with it on master. |
The issue is that |
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.
There are some issues with the Ansible remediation but they are not related to the changes in this PR. In fact, the changes in this PR helped us to find the issues. The Ansible remediation needs to be refactored and I will propose a PR for this right after merging this.
Description:
At least under containerized env (podman) /proc can have files that are not modifiable even with root. This makes test or bash remediate fail.
Rationale:
This issue would be kernel regression and should be handled in another way.
Review Hints:
Probably should see how bash remediation survives.