Course contentsShow
← Security
Lesson 1454 of 3,05229. Operating System Security - HardeningFree lesson

SELinux Modes and Policy Types

Learn about enforcing, permissive, and disabled modes plus targeted, strict, and MLS policies.

SELinux Modes and Policy Types

You'll learn how SELinux operates in different modes and how policy types define the scope and strictness of mandatory access controls.

Understanding SELinux Modes

SELinux operates in three distinct modes that determine how it enforces security policy:

Enforcing mode is the production state where SELinux actively blocks unauthorized actions. Think of it as a security guard who stops anyone without proper credentials—violations are denied and logged.

Permissive mode acts as a "learning" or testing mode. SELinux logs all policy violations but doesn't actually block them. It's like having a security guard who writes down infractions but lets everyone through—useful for troubleshooting or rolling out new policies without breaking applications.

Disabled mode completely turns off SELinux. The security framework doesn't evaluate policies or log violations. This is generally discouraged in production environments.

You can check the current mode with getenforce and switch between enforcing and permissive with setenforce 1 (enforcing) or setenforce 0 (permissive).

Policy Types: Defining Control Scope

SELinux policies determine what gets controlled and how strictly:

Targeted policy is the most common default. It focuses mandatory access controls on specific high-risk services (like web servers, databases) while leaving most user processes in unconfined domains. This balances security with usability.

Strict policy applies MAC to all processes system-wide—nothing runs unconfined. Maximum security, but requires careful configuration and can be operationally challenging.

MLS (Multi-Level Security) policy implements the formal security models you learned earlier (Bell-LaPadula), enforcing classification levels (TOP SECRET, SECRET, etc.) and compartments. Used in high-security government and military environments where data sensitivity levels must be strictly enforced.

Key Takeaway: SELinux modes control whether policies are enforced (enforcing/permissive/disabled), while policy types define how extensively and strictly MAC is applied across your system.