1.4.2 Ensure permissions on bootloader config are configured

Information

The grub files contain information on boot settings and passwords for unlocking boot options.

Setting the permissions to read and write for root only prevents non-root users from seeing the boot parameters or changing them. Non-root users who read the boot parameters may be able to identify weaknesses in security upon boot and be able to exploit them.

Solution

Run the following commands to set ownership and permissions on your grub configuration files:

Run the following command to set ownership and permissions on grub.cfg :

# chown root:root /boot/grub2/grub.cfg
# chmod og-rwx /boot/grub2/grub.cfg

Run the following command to set ownership and permissions on grubenv :

# chown root:root /boot/grub2/grubenv
# chmod u-x,og-rwx /boot/grub2/grubenv

Run the following command to set ownership and permissions on user.cfg :

# chown root:root /boot/grub2/user.cfg
# chmod u-x,og-rwx /boot/grub2/user.cfg

Note: This may require a re-boot to enable the change

See Also

https://workbench.cisecurity.org/files/4239