SELinux (Security-Enhanced Linux) is a Mandatory Access Control (MAC) implementation developed by the NSA and released as open source in 2000, merged into the mainline Linux kernel in 2.6 via the LSM framework in 2003. Its defining characteristic is default deny: unlike the standard Linux Discretionary Access Control model (file permission bits), where anything not explicitly forbidden is permitted, SELinux refuses all access that is not explicitly allowed by policy. Every process and every object — every file, socket, pipe, device node, and IPC object — carries a security context (also called a label) of the form user:role:type:level. The policy is a compiled set of rules, loaded at boot, that defines precisely which combinations of process context and object context may interact and how. An Apache web server process running in the httpd_t domain can read files labelled httpd_sys_content_t but is denied access to files labelled user_home_t or shadow_t, regardless of what Unix file permission bits say. If the web server is compromised, the attacker is confined to what httpd_t permits — typically a narrow, well-defined set of files and network operations — rather than having the full access of the user account running Apache.
The dominant SELinux policy component is Type Enforcement (TE), where the type field in the security context is the primary axis of access control. Each process type (called a domain) has a defined set of access rules for each object type — what it can read, write, execute, connect to, or signal. On top of TE, SELinux supports Role-Based Access Control (RBAC), where a user’s role constrains which domains they can transition into (preventing a developer account from transitioning into an administrator domain), and Multi-Level Security (MLS) and Multi-Category Security (MCS), which implement Bell-LaPadula confidentiality classifications (secret processes cannot read top-secret data) and are used in government deployments and container isolation (MCS categories separate containers from each other using unique s0:c1,c2-style labels). In practice, most RHEL/Fedora deployments use the targeted policy: a pragmatic subset that applies type enforcement to high-risk daemons (network-facing services, CUPS, DBus, the container runtime) while leaving most user processes in the unconfined_t domain, which has essentially no MAC restrictions. Three operating modes are supported: Enforcing (violations are blocked and logged as AVC denials), Permissive (violations are logged but not blocked, used during policy development and debugging), and Disabled (no SELinux policy loaded at all, requiring a filesystem relabel to re-enable). Switching from Disabled to Permissive requires booting with autorelabel, since files created while SELinux was off carry no context and must be labelled according to the policy’s file context database before MAC can be correctly applied.
SELinux is the default MAC system on RHEL, CentOS Stream, Fedora, and their derivatives, and is mandatory for OpenShift nodes — SCCs on OpenShift build directly on SELinux contexts, with the SCC admission plugin setting MCS labels on pod processes to ensure containers cannot access each other’s files even if they run as the same UID. Container runtimes (containerd, CRI-O, Podman) automatically assign unique MCS category pairs to each container, and the OCI runtime spec’s linux.selinuxOptions field allows administrators to override the label for specific containers. The most common operational pain point with SELinux is mislabelled files: any file created by a process outside the context SELinux expects (a configuration file dropped by a custom install script, a bind mount from an unexpected path) may carry the wrong type and trigger AVC denials that appear as mysterious permission failures with correct Unix permissions. The tooling chain for diagnosis is ausearch -m AVC, audit2why, and audit2allow; the correct long-term fix is a file context rule (semanage fcontext), not disabling enforcement. SELinux is one of the few Linux security controls that is simultaneously mandatory in high-assurance government deployments (Common Criteria EAL4+ certified in targeted policy form) and widely deployed in commodity cloud infrastructure.
