1.5.1.2 Ensure SELinux is not disabled in bootloader configuration

Information

Configure SELINUX to be enabled at boot time and verify that it has not been overwritten by the grub boot parameters.

SELinux must be enabled at boot time in your grub configuration to ensure that the controls it provides are not overridden.

Solution

Run the following command to remove the selinux=0 and enforcing=0 parameters:

grubby --update-kernel ALL --remove-args "selinux=0 enforcing=0"

Edit /etc/default/grub and remove selinux=0 and enforcing=0 from all lines beginning with GRUB_CMDLINE_LINUX= or GRUB_CMDLINE_LINUX_DEFAULT= :

Example:

# sed -ri 's/s*(selinux|enforcing)=0s*//g' /etc/default/grub

Impact:

Files created while SELinux is disabled are not labeled at all. This behavior causes problems when changing to enforcing mode because files are labeled incorrectly or are not labeled at all. To prevent incorrectly labeled and unlabeled files from causing problems, file systems are automatically relabeled when changing from the disabled state to permissive or enforcing mode. This can be a long running process that should be accounted for as it may extend downtime during initial re-boot.

See Also

https://workbench.cisecurity.org/benchmarks/15962

Item Details

Category: ACCESS CONTROL, MEDIA PROTECTION

References: 800-53|AC-3, 800-53|AC-5, 800-53|AC-6, 800-53|MP-2, CSCv7|14.6

Plugin: Unix

Control ID: 19406c97bc0685c94e1547c099b7d0f31111f113f3acd5bca1d5f808d6ba820d