1.3.1.4 Ensure the SELinux mode is not disabled

Information

SELinux can run in one of three modes: disabled, permissive, or enforcing:

- Enforcing - Is the default, and recommended, mode of operation; in enforcing mode SELinux operates normally, enforcing the loaded security policy on the entire system.
- Permissive - The system acts as if SELinux is enforcing the loaded security policy, including labeling objects and emitting access denial entries in the logs, but it does not actually deny any operations. While not recommended for production systems, permissive mode can be helpful for SELinux policy development.
- Disabled - disables most of the SELinux kernel and application code, leaving the system running without any SELinux protection.

Note: You can set individual domains to permissive mode while the system runs in enforcing mode. For example, to make the httpd_t domain permissive:

# semanage permissive -a httpd_t

Running SELinux in disabled mode is strongly discouraged; not only does the system avoid enforcing the SELinux policy, it also avoids labeling any persistent objects such as files, making it difficult to enable SELinux in the future.

Solution

- Edit /etc/selinux/config and update the SELINUX parameter to either SELINUX=enforcing or SELINUX=permissive :

Example:

SELINUX=enforcing <xhtml:ol start="2"> - Update the SELinux running state to either enforcing or permissive :

If SELinux is currently disabled:

Run the following command to create /.autorelabel :

# touch /.autorelabel

Run the following command to reboot the system:

# reboot

WARNING: The autorelabel may be a long running process and require significant downtime. This should be planed for before executing the reboot!

If SELinux is not currently disabled:

Run one of the following commands to set SELinux's running mode:

- Run the following command to set SELinux running mode to Enforcing :

# setenforce 1

- OR -

- Run the following command to set SELinux running mode to Permissive :

# setenforce 0

See Also

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

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: d90d7a03a172557f10224777905eea56339ca803d6ec411526697bf7c05e1e0c