Support RHEL 8 cloud images in GRUB 2 rules#14535
Open
jan-cerny wants to merge 3 commits intoComplianceAsCode:masterfrom
Open
Support RHEL 8 cloud images in GRUB 2 rules#14535jan-cerny wants to merge 3 commits intoComplianceAsCode:masterfrom
jan-cerny wants to merge 3 commits intoComplianceAsCode:masterfrom
Conversation
|
This datastream diff is auto generated by the check Click here to see the full diffOVAL for rule 'xccdf_org.ssgproject.content_rule_grub2_uefi_admin_username' differs.
--- oval:ssg-grub2_uefi_admin_username:def:1
+++ oval:ssg-grub2_uefi_admin_username:def:1
@@ -1,2 +1,5 @@
criteria OR
criterion oval:ssg-test_bootloader_uefi_superuser_differ_from_other_users:tst:1
+criteria AND
+criterion oval:ssg-test_grub2_uefi_admin_username_stub:tst:1
+criterion oval:ssg-test_bootloader_uefi_boot_superuser_differ_from_other_users:tst:1
OVAL for rule 'xccdf_org.ssgproject.content_rule_grub2_uefi_password' differs.
--- oval:ssg-grub2_uefi_password:def:1
+++ oval:ssg-grub2_uefi_password:def:1
@@ -1,2 +1,5 @@
criteria OR
criterion oval:ssg-test_grub2_uefi_password_usercfg:tst:1
+criteria AND
+criterion oval:ssg-test_grub2_uefi_password_stub:tst:1
+criterion oval:ssg-test_grub2_uefi_password_boot_usercfg:tst:1 |
On RHEL 8, the GRUB configuration for UEFI is normally located at `/boot/efi/EFI/redhat`. However, in RHEL 8 cloud images (eg. AWS) the `/boot/efi/EFI/redhat/` contains a stub pointing to `/boot/grub2/` and the actual configuration is located at the `/boot/grub2/` directory. Example stub in `/boot/efi/EFI/redhat/grub.cfg`: ``` search --no-floppy --set prefix --file /boot/grub2/grub.cfg set prefix=($prefix)/boot/grub2 configfile $prefix/grub.cfg ``` In this commit, we extend the check to account for this special configuration of the cloud images. Fixes: ComplianceAsCode#13211
Remove `invalid_username.fail.sh` that configures an invalid GRUB user name. The reason is that starting from ComplianceAsCode#8438 the rule `grub2_uefi_password` no longer checks user names, it only checks passwords now, no an invalid user name can't make the rule fail.
Collaborator
Author
|
I have rebased this PR on the top of the latest upstream master branch. |
|
@jan-cerny: The following test failed, say
Full PR test history. Your PR dashboard. DetailsInstructions 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. I understand the commands that are listed here. |
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.
Description:
This PR will extend checks in rules
grub2_uefi_passwordandgrub2_uefi_admin_usernameto support RHEL 8 cloud images.It solves the different configuration location on the systems based on cloud images. On a normal RHEL 8, the GRUB configuration for UEFI is normally located at
/boot/efi/EFI/redhat. However, in RHEL 8 cloud images (eg. AWS) the/boot/efi/EFI/redhat/contains a stub pointing to/boot/grub2/and the actual configuration is located at the/boot/grub2/directory.Example stub in
/boot/efi/EFI/redhat/grub.cfg:In this PR, we extend the OVAL check to account for this special configuration of the cloud images. The rules don't have remediations therefore we update only OVALs.
The PR adds some new simple test scenarios for both rules. On the other hand, it removes the test scenario
invalid_username.fail.shof rulegrub2_uefi_password. This test tested configuring an invalid GRUB user name. The reason is that starting from #8438 the rulegrub2_uefi_passwordno longer checks user names, it only checks passwords now, so an invalid user name can't make the rule fail.Rationale:
Fixes: #13211
Review Hints:
Run automatus tests.