-
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
Mark /boot rules as not applicable in bootable containers #12813
Mark /boot rules as not applicable in bootable containers #12813
Conversation
We will mark rules that checks files in the `/boot/grub2/` directory as not applicable in the bootable containers. The reason is that these files don't exist during the container image build. They are generated from configuration during deployment of the image by the bootc toolset.
This datastream diff is auto generated by the check Click here to see the full diffbash remediation for rule 'xccdf_org.ssgproject.content_rule_file_groupowner_grub2_cfg' differs.
--- xccdf_org.ssgproject.content_rule_file_groupowner_grub2_cfg
+++ xccdf_org.ssgproject.content_rule_file_groupowner_grub2_cfg
@@ -1,5 +1,5 @@
# Remediation is applicable only in certain platforms
-if ( rpm --quiet -q grub2-common && rpm --quiet -q kernel ) && [ ! -d /sys/firmware/efi ]; then
+if ( rpm --quiet -q grub2-common && rpm --quiet -q kernel ) && [ ! -d /sys/firmware/efi ] && { ! ( { rpm --quiet -q kernel ;} && { rpm --quiet -q rpm-ostree ;} && { rpm --quiet -q bootc ;} ); }; then
chgrp 0 /boot/grub2/grub.cfg
ansible remediation for rule 'xccdf_org.ssgproject.content_rule_file_groupowner_grub2_cfg' differs.
--- xccdf_org.ssgproject.content_rule_file_groupowner_grub2_cfg
+++ xccdf_org.ssgproject.content_rule_file_groupowner_grub2_cfg
@@ -25,6 +25,8 @@
- '"/boot/efi" not in ansible_mounts | map(attribute="mount") | list'
- ( "grub2-common" in ansible_facts.packages and "kernel" in ansible_facts.packages
)
+ - not ( "kernel" in ansible_facts.packages and "rpm-ostree" in ansible_facts.packages
+ and "bootc" in ansible_facts.packages )
tags:
- CCE-80800-6
- CJIS-5.5.2.2
@@ -49,6 +51,8 @@
- '"/boot/efi" not in ansible_mounts | map(attribute="mount") | list'
- ( "grub2-common" in ansible_facts.packages and "kernel" in ansible_facts.packages
)
+ - not ( "kernel" in ansible_facts.packages and "rpm-ostree" in ansible_facts.packages
+ and "bootc" in ansible_facts.packages )
- file_exists.stat is defined and file_exists.stat.exists
tags:
- CCE-80800-6
Platform has been changed for rule 'xccdf_org.ssgproject.content_rule_file_groupowner_grub2_cfg'
--- xccdf_org.ssgproject.content_rule_file_groupowner_grub2_cfg
+++ xccdf_org.ssgproject.content_rule_file_groupowner_grub2_cfg
@@ -1 +1 @@
-
+oval:ssg-bootc:def:1
bash remediation for rule 'xccdf_org.ssgproject.content_rule_file_groupowner_user_cfg' differs.
--- xccdf_org.ssgproject.content_rule_file_groupowner_user_cfg
+++ xccdf_org.ssgproject.content_rule_file_groupowner_user_cfg
@@ -1,5 +1,5 @@
# Remediation is applicable only in certain platforms
-if ( rpm --quiet -q grub2-common && rpm --quiet -q kernel ) && [ ! -d /sys/firmware/efi ]; then
+if ( rpm --quiet -q grub2-common && rpm --quiet -q kernel ) && [ ! -d /sys/firmware/efi ] && { ! ( { rpm --quiet -q kernel ;} && { rpm --quiet -q rpm-ostree ;} && { rpm --quiet -q bootc ;} ); }; then
chgrp 0 /boot/grub2/user.cfg
ansible remediation for rule 'xccdf_org.ssgproject.content_rule_file_groupowner_user_cfg' differs.
--- xccdf_org.ssgproject.content_rule_file_groupowner_user_cfg
+++ xccdf_org.ssgproject.content_rule_file_groupowner_user_cfg
@@ -25,6 +25,8 @@
- '"/boot/efi" not in ansible_mounts | map(attribute="mount") | list'
- ( "grub2-common" in ansible_facts.packages and "kernel" in ansible_facts.packages
)
+ - not ( "kernel" in ansible_facts.packages and "rpm-ostree" in ansible_facts.packages
+ and "bootc" in ansible_facts.packages )
tags:
- CCE-86009-8
- CJIS-5.5.2.2
@@ -49,6 +51,8 @@
- '"/boot/efi" not in ansible_mounts | map(attribute="mount") | list'
- ( "grub2-common" in ansible_facts.packages and "kernel" in ansible_facts.packages
)
+ - not ( "kernel" in ansible_facts.packages and "rpm-ostree" in ansible_facts.packages
+ and "bootc" in ansible_facts.packages )
- file_exists.stat is defined and file_exists.stat.exists
tags:
- CCE-86009-8
Platform has been changed for rule 'xccdf_org.ssgproject.content_rule_file_groupowner_user_cfg'
--- xccdf_org.ssgproject.content_rule_file_groupowner_user_cfg
+++ xccdf_org.ssgproject.content_rule_file_groupowner_user_cfg
@@ -1 +1 @@
-
+oval:ssg-bootc:def:1
bash remediation for rule 'xccdf_org.ssgproject.content_rule_file_owner_grub2_cfg' differs.
--- xccdf_org.ssgproject.content_rule_file_owner_grub2_cfg
+++ xccdf_org.ssgproject.content_rule_file_owner_grub2_cfg
@@ -1,5 +1,5 @@
# Remediation is applicable only in certain platforms
-if ( rpm --quiet -q grub2-common && rpm --quiet -q kernel ) && [ ! -d /sys/firmware/efi ]; then
+if ( rpm --quiet -q grub2-common && rpm --quiet -q kernel ) && [ ! -d /sys/firmware/efi ] && { ! ( { rpm --quiet -q kernel ;} && { rpm --quiet -q rpm-ostree ;} && { rpm --quiet -q bootc ;} ); }; then
chown 0 /boot/grub2/grub.cfg
ansible remediation for rule 'xccdf_org.ssgproject.content_rule_file_owner_grub2_cfg' differs.
--- xccdf_org.ssgproject.content_rule_file_owner_grub2_cfg
+++ xccdf_org.ssgproject.content_rule_file_owner_grub2_cfg
@@ -25,6 +25,8 @@
- '"/boot/efi" not in ansible_mounts | map(attribute="mount") | list'
- ( "grub2-common" in ansible_facts.packages and "kernel" in ansible_facts.packages
)
+ - not ( "kernel" in ansible_facts.packages and "rpm-ostree" in ansible_facts.packages
+ and "bootc" in ansible_facts.packages )
tags:
- CCE-80805-5
- CJIS-5.5.2.2
@@ -49,6 +51,8 @@
- '"/boot/efi" not in ansible_mounts | map(attribute="mount") | list'
- ( "grub2-common" in ansible_facts.packages and "kernel" in ansible_facts.packages
)
+ - not ( "kernel" in ansible_facts.packages and "rpm-ostree" in ansible_facts.packages
+ and "bootc" in ansible_facts.packages )
- file_exists.stat is defined and file_exists.stat.exists
tags:
- CCE-80805-5
Platform has been changed for rule 'xccdf_org.ssgproject.content_rule_file_owner_grub2_cfg'
--- xccdf_org.ssgproject.content_rule_file_owner_grub2_cfg
+++ xccdf_org.ssgproject.content_rule_file_owner_grub2_cfg
@@ -1 +1 @@
-
+oval:ssg-bootc:def:1
bash remediation for rule 'xccdf_org.ssgproject.content_rule_file_owner_user_cfg' differs.
--- xccdf_org.ssgproject.content_rule_file_owner_user_cfg
+++ xccdf_org.ssgproject.content_rule_file_owner_user_cfg
@@ -1,5 +1,5 @@
# Remediation is applicable only in certain platforms
-if ( rpm --quiet -q grub2-common && rpm --quiet -q kernel ) && [ ! -d /sys/firmware/efi ]; then
+if ( rpm --quiet -q grub2-common && rpm --quiet -q kernel ) && [ ! -d /sys/firmware/efi ] && { ! ( { rpm --quiet -q kernel ;} && { rpm --quiet -q rpm-ostree ;} && { rpm --quiet -q bootc ;} ); }; then
chown 0 /boot/grub2/user.cfg
ansible remediation for rule 'xccdf_org.ssgproject.content_rule_file_owner_user_cfg' differs.
--- xccdf_org.ssgproject.content_rule_file_owner_user_cfg
+++ xccdf_org.ssgproject.content_rule_file_owner_user_cfg
@@ -25,6 +25,8 @@
- '"/boot/efi" not in ansible_mounts | map(attribute="mount") | list'
- ( "grub2-common" in ansible_facts.packages and "kernel" in ansible_facts.packages
)
+ - not ( "kernel" in ansible_facts.packages and "rpm-ostree" in ansible_facts.packages
+ and "bootc" in ansible_facts.packages )
tags:
- CCE-86015-5
- CJIS-5.5.2.2
@@ -49,6 +51,8 @@
- '"/boot/efi" not in ansible_mounts | map(attribute="mount") | list'
- ( "grub2-common" in ansible_facts.packages and "kernel" in ansible_facts.packages
)
+ - not ( "kernel" in ansible_facts.packages and "rpm-ostree" in ansible_facts.packages
+ and "bootc" in ansible_facts.packages )
- file_exists.stat is defined and file_exists.stat.exists
tags:
- CCE-86015-5
Platform has been changed for rule 'xccdf_org.ssgproject.content_rule_file_owner_user_cfg'
--- xccdf_org.ssgproject.content_rule_file_owner_user_cfg
+++ xccdf_org.ssgproject.content_rule_file_owner_user_cfg
@@ -1 +1 @@
-
+oval:ssg-bootc:def:1
bash remediation for rule 'xccdf_org.ssgproject.content_rule_file_permissions_grub2_cfg' differs.
--- xccdf_org.ssgproject.content_rule_file_permissions_grub2_cfg
+++ xccdf_org.ssgproject.content_rule_file_permissions_grub2_cfg
@@ -1,5 +1,5 @@
# Remediation is applicable only in certain platforms
-if ( rpm --quiet -q grub2-common && rpm --quiet -q kernel ) && [ ! -d /sys/firmware/efi ]; then
+if ( rpm --quiet -q grub2-common && rpm --quiet -q kernel ) && [ ! -d /sys/firmware/efi ] && { ! ( { rpm --quiet -q kernel ;} && { rpm --quiet -q rpm-ostree ;} && { rpm --quiet -q bootc ;} ); }; then
chmod u-xs,g-xwrs,o-xwrt /boot/grub2/grub.cfg
ansible remediation for rule 'xccdf_org.ssgproject.content_rule_file_permissions_grub2_cfg' differs.
--- xccdf_org.ssgproject.content_rule_file_permissions_grub2_cfg
+++ xccdf_org.ssgproject.content_rule_file_permissions_grub2_cfg
@@ -23,6 +23,8 @@
- '"/boot/efi" not in ansible_mounts | map(attribute="mount") | list'
- ( "grub2-common" in ansible_facts.packages and "kernel" in ansible_facts.packages
)
+ - not ( "kernel" in ansible_facts.packages and "rpm-ostree" in ansible_facts.packages
+ and "bootc" in ansible_facts.packages )
tags:
- CCE-80814-7
- NIST-800-171-3.4.5
@@ -45,6 +47,8 @@
- '"/boot/efi" not in ansible_mounts | map(attribute="mount") | list'
- ( "grub2-common" in ansible_facts.packages and "kernel" in ansible_facts.packages
)
+ - not ( "kernel" in ansible_facts.packages and "rpm-ostree" in ansible_facts.packages
+ and "bootc" in ansible_facts.packages )
- file_exists.stat is defined and file_exists.stat.exists
tags:
- CCE-80814-7
Platform has been changed for rule 'xccdf_org.ssgproject.content_rule_file_permissions_grub2_cfg'
--- xccdf_org.ssgproject.content_rule_file_permissions_grub2_cfg
+++ xccdf_org.ssgproject.content_rule_file_permissions_grub2_cfg
@@ -1 +1 @@
-
+oval:ssg-bootc:def:1
bash remediation for rule 'xccdf_org.ssgproject.content_rule_file_permissions_user_cfg' differs.
--- xccdf_org.ssgproject.content_rule_file_permissions_user_cfg
+++ xccdf_org.ssgproject.content_rule_file_permissions_user_cfg
@@ -1,5 +1,5 @@
# Remediation is applicable only in certain platforms
-if ( rpm --quiet -q grub2-common && rpm --quiet -q kernel ) && [ ! -d /sys/firmware/efi ]; then
+if ( rpm --quiet -q grub2-common && rpm --quiet -q kernel ) && [ ! -d /sys/firmware/efi ] && { ! ( { rpm --quiet -q kernel ;} && { rpm --quiet -q rpm-ostree ;} && { rpm --quiet -q bootc ;} ); }; then
chmod u-xs,g-xwrs,o-xwrt /boot/grub2/user.cfg
ansible remediation for rule 'xccdf_org.ssgproject.content_rule_file_permissions_user_cfg' differs.
--- xccdf_org.ssgproject.content_rule_file_permissions_user_cfg
+++ xccdf_org.ssgproject.content_rule_file_permissions_user_cfg
@@ -23,6 +23,8 @@
- '"/boot/efi" not in ansible_mounts | map(attribute="mount") | list'
- ( "grub2-common" in ansible_facts.packages and "kernel" in ansible_facts.packages
)
+ - not ( "kernel" in ansible_facts.packages and "rpm-ostree" in ansible_facts.packages
+ and "bootc" in ansible_facts.packages )
tags:
- CCE-86024-7
- NIST-800-171-3.4.5
@@ -45,6 +47,8 @@
- '"/boot/efi" not in ansible_mounts | map(attribute="mount") | list'
- ( "grub2-common" in ansible_facts.packages and "kernel" in ansible_facts.packages
)
+ - not ( "kernel" in ansible_facts.packages and "rpm-ostree" in ansible_facts.packages
+ and "bootc" in ansible_facts.packages )
- file_exists.stat is defined and file_exists.stat.exists
tags:
- CCE-86024-7
Platform has been changed for rule 'xccdf_org.ssgproject.content_rule_file_permissions_user_cfg'
--- xccdf_org.ssgproject.content_rule_file_permissions_user_cfg
+++ xccdf_org.ssgproject.content_rule_file_permissions_user_cfg
@@ -1 +1 @@
-
+oval:ssg-bootc:def:1 |
Code Climate has analyzed commit 0e91e73 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.8% (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.
Thanks!
We will mark rules that checks files in the
/boot/grub2/
directory as not applicable in the bootable containers. The reason is that these files don't exist during the container image build. They are generated from configuration during deployment of the image by the bootc toolset.