Bug 2228016

Summary: grubby sets --unrestricted for all BLS entries, rendering password protection ineffective
Product: [Fedora] Fedora Reporter: James <jarmofin>
Component: grubbyAssignee: Peter Jones <pjones>
Status: NEW --- QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 38CC: fmartine, nfrayer, pjones, rharwood
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: ---
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description James 2023-08-01 07:02:38 UTC
Description of problem:
According to grub 2.06 documentation, "Superusers are permitted to use the GRUB command line, edit menu entries, and execute any menu entry." Currently bash script grubby sets "grub_arg --unrestricted" for all BLS entries in /boot/loader/entries. This allows any menu entry to be executed without requiring a password, even if a group of superusers would have been defined.

Version-Release number of selected component (if applicable):
grubby 8.40-69

How reproducible:
always

Steps to Reproduce:

The problem itself can be reproduced by verifying that entries in /boot/loader/entries have "grub_arg --unrestricted:
1. grep --files-with-matches "grub_arg --unrestricted" /boot/loader/entries/*.conf

The effect of "--unrestricted" in password protection can be reproduced as follows:
1. password-protect grub; this can be a bit tricky, as grub2-set-password also has a bug affecting UEFI systems: see https://bugzilla.redhat.com/show_bug.cgi?id=2227718
2. reboot
3. in grub menu, boot any non-default entry without being prompted for password

Actual results:
after enabling password protection (authentication), any non-default grub entry can be executed without password

Expected results:
after enabling password protection (authentication), execution of non-default grub entries should be password protected


Additional info: