SELinux Permissive vs Enforcing Mode Explained

Security-Enhanced Linux (SELinux) is a mandatory access control (MAC) architecture integrated into the Linux kernel to limit access rights for users, applications, and system resources. Managing SELinux effectively requires understanding its operational modes, specifically enforcing and permissive. This article provides a direct comparison between SELinux permissive and enforcing modes, explaining how each functions, their security implications, and when to use them during system administration.

Enforcing Mode

Enforcing mode is the default and standard operational state for SELinux in production environments. In this mode:

Permissive Mode

Permissive mode acts as a diagnostic and development state. In this mode:

Key Differences Summary

Feature Enforcing Mode Permissive Mode
Policy Action Blocks unauthorized actions Allows unauthorized actions
Audit Logging Logs all policy violations Logs all policy violations
System Security Mandatory Access Control active Protection disabled (DAC only)
Ideal Environment Production systems Testing, staging, and debugging

Managing SELinux Modes

To determine the current operational mode on a system, run:

getenforce

To switch temporarily between modes without rebooting:

To set the mode permanently, edit the configuration file at /etc/selinux/config and change the SELINUX directive to either SELINUX=enforcing or SELINUX=permissive. Persisting changes via the configuration file ensures the desired security state remains active across system reboots.