-
Notifications
You must be signed in to change notification settings - Fork 706
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
Use nss-altfiles in file_groupowner_etc_chrony_keys #12789
base: master
Are you sure you want to change the base?
Use nss-altfiles in file_groupowner_etc_chrony_keys #12789
Conversation
The bootable containers and Image Mode Operating systems use `/usr/lib/group` provided by the `nss-altfiles` RPM package as an alternative place to define user groups in the system. The rule `file_groupowner_etc_chrony_keys` didn't read the `/usr/lib/group`. As a result the rule failed in the after-deployment scan with the ANSSI BP28 High profile. This commit extends the check to read `/usr/lib/group`, which makes the rule pass in Image Mode. This change has been inspired by the code in rule `file_permissions_ungroupowned` which already has been modified for Image Mode. The code that is same in OVALs in both rules has been extracted to a Jinja 2 macro to prevent code duplication and enable further reuse in future.
This datastream diff is auto generated by the check Click here to see the full diffOVAL for rule 'xccdf_org.ssgproject.content_rule_file_groupowner_etc_chrony_keys' differs.
--- oval:ssg-file_groupowner_etc_chrony_keys:def:1
+++ oval:ssg-file_groupowner_etc_chrony_keys:def:1
@@ -1,2 +1,7 @@
+criteria OR
criteria AND
-criterion oval:ssg-test_file_groupowner_etc_chrony_keys_0:tst:1
+criterion oval:ssg-test_file_groupowner_etc_chrony_keys_nsswitch_uses_altfiles:tst:1
+criterion oval:ssg-test_file_groupowner_etc_chrony_keys:tst:1
+criteria AND
+criterion oval:ssg-test_file_groupowner_etc_chrony_keys_nsswitch_uses_altfiles:tst:1
+criterion oval:ssg-test_file_groupowner_etc_chrony_keys_with_usrlib:tst:1 |
I don't know what is the problem because I pass all locally. Any help?
|
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.
Thanks for the PR.
Just one minor change.
<def-group> | ||
|
||
<definition class="compliance" id="{{{ rule_id }}}" version="1"> | ||
{{{ oval_metadata("All files should be owned by a group") }}} |
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.
{{{ oval_metadata("All files should be owned by a group") }}} | |
{{{ oval_metadata("All files should be owned by a group") }}} |
While this is true, I don't think this is the best description for the rule.
Code Climate has analyzed commit af3c6e7 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.6% (0.0% change). View more on Code Climate. |
I have changed the comments. |
The bootable containers and Image Mode Operating systems use
/usr/lib/group
provided by thenss-altfiles
RPM package as an alternative place to define user groups in the system.The rule
file_groupowner_etc_chrony_keys
didn't read the/usr/lib/group
. As a result the rule failed in the after-deployment scan with the ANSSI BP28 High profile. This commit extends the check to read/usr/lib/group
, which makes the rule pass in Image Mode.This change has been inspired by the code in rule
file_permissions_ungroupowned
which already has been modified for Image Mode. The code that is same in OVALs in both rules has been extracted to a Jinja 2 macro to prevent code duplication and enable further reuse in future.