Verify the UEFI Boot Loader grub.cfg Permissions
An XCCDF Rule
Description
File permissions for /boot/efi/EFI/redhat/grub.cfg
should be set to 700.
To properly set the permissions of /boot/efi/EFI/redhat/grub.cfg
, run the command:
$ sudo chmod 700 /boot/efi/EFI/redhat/grub.cfg
Rationale
Proper permissions ensure that only the root user can modify important boot parameters.
- ID
- xccdf_org.ssgproject.content_rule_file_permissions_efi_grub2_cfg
- Severity
- Medium
- References
- Updated
Remediation - Ansible
- name: Gather the package facts
package_facts:
manager: auto
tags:
- CCE-83431-7
- NIST-800-171-3.4.5
Remediation - Shell Script
# Remediation is applicable only in certain platforms
if [ -d /sys/firmware/efi ] && rpm --quiet -q grub2-common && { [ ! -f /.dockerenv ] && [ ! -f /run/.containerenv ]; }; then
chmod u-s,g-xwrs,o-xwrt /boot/efi/EFI/redhat/grub.cfg
else