# 1.5.2 Configure bootloader
- id: 6030
title: "Ensure permissions on bootloader config are configured."
description: "The grub configuration file contains information on boot settings and passwords for unlocking boot options. The grub configuration is usually located at /boot/grub2/grub.cfg and linked as /etc/grub2.cfg . On newer grub2 systems the encrypted bootloader password is contained in /boot/grub2/user.cfg"
rationale: "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."
remediation: "Run the following commands to set permissions on your grub configuration: # chown root:root /boot/grub2/grub.cfg # chmod og-rwx /boot/grub2/grub.cfg # chown root:root /boot/grub2/user.cfg # chmod og-rwx /boot/grub2/user.cfg"
compliance:
- cis: ["1.5.2"]
- cis_csc: ["5.1"]
- pci_dss: ["2.2.4"]
- nist_800_53: ["CM.1"]
- tsc: ["CC5.2"]
- cis_level: ["1"]
condition: all
rules:
- 'c:stat /boot/grub2/grub.cfg -> r:Access:\s*\(0\d00/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)'
- 'c:stat /boot/grub2/user.cfg -> r:Access:\s*\(0\d00/-\w\w\w------\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)|cannot stat'