Fact-checked by Grok 2 weeks ago

Security-Enhanced Linux

Security-Enhanced Linux (SELinux) is a module that implements (MAC) mechanisms to enforce fine-grained policies, confining processes and limiting potential damage from vulnerabilities or malicious code. Developed by the U.S. (NSA) in collaboration with partners including NAI Labs, Secure Computing Corporation, and , SELinux was first released as an open-source prototype on December 22, 2000, under the GNU General Public License to enhance 's . It builds on the Flask microkernel , providing features like type enforcement, , and multi-level (MLS) to complement traditional (DAC). SELinux operates by assigning security contexts (labels) to subjects (processes) and objects (files, sockets, etc.), typically in the format user::type:level, which are used to evaluate requests against a predefined . The kernel's Security Server checks these requests, caching decisions in an Access Vector Cache (AVC) for efficiency, and defaults to denial unless explicitly allowed, logging violations for auditing. It supports three modes: enforcing (active application, default in distributions like ), permissive (logging denials without blocking), and disabled (no SELinux functionality). Policies can be targeted (confining select services while allowing others unrestricted ) or MLS for classified environments. Widely adopted in enterprise and government systems, SELinux was integrated into the mainline in version 2.6 in 2003 and serves as the foundation for in distributions such as , , and . In , incorporated SELinux into starting with version 4.3 in 2013, achieving full enforcement by Android 5.0 to isolate system services, protect data, and mitigate exploits across over 60 process domains. This enforcement extends even to processes, enhancing overall system integrity without replacing other layers like firewalls or permissions.

Introduction

Overview

Security-Enhanced Linux (SELinux) is a security module integrated into the that implements (MAC) by assigning security labels, known as contexts, to subjects such as processes and objects like files, directories, and sockets. These labels enable the to enforce fine-grained access policies based on the defined roles and types, ensuring that operations are permitted only if explicitly allowed by the . SELinux operates alongside the traditional (DAC) system in , where DAC relies on user and group ownership to grant permissions; SELinux supplements this by making access decisions in the after DAC checks, denying actions that violate MAC rules even if DAC would allow them. This layered approach addresses limitations in standard permissions, providing administrators with centralized control over system behavior. Originally developed by the (NSA) and integrated into the in 2003 via the (LSM) framework, SELinux allows for customizable policies to restrict what processes can access or modify. The primary benefits of SELinux include enhanced protection against exploits, rootkits, and configuration errors by confining es to the minimum privileges necessary for their functions, thereby limiting the potential damage from compromised software. For instance, even if an attacker gains control of a , SELinux policies can prevent it from accessing sensitive system files outside its designated scope. As of 2025, SELinux continues as an active open-source project maintained by the SELinux community through upstream repositories and mailing lists, with ongoing enhancements such as deny rules in userspace release 3.6, and it is integrated by default into major distributions including , , and ( since February 2025 and planned for Leap 16).

Core Principles

Security-Enhanced Linux (SELinux) is built on the principle of confinement, where processes are restricted to specific security domains that limit their interactions with system resources. This approach ensures that even if a process is compromised, its ability to access unauthorized files, devices, or other processes is curtailed, thereby containing potential damage. The Type Enforcement (TE) model in SELinux enforces this confinement by assigning types to objects and domains to subjects, allowing only when explicitly permitted by policy rules. Central to SELinux is the enforcement of least privilege, granting subjects the minimal permissions necessary to perform their functions through finely grained rules. This reduces the by denying permissions unless an explicit allow rule exists, operating on a default-deny basis. As a result, administrative errors or vulnerabilities in one component do not propagate widely, as privileges are tightly controlled and auditable. Access control decisions in SELinux are entirely policy-driven, with a centralized security server evaluating requests based on auditable rules rather than discretionary user choices. Policies define security contexts for subjects and objects, mediating all operations through (MAC) mechanisms integrated into the . This model allows administrators to customize protections without modifying kernel code, ensuring consistent enforcement across the system. SELinux supports optional extensions for multi-level security (MLS) and multi-category security (MCS) to provide hierarchical and compartmentalized protection. MLS implements the Bell-LaPadula model, enforcing confidentiality through sensitivity levels (e.g., unclassified, confidential) where subjects can read down but not up, and write up but not down, preventing unauthorized information flows. MCS builds on MLS by adding user-defined categories (e.g., for projects or departments), restricting access to objects sharing matching categories at the same sensitivity level, thus enabling finer-grained isolation without full MLS complexity.

History and Development

Origins and Key Milestones

The (NSA) initiated the development of Security-Enhanced Linux (SELinux) in the summer of 1999 as a response to increasing cybersecurity threats, aiming to integrate robust into the . This project built upon the Flask security architecture, which originated from the Flux Advanced Security Kernel (FLASK) research conducted jointly by the NSA and the University of Utah's Flux research group in the late 1990s. The Flask design emphasized separation of policy from enforcement to enable flexible, customizable security policies, drawing from earlier efforts like the TrustedBSD MAC framework but tailored for . The first prototype of SELinux was publicly released by the NSA in December 2000 under the GNU General Public License, marking the initial open-source availability of the patches and userspace tools. This release included a reference policy implementation and focused on demonstrating the feasibility of Flask-based MAC in , though it required custom kernel modifications. Subsequent refinements addressed integration challenges, leading to the project's adaptation for the emerging (LSM) framework. A major milestone occurred in August 2003, when SELinux was merged into the mainline as part of 2.6.0-test3, enabling broader without patches. This leveraged the LSM hooks to allow SELinux to coexist with other modules, solidifying its role in the ecosystem. In 2004, SELinux saw significant uptake with its inclusion in Core 2, the first major distribution to ship it by default in permissive mode, paving the way for . Red Hat 4, released in February 2005, further advanced this by enabling SELinux in enforcing mode as an optional feature, emphasizing its use for high- environments. Key enhancements continued in 2006 with 2.6.19, which introduced support for network packet labeling via the NetLabel subsystem, allowing SELinux policies to control labeled networking traffic and improving inter-domain communication security. Efforts to extend SELinux to mobile platforms began around 2008, with early experimental ports to Android-based devices like the Zaurus , demonstrating its adaptability to systems. This laid groundwork for the NSA-led Security Enhanced (SE) project, publicly announced in 2011 and released in 2012, which integrated SELinux into 's for over apps and system services. As of November 2025, SELinux maintains full compatibility with the Linux kernel 6.x series, including versions up to 6.17, ensuring seamless operation on modern hardware with enhanced virtualization and container support. The SELinux userspace tools reached version 3.9 in July 2025, incorporating policy optimizations including deny rules and further improvements that reduce access decision latency through better caching and streamlined rule evaluation, thereby improving overall system performance without compromising security. These updates reflect ongoing community-driven refinements, with contributions from Red Hat and the SELinux Project ensuring robustness against contemporary threats.

Contributors and Collaborations

The U.S. (NSA) served as the primary developer of Security-Enhanced Linux (SELinux), leading its initial design and implementation to enhance operating system security through mechanisms. The NSA released the SELinux prototype as under the GNU General Public License (GPL) in December 2000, enabling broader adoption and community involvement. Key original contributors from the NSA's SELinux team included Stephen Smalley, who led much of the architectural development and integration efforts, and Chris PeBenito, who focused on policy tools and user-space components. These efforts built upon foundational research, incorporating the security architecture, which originated from the University of Utah's project and provided flexible support for diverse policies, including type enforcement. External collaborations further shaped SELinux, with the NSA partnering with NAI Labs, Secure Computing Corporation, and the during prototyping to integrate type enforcement concepts from Flask. Red Hat contributed significantly by enhancing code, userland utilities, and policies for production distributions like and , while provided advancements in audit subsystems and labeled networking to meet high-security standards. The TrustedBSD project influenced SELinux through ports of Flask and type enforcement mechanisms, incorporating support for POSIX.1e lists (ACLs) to enable fine-grained discretionary controls alongside mandatory policies./B0230712.pdf) Ongoing development occurs within the open-source community, coordinated through the SELinux Project's repositories for tools, libraries, and reference policies, with contributions submitted via mailing lists such as selinux@vger.. This community-driven approach, transitioned from NSA oversight, fosters policy refinements and integrations, supporting SELinux's evolution in modern distributions.

Technical Architecture

Kernel Integration

Security-Enhanced Linux (SELinux) is integrated into the through the (LSM) framework, which inserts security hooks into key kernel subsystems to enforce policies without modifying the core kernel code. This integration allows SELinux to mediate access decisions for system calls, file operations, network communications, and other kernel-mediated interactions. The LSM framework was specifically developed to support SELinux, enabling its nondiscretionary access controls as an optional extension to the kernel's existing mechanisms. SELinux is activated during kernel boot by appending the selinux=1 parameter to the kernel command line, typically via the bootloader configuration. This parameter instructs the kernel to initialize the SELinux subsystem, loading the security policy and enabling enforcement hooks. Without this parameter, or if set to selinux=0, the kernel operates in permissive mode at boot, logging violations without blocking them; SELinux can be fully disabled by setting the appropriate configuration or boot options. Within the kernel, SELinux relies on core components for policy evaluation and efficient decision-making. The security server acts as the central decision engine, consulting the loaded policy to determine whether a requested access is permitted based on security contexts assigned to subjects and objects. To mitigate performance overhead from frequent policy lookups, the Access Vector Cache (AVC) stores recent access decisions, invalidating entries only when policy changes occur, thus reducing the need for repeated server queries during high-volume operations. The process ensures early SELinux initialization to label processes and resources correctly from startup. The is loaded into the by the process shortly after the initramfs hands off control, applying initial contexts to the filesystem and system services before full user-space initialization. This early loading prevents unlabeled objects from causing failures during subsequent boot stages. SELinux compatibility extends to Linux kernels from version 2.4.x onward, initially implemented as a loadable before becoming a standard LSM in later releases. In enforcing mode, the kernel blocks unauthorized accesses; permissive mode allows them while auditing; and disabled mode bypasses SELinux entirely, reverting to standard Linux access controls.

Access Control Mechanisms

Security-Enhanced Linux (SELinux) employs as its primary mechanism to enforce fine-grained separation between and system resources. In TE, every (process) is assigned a , which is a specific type, while every object (such as files, sockets, or devices) is labeled with a type. Access decisions are governed by rules that explicitly permit interactions between these types; for instance, an allow rule might permit a process in the httpd_t domain to read files labeled httpd_sys_content_t, while a neverallow rule prohibits any domain from accessing certain sensitive types to prevent policy violations. This model ensures that even if a process is compromised, it cannot access unauthorized resources, providing robust confinement without relying solely on discretionary access controls. Role-Based Access Control (RBAC) in SELinux adds an additional layer atop by mediating access through assigned to SELinux . act as intermediaries, restricting which domains a user can enter or transition into; for example, a might allow entry into administrative domains but deny access to -level ones, thereby limiting even if a gains unauthorized credentials. rules define allowable role-to-domain transitions, such as during or role-switching operations, ensuring that operate within predefined boundaries. This integration of RBAC with enables scalable management of permissions in multi-user environments. SELinux distinguishes between Linux users and SELinux users, with the latter serving as a identity that determines allowable roles and security levels. Linux users are mapped to SELinux users via configurations, such as the default mapping of all Linux users to unconfined_u through the __default__ , which grants broad access unless customized. Administrators can override these mappings using tools like semanage login to assign specific SELinux users (e.g., staff_u for limited administrative access or user_u for confined users), ensuring that processes inherit the appropriate upon execution. This mapping enforces user-specific constraints independently of Linux user IDs. Optionally, SELinux supports Multi-Level Security (MLS) and Multi-Category Security (MCS) for handling classified or categorized . MLS implements the Bell-LaPadula model, where subjects and objects are labeled with hierarchical sensitivity levels (e.g., unclassified, secret) combined with non-hierarchical categories (e.g., financial, personnel); a level dominates another if its sensitivity is greater or equal and it includes all or more categories of the other. Access rules enforce "no read up" (subjects read only from dominated levels) and "no write down" (subjects write only to levels that dominate theirs), preventing information leakage across clearance boundaries; for example, a at secret level can read unclassified but not write to it. MCS simplifies this by using only categories without sensitivity hierarchy, often applied in targeted policies with up to 1024 categories (e.g., s0:c0.c1023), allowing flexible compartmentalization for commercial environments. These optional models extend and RBAC for environments requiring strict controls.

Policies and Security Contexts

Policy Structure

SELinux policies are written in a declarative type enforcement that defines the security rules for on a . The is modular, consisting of source files that specify types, rules, and constraints to enforce . This allows administrators to customize and extend policies without modifying the . The primary source files for SELinux policies are .te (type enforcement) files, which contain the core definitions and rules. These files are organized into directories such as domains and types under /etc/selinux/(policy_name)/src/policy, enabling a hierarchical and maintainable design. To deploy a policy, the .te files are compiled into binary modules (.mod files) using the checkpolicy tool, which processes the source according to the policy grammar defined in policy_parse.y. The resulting modules are then loaded into the kernel using semodule, which manages the active policy configuration. Core elements of the policy language include types, attributes, classes, and permissions, which form the foundation for labeling and controlling subjects and objects. Types are declared to identify security domains for processes and objects, such as type sshd_t, domain;, where sshd_t represents the SSH daemon's domain and domain is an optional attribute. Attributes group related types for broader rule application, declared as attribute domain;. Classes define categories of objects, like file for files or process for running processes, with permissions specifying allowable operations within those classes, such as read, write, or execute. For instance, permissions for a file class might include { read execute } to allow reading and executing files. These elements are predefined in files like security_classes and access_vectors within the policy source. Policy rules are specified using various rule types to control access and transitions. The allow rule permits access, with syntax allow source_types target_types:classes permissions;, for example, allow sshd_t sshd_exec_t:file { read execute }; to let the SSH domain read and execute its executable file. The auditallow rule logs successful accesses without denying them, using similar syntax: auditallow source_types target_types:classes permissions;. Conversely, dontaudit suppresses logging of denied accesses to reduce noise: dontaudit source_types target_types:classes permissions;. Type transition rules, such as type_transition, manage domain changes during process creation: type_transition initrc_t sshd_exec_t:process sshd_t;, ensuring a new SSH process inherits the correct type from its parent and executable. These rules collectively enforce fine-grained control over system interactions. To promote reusability and consistency, SELinux policies use interfaces defined as macros in .if (interface) files, typically located in macros/ directories. These interfaces encapsulate common patterns, such as domain_auto_trans(current_domain, exec_type, new_domain); for automatic domain transitions, which can be invoked within .te files to simplify rule writing for file contexts or process labeling. For example, an interface might handle standard file operations for a domain, reducing redundancy across policy modules. This modular approach facilitates policy maintenance and extension.

Context Assignment and Management

In Security-Enhanced Linux (SELinux), security contexts are structured labels applied to subjects (such as processes) and objects (such as files, directories, sockets, and ports) to enforce . These contexts follow the format user:role:type:level, where the user identifies the SELinux user (e.g., system_u for system processes or unconfined_u for unconfined users), the role specifies the role assumed by the user (e.g., object_r for object roles or user_r for user roles), the type denotes the security domain or object type (e.g., httpd_exec_t for Apache executable files), and the level represents the sensitivity level in Multi-Level Security (MLS) or Multi-Category Security (MCS) configurations (e.g., s0 for the default level). Contexts are assigned to files and directories primarily through the file_contexts configuration, which uses patterns to match paths and specify default labels based on the . For example, the pattern /usr/sbin/[httpd](/page/Httpd)(/.*)? might assign system_u:object_r:[httpd](/page/Httpd)_exec_t:s0 to the binary and its subcomponents. This file, typically located at /etc/selinux/targeted/contexts/files/file_contexts, is compiled from sources during installation and ensures consistent labeling across the filesystem. For virtual filesystems like /proc, /sys, and /dev that lack extended attribute support, the genfscon statements provide generalized labeling by associating contexts with filesystem types and paths, such as labeling /sys/[kernel](/page/Kernel)/notes as system_u:object_r:sysctl_[kernel](/page/Kernel)_notes_t:s0 to control access without relying on xattrs. To apply or restore these default contexts, the restorecon command relabels files and directories by reading the file_contexts definitions and setting extended attributes accordingly; for instance, restorecon -Rv /var/www recursively relabels the to match policy expectations, often used after file modifications or system updates. Temporary changes can be made with chcon, which directly sets a context without altering policy, such as chcon -t user_tmp_t /tmp/myfile for short-term adjustments, though these do not persist across reboots or restorecon runs. For handling unlabeled objects—those lacking a valid context, often marked as unlabeled_trestorecon assigns the appropriate policy-defined label, preventing access denials due to missing security attributes. Management of and mappings, which influence assignment for , is handled by the semanage tool. Specifically, semanage user defines associations between SELinux users and allowable roles/levels (e.g., mapping sysadm_u to sysadm_r for administrative tasks), while semanage fcontext persistently updates file labeling rules in /etc/selinux/targeted/contexts/files/file_contexts.local using regex patterns, followed by restorecon to apply changes. inherit contexts from their or mappings, ensuring type enforcement; for example, a new file created by an httpd_t inherits httpd_t unless specifies otherwise. During or reload, persistent labeling is enforced via initial filesystem relabeling (e.g., using fixfiles or restorecon -R /), which scans and labels all objects according to the active to maintain inheritance and security consistency.

Features and Capabilities

Mandatory Access Control Elements

SELinux provides several advanced elements for implementing (MAC), enabling fine-grained enforcement of security policies. These elements include runtime-tunable booleans, confinement profiles for processes, mechanisms for file labeling inheritance through type transitions, and polyinstantiation using multi-category security (MCS) to isolate user environments. Together, they allow administrators to balance security and functionality without recompiling policies or restarting the system. Booleans serve as runtime toggles within SELinux policies, permitting dynamic enabling or disabling of specific rules without requiring policy modifications or system reboots. For instance, the httpd_enable_homedirs boolean allows the to access user home directories, which is disabled by default to prevent unauthorized file exposure. These toggles are managed using commands like getsebool to query the current state and setsebool to modify it, with the -P option ensuring persistence across reboots. Booleans are particularly useful for adapting policies to operational needs, such as granting temporary network access to databases for web services via httpd_can_network_connect_db. Confinement profiles in SELinux define how processes are isolated through domain types, primarily via targeted and strict policies. The targeted policy, the default in distributions like and , confines only specific network-facing services while leaving most user processes unconfined under the unconfined_t domain to minimize disruption. For example, the web server operates in the httpd_t domain, restricting its access to system resources like files and ports unless explicitly allowed by policy rules. In contrast, the strict policy applies comprehensive confinement across the entire system, including user processes, to meet certification standards such as EAL4+ for labeled security protection profiles (LSPP), using multi-level security (MLS) with sensitivity levels from s0 to s15. This approach ensures stricter isolation but requires more administrative effort for policy tuning. File labeling inheritance in SELinux is governed by type transition rules, which automatically assign security contexts to newly created files or processes to maintain policy integrity. During file operations like creation in a directory, the default inheritance from the parent directory can be overridden by type_transition rules in the , ensuring the new receives an appropriate type. For example, a created by a process in the httpd_t within a var_t might transition to httpd_cache_t for caching purposes, preventing unintended access escalations. Similarly, on execve calls, transitions occur when a executes a labeled with an entrypoint type, such as transitioning from init_t to httpd_t upon launching the Apache binary labeled httpd_exec_t. These transitions enforce least privilege by confining child to predefined . Polyinstantiation in SELinux leverages multi-category (MCS) to create isolated instances of shared directories, enhancing by preventing cross- in multi- environments. MCS assigns categories (c0 to c1023) to processes and files, allowing only if categories match, and is applied after type enforcement checks. For -specific directories like /tmp or home directories, polyinstantiation instantiates private versions (e.g., /tmp/[user](/page/User).inst/) based on the 's MCS level, such as s0:c0 for a standard . This is enabled via the allow_polyinstantiation boolean and configured in /etc/[security](/page/Security)/namespace.conf using PAM modules like pam_namespace.so, ensuring that each sees only their own instance without visibility into others'. Such isolation is critical for scenarios like shared temporary , where it mitigates information leakage between s.

Auditing and Logging

Security-Enhanced Linux (SELinux) integrates with the Linux Audit System to monitor and record decisions, particularly Access Vector Cache (AVC) denials, which occur when a attempts an operation prohibited by the SELinux . These events are generated by the and forwarded to the audit daemon (auditd), which logs them to the file /var/log/audit/audit.log by default. If the auditd service is not running, SELinux falls back to logging denials via the kernel ring buffer to /var/log/messages or the system journal. This logging mechanism ensures that security-relevant events, such as denied file accesses or network operations, are captured for forensic analysis and policy refinement. The format of SELinux audit messages is structured to provide detailed about each , including the , the denied permission, the involved, details, and the contexts of the source (subject) and target (object). A typical AVC entry in the log resembles the following example, where a is denied read to a :
type=AVC msg=[audit](/page/Audit)(1600796109.687:168): avc: denied { read } for [pid](/page/pid)=1234 comm="[httpd](/page/httpd)" path="/var/www/[html](/page/html)/secret.txt" scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:admin_home_t:s0 tclass=[file](/page/File) permissive=0
This message indicates the denial occurred during a read operation on a file with administrative context by an httpd process running under the httpd domain, along with the associated system call and process ID. Such details facilitate quick identification of policy mismatches without requiring deep kernel-level debugging. To analyze these logs, SELinux provides command-line tools like ausearch for querying the audit records and audit2allow for generating policy allow rules based on observed denials. The ausearch utility allows filtering logs by criteria such as message type (e.g., -m AVC), process ID, or time range, producing human-readable output that summarizes denials for easier review; for instance, ausearch -m AVC -ts recent lists recent AVC events. Complementing this, audit2allow processes denial logs to suggest Type Enforcement rules, such as creating a local policy module to permit a specific , which can then be compiled and loaded with semodule; an example workflow is ausearch -m AVC --raw | audit2allow -M mymodule, followed by semodule -i mymodule.pp. These tools streamline by automating the extraction and translation of log data into actionable policy adjustments. In permissive mode, SELinux logs potential violations as AVC denials without enforcing the to them, allowing the system to operate normally while capturing a record of what would be denied in enforcing mode. This configuration is particularly useful for initial development or , as it reveals access patterns and misconfigurations through logs without disrupting services; the mode can be set via /etc/selinux/config or commands like setenforce 0. Transitioning to enforcing mode after analysis ensures full protection while minimizing unexpected denials.

Implementation Guide

Installation Process

Installing Security-Enhanced Linux (SELinux) requires a compiled with SELinux support, specifically the kernel configuration option CONFIG_SECURITY_SELINUX=y, which is included in most modern distributions' kernels. Essential user-space packages include libselinux for basic SELinux library functions and policycoreutils for policy management tools. Additionally, a compatible filesystem such as , , or is necessary to support extended attributes used for SELinux contexts. On (RHEL) and -based systems, SELinux is often enabled by default, but installation or enabling involves installing the targeted policy package. For RHEL and derivatives like , use dnf install selinux-policy-targeted (or yum install on older versions) to install the base policy, along with libselinux-utils for utilities like sestatus. On , if SELinux is disabled, install selinux-policy-targeted similarly, as it provides the default policy for common services. For and , SELinux is not enabled by default; install the packages selinux-basics, selinux-policy-default, and auditd using apt install selinux-basics selinux-policy-default auditd to set up the basic framework and default policy. To enable SELinux persistently, configure the by /etc/selinux/config and setting SELINUX=enforcing or SELINUX=permissive for the desired mode. On -based systems, append selinux=1 enforcing=1 to the command line in /etc/default/[grub](/page/Grub) and run grub2-mkconfig -o /boot/[grub](/page/Grub)2/[grub](/page/Grub).cfg (or equivalent for ). For /, run selinux-activate after package installation, which automates updates and prepares for relabeling. After , the filesystem must be relabeled to SELinux contexts, as unlabeled filesystems will trigger permissive mode or denials. Create the marker file with touch /.autorelabel and ; the system will relabel during boot, which may take considerable time depending on disk size. Alternatively, use fixfiles -F onboot on RHEL/ to initiate relabeling on the next . On , the selinux-activate command handles this preparation automatically. Post-installation verification ensures SELinux is operational. Run sestatus or getenforce as to check the mode; Enforcing confirms active . To temporarily switch modes without rebooting, use setenforce 1 for enforcing or setenforce 0 for permissive. On , additionally run check-selinux-installation to validate the setup and review any audit denials with audit2why -a.

Configuration and Policy Management

Configuration and policy management in Security-Enhanced Linux (SELinux) involves administrative tasks to customize, maintain, and troubleshoot security policies post-installation, ensuring the system enforces effectively. Administrators typically work with modular policies that can be extended or modified without altering the core , allowing for tailored security configurations on systems. These tasks are performed using user-space tools provided by packages such as policycoreutils and selinux-policy-devel. Custom policy modules are created to address specific application or service needs by defining type enforcement rules. The process begins with generating template files using the sepolicy generate command, which produces a .te (type enforcement) file containing rules, along with interface (.if) and file context (.fc) files. The .te file is then edited to specify allow rules, such as permitting a to access certain resources. Compilation occurs in two steps: first, checkmodule processes the .te file into a binary (.mod), followed by checkpolicy compiling it into a policy package (.pp). The is installed using semodule -i <module.pp>, loading it into the without rebooting. Several commands facilitate ongoing policy and context management. The semanage utility manages persistent configurations, such as mapping ports (semanage port -a -t http_port_t -p tcp 8080) or users (semanage user -a -R "staff_r" myuser_u). Restorecon relabels files and directories to their default SELinux contexts based on policy definitions, correcting mislabeling issues with options like -R for recursive application. The sepolicy tool queries policy information, such as listing booleans or generating module templates from binaries. For dynamic adjustments, boolean toggles can enable or disable specific policy features without module changes, as detailed in mandatory access control elements. Troubleshooting policy issues relies on analyzing access denials logged by the . The audit2why command examines logs to explain denial reasons, helping identify missing rules or errors; for example, ausearch -m AVC -ts recent | audit2why provides targeted output. To resolve, audit2allow can generate a custom module from denials (ausearch -m AVC | audit2allow -M mymodule), which is then installed via semodule. Modules can be disabled temporarily for testing with semodule -d <module_name>, or removed entirely with semodule -r. Log-based generation, as covered in auditing and logging, aids in automating these fixes. Best practices emphasize starting with the SELinux Reference Policy, a comprehensive, modular base policy that provides a foundation for customizations and is maintained upstream for consistency. Policies should be developed and tested in permissive mode (setenforce 0), where denials are logged but not enforced, allowing safe iteration before switching to enforcing mode. Regular updates to policies are recommended through distribution packages like selinux-policy-targeted in or , ensuring alignment with security patches and kernel changes. Administrators should verify configurations using commands like ps -eZ for process contexts and maintain backups of custom modules to facilitate rollbacks.

Adoption and Applications

Distribution and System Integration

Security-Enhanced Linux (SELinux) is prominently integrated into the Red Hat ecosystem, including (RHEL), , , and . Since the release of RHEL 4 in 2005, SELinux has been enabled by default in enforcing mode, utilizing the targeted policy to confine key services while allowing unconfined processes to operate with traditional permissions. This default configuration persists across these distributions, promoting (MAC) as a standard security feature for server and desktop environments. Fedora, as the upstream for RHEL, similarly defaults to enforcing mode with the targeted policy, ensuring seamless policy inheritance during development cycles. In and , SELinux integration is optional and requires installation of the selinux package along with reference policies such as refpolicy for customization and deployment. These distributions prioritize by default but support SELinux through dedicated packages like selinux-policy-default, enabling users to activate it for specific workloads. A notable application is in , where a customized SELinux was introduced in version 4.3 in 2013, initially in permissive mode, with full enforcement starting from Android 5.0 in 2014 to provide robust app sandboxing and system isolation, enhancing mobile device security beyond discretionary access controls. SUSE Linux Enterprise Server 15 offered SELinux support alongside its default AppArmor framework, allowing hybrid configurations where users can select SELinux for granular or combine both for layered protection, but starting with SLES 16 in November 2025, SELinux became the default in enforcing mode. This shift is mirrored in the project, where adopted SELinux as default in February 2025, and Leap 16 followed suit later in the year. In embedded systems, SELinux is incorporated into distributions like , targeting routers and appliances to mitigate exploits in resource-constrained environments through policy enforcement on network-facing services. As of 2025, SELinux adoption is widespread in enterprise settings, particularly on RHEL-based servers, which command approximately 43% of the enterprise market and typically retain default enforcing mode for compliance and security. In cloud environments, AWS EC2 and virtual machine images for RHEL enable SELinux in enforcing mode by default, facilitating secure hybrid and multi-cloud deployments.

Use Case Examples

One prominent use case for SELinux is the confinement of web servers such as , which operates within the httpd_t domain by default when SELinux is enabled. This domain restricts the server process to accessing files labeled with specific types, such as httpd_exec_t for executables and httpd_sys_content_t for content in directories like /var/www. For instance, this prevents directory traversal attacks by denying access to unauthorized paths, such as system files outside the web root, thereby limiting potential damage if the server is compromised. In database management, SELinux confines services like or to the mysqld_t or mariadb_t domain, respectively, which limits the process to reading and writing only to designated data directories labeled mysqld_db_t, typically /var/lib/mysql. This isolation protects sensitive database files from unauthorized access by other processes. For backup operations, SELinux policies permit controlled transitions, such as allowing mysqld_dump utilities to execute within compatible domains to export data without granting broader system access. SELinux enhances container security in environments like and by applying labels to images, volumes, and pods to enforce isolation. In , the SELinux policy uses multi-category security (MCS) labels to segregate containers, preventing one container from accessing another's files or processes through shared host resources. Similarly, in , pod security contexts allow assignment of SELinux types, such as container_t, ensuring that pods run in confined domains and volumes are relabeled appropriately to block cross-pod data leaks. On mobile devices, integrates SELinux to enforce for application permissions, confining apps to specific domains like untrusted_app_t while restricting hardware access. For example, media-related domains, such as those governing the cameraserver in cameraserver_t, limit camera hardware access to authorized services only, ensuring that apps can invoke camera functions via mediated APIs without direct device control, thereby mitigating risks.

Comparisons and Alternatives

Versus AppArmor

Security-Enhanced Linux (SELinux) and AppArmor represent two prominent mandatory access control (MAC) mechanisms integrated into the Linux kernel via the Linux Security Modules (LSM) framework, but they differ fundamentally in their enforcement philosophies and implementation details. SELinux employs a label-based approach, assigning security contexts to files, processes, and other objects based on their attributes, which enables fine-grained control over access decisions regardless of file paths or locations. In contrast, AppArmor utilizes path-based profiles that restrict access to specific file paths and executable names, simplifying confinement to application behaviors in predictable directory structures but potentially vulnerable to symlink attacks or path manipulations. This label-based model in SELinux supports advanced features like Multi-Level Security (MLS) and Multi-Category Security (MCS), allowing for hierarchical and categorical separations that AppArmor lacks, thereby providing greater granularity for high-security environments. Regarding ease of use, is generally regarded as more accessible for administrators, featuring a shallower through its straightforward profile syntax and modes like "complain" for learning-based policy generation, which permits violations for auditing without enforcement. SELinux, while more powerful in enforcing comprehensive MAC policies through type enforcement and , demands greater expertise due to its complex policy language and tools like audit2allow for converting denials into rules, often leading to a steeper setup and maintenance process. AppArmor's path-centric design suits simpler confinement scenarios, such as restricting web servers to specific directories, whereas SELinux's label system excels in scenarios requiring dynamic or context-aware protections but can overwhelm users unfamiliar with its auditing and relabeling requirements. In terms of performance, SELinux mitigates overhead from its detailed policy evaluations via the Access Vector Cache (AVC), which stores recent access decisions to handle large-scale policies efficiently without significant runtime impact. , being lighter-weight and path-focused, imposes minimal resource demands and is filesystem-agnostic, though it may introduce slight delays during system startup for profile loading. SELinux requires label-aware filesystems like with SELinux extensions for optimal operation, potentially adding complexity to deployments, while 's approach avoids such dependencies, contributing to its lower overall footprint in resource-constrained systems. Adoption patterns reflect these trade-offs, with SELinux serving as the default MAC in (RHEL), , , and derivatives, where its robustness supports enterprise-grade security needs. , conversely, is the standard in (since version 7.10), (since 10), Server, and , appealing to distributions prioritizing usability for and users. Both modules can coexist in modern kernels through LSM stacking capabilities, enabling selective enforcement—such as AppArmor for filesystem paths and SELinux for network or label-based controls—though traditional setups limit simultaneous major LSM activation to avoid conflicts.

Versus Other Security Frameworks

Security-Enhanced Linux (SELinux) provides a robust (MAC) framework integrated into the , emphasizing type enforcement (TE) and (RBAC) for granular policy definition. In contrast, grsecurity, often paired with the memory protection patch, focuses on kernel hardening techniques beyond pure MAC, such as (ASLR) to mitigate exploits and enhanced auditing for kernel-level threats. While SELinux excels in fine-grained object labeling and complex enterprise policies, grsecurity offers simpler lists (ACLs) and automatic policy generation tools like gradm, making it more approachable for users seeking broad exploit mitigation without extensive configuration. SELinux imposes higher performance overhead in areas like due to its comprehensive checks, whereas grsecurity's penalties are more pronounced in file operations but include exclusive features like runtime code generation prevention. Smack (Simplified Mandatory Access Control Kernel) employs a streamlined labeling system where subjects and objects receive short string labels, enabling basic access decisions based on label equality or hierarchies, which contrasts with SELinux's multifaceted RBAC and models designed for intricate, multi-level in large-scale environments. Smack prioritizes minimal administrative overhead and is tailored for embedded systems, requiring less configuration and application awareness than SELinux's detailed files and relabeling processes. SELinux supports advanced features like multi-category for distributed systems, while Smack's suits scenarios with fewer domains, such as automotive or lightweight kernel builds. TOMOYO Linux adopts a pathname-based MAC approach, enforcing policies through whitelisting of explicit file paths and process behaviors recorded during learning modes, differing from SELinux's attribute-based labeling on that facilitates object-centric controls in networked or shared-resource setups. SELinux's model is better suited for environments needing type isolation across distributed objects, whereas TOMOYO's path-matching reduces complexity by avoiding label management, though it may falter with symbolic links or dynamic paths. TOMOYO generates policies via runtime observation, easing initial setup compared to SELinux's manual policy authoring, but lacks the depth of RBAC for role-specific constraints. Landlock introduces an unprivileged mechanism via the (LSM) framework, allowing non-root processes to impose filesystem restrictions through stackable policies, in opposition to SELinux's root-required, system-wide enforcement that includes comprehensive auditing and labeling. As an emerging tool integrated since Linux 5.13, Landlock enables application-specific sandboxes without kernel modifications, leveraging for flexible, bytecode-based rules, while SELinux demands privileged policy loading for its audited, TE-driven controls. Landlock's design mitigates risks in user-space by restricting ambient rights per-process, but it offers narrower scope than SELinux's full-spectrum for kernel-enforced and .

Recent Enhancements

Modern Developments

Since the early , SELinux has seen significant performance enhancements, particularly in the Access Vector Cache (AVC) mechanism, which caches access decisions to reduce policy evaluation overhead. In 9, released in 2022 and based on 5.14, SELinux loading times were substantially reduced, alongside lower memory usage and improved overall efficiency, making it more suitable for high-throughput environments. These optimizations build on earlier kernel advancements, such as those in 5.10 from late 2020, where general caching and paging improvements indirectly benefited SELinux enforcement by minimizing system latency during access checks. Advancements in container and integration have addressed dynamic labeling challenges for persistent volumes. 1.27, released in 2023, introduced beta support for efficient SELinux volume relabeling via the Container Storage Interface (), allowing drivers to announce SELinux mount options and apply labels without full filesystem relabels, which reduces overhead in multi-tenant clusters. Similarly, drivers such as have incorporated SELinux-aware mounting since 2023, enabling secure volume labeling for containerized workloads. For Podman, integration with SELinux has matured since 2021, supporting rootless containers with automatic label handling for volumes and sockets, enhancing in daemonless environments. SELinux policy management has evolved with regular updates to address emerging threats and improve modularity. In 2025, released an update to the selinux-policy packages for RHEL 9, incorporating bug fixes and enhanced rules for vulnerability mitigation, such as those related to recent CVEs in system services. Tools like udica, introduced around and refined in subsequent years, facilitate generating custom policies for containers, supporting pipelines by automating policy module creation from logs. These updates emphasize modular policies that can be incrementally deployed without full system rebuilds. Community efforts as of 2025 have prioritized , particularly through graphical tools to lower the barrier for . The setroubleshoot utility, a key diagnostic tool, continues to provide user-friendly analysis of SELinux denials by translating audit logs into actionable alerts, with recent guides highlighting its role in rapid troubleshooting on distributions like . While specific metrics for SELinux remain enterprise-focused—primarily through RHEL and , where it is enabled by default—community contributions via the SELinux Project on emphasize policy refinement and , addressing gaps in documentation for modern workloads.

Extensions and Integrations

Security-Enhanced Linux (SELinux) has been extended to support containerized environments through integrations with (OCI)-compliant runtimes like runc, enabling fine-grained labeling of container to enforce mandatory access controls. In (RHEL) and Container Platform, SELinux policies can label container to restrict privileged workloads, ensuring that containers inherit appropriate security contexts without compromising host isolation. This integration allows administrators to apply SELinux rules to container processes and filesystems, preventing unauthorized access across namespace boundaries. For orchestration, the SELinux plugin facilitates node admission control by validating security contexts against SELinux policies, as implemented in environments where must be labeled for SELinux profile enforcement. Hardware integrations in SELinux have advanced with support for (TPM) and secure boot mechanisms, particularly in RHEL 9 and later releases starting from 2022. RHEL 9 kernels incorporate SELinux labeling for secure boot processes, where boot components are signed with trusted certificates and verified using TPM for integrity attestation during system startup. This ensures that SELinux policies remain enforceable even in environments with secure boot enabled, preventing tampering with labeled files and processes at the level. Custom extensions of SELinux leverage its Domain and Type Enforcement (DTE) model for specialized domains, such as (IoT) devices, where lightweight policy variants enforce resource isolation on resource-constrained hardware. In (AOSP), SELinux's sepolicy framework customizes DTE rules for and systems, combining core platform policies with vendor-specific extensions to label services, apps, and hardware interfaces. This allows devices to enforce SELinux in enforcing mode by default, with sepolicy files defining types for system domains like mediaserver and surfaceflinger to mitigate privilege escalations. Device-specific policies are compiled from AOSP's system/sepolicy directory, enabling tailored DTE enforcement for features like camera access or network binding without altering the base . As of 2025, SELinux benefits from hooks integrated into Linux Security Module (LSM) frameworks, allowing dynamic policy loading without kernel recompilation or system reboots. Projects like BPF-LSM enable programs to attach to LSM hooks traditionally used by SELinux, compiling runtime security rules into efficient bytecode for real-time enforcement in containerized setups. This extends SELinux's static policies with adaptive controls, such as just-in-time access decisions based on behavioral monitoring. Collaborations within the (CNCF) further integrate SELinux with cloud-native tools; for instance, CRI-O's graduation emphasizes SELinux support for least-privilege container execution, while runtime engines like KubeArmor leverage LSM hooks—including those compatible with SELinux—for behavioral policy enforcement in clusters.

References

  1. [1]
    What is SELinux? - Red Hat
    Aug 30, 2019 · Security-Enhanced Linux (SELinux) is a security architecture for Linux systems that allows administrators to have more control over who can access the system.What is SELinux? · How does it work? · DAC vs. MAC
  2. [2]
    National Security Agency Shares Security Enhancements to LINUX
    Jan 2, 2001 · The security-enhanced Linux prototype was developed in conjunction with research partners from NAI Labs, Secure Computing Corporation (SCC), and ...
  3. [3]
    49.3. Brief Background and History of SELinux | Deployment Guide
    SELinux was originally a development project from the National Security Agency ( NSA ) and others. It is an implementation of the Flask operating system ...
  4. [4]
    Getting started with SELinux - Fedora Docs
    SELinux is a Linux Security Module (LSM) that is built into the Linux kernel. The SELinux subsystem in the kernel is driven by a security policy.<|control11|><|separator|>
  5. [5]
    Security-Enhanced Linux in Android - Android Open Source Project
    Aug 26, 2024 · Android uses Security-Enhanced Linux (SELinux) to enforce mandatory access control (MAC) over all processes, even processes running with root/superuser ...
  6. [6]
    Chapter 1. Getting started with SELinux | Red Hat Enterprise Linux | 8
    Security Enhanced Linux (SELinux) implements Mandatory Access Control (MAC). Every process and system resource has a special security label called an SELinux ...
  7. [7]
    How SELinux deny rules improve system security - Red Hat Developer
    Jun 4, 2025 · SELinux userspace release 3.6 introduces deny rules. This article demonstrated how you can now remove SELinux permissions from the base SELinux ...
  8. [8]
    SELinuxProject/selinux - GitHub
    This repository contains the sources for the SELinux utilities and system libraries which allow for the configuration and management of an SELinux-based system.SELinux Project · Issues 89 · Pull requests 26 · SecurityMissing: maintenance | Show results with:maintenance
  9. [9]
    [PDF] Configuring the SELinux Policy - National Security Agency
    NSA Security-Enhanced Linux (SELinux) is an implementation of a flexible and fine-grained mandatory access control (MAC) architecture called Flask in the ...
  10. [10]
    SELinux - The Linux Kernel documentation
    Contents · Booting the kernel · Tracking down and identifying problems · Core-kernel subsystems · Block-layer and filesystem administration · Device-specific ...
  11. [11]
    4.13. Multi-Level Security (MLS) | Red Hat Enterprise Linux | 7
    The Multi-Level Security technology refers to a security scheme that enforces the Bell-La Padula Mandatory Access Model.
  12. [12]
    Chapter 6. Using Multi-Level Security (MLS) | Using SELinux
    With Multi-Category Security (MCS), you can define categories such as projects or departments, and users will only be allowed to access files in the categories ...
  13. [13]
    [PDF] NSA Security-Enhanced Linux (SELinux)
    Originated from NSA R&D. • First public release by NSA in Dec 2000. • Large and growing user and developer community. • First packaged externally for Debian ...Missing: 1999-2000 | Show results with:1999-2000<|control11|><|separator|>
  14. [14]
    [PDF] The Flask Security Architecture: System Support for Diverse Security ...
    Jul 29, 2021 · Master's thesis, University of Utah,. 1998. pp. 70. http://www.cs.utah.edu/projects/flux/fluke/html/ flask.html. [10] D. F. Ferraiolo, J. A. ...
  15. [15]
    Kernel Korner - NSA Security Enhanced Linux
    Aug 1, 2003 · The Flask architecture was the result of a joint effort between the NSA, SCC and the University of Utah's Flux Project, which was “enhanced to ...Missing: 1999-2000 | Show results with:1999-2000
  16. [16]
    [PDF] Have You Driven an SELinux Lately? - The Linux Kernel Archives
    In March 2001, the NSA presented SELinux to senior kernel developers at the Linux Kernel Summit. ... The Labeled NFS project [3] was started in 2007 to ... USENIX ...
  17. [17]
    [PDF] Stephen Smalley NSA Laboratory for Advanced Cybersecurity ...
    Apr 3, 2024 · SELinux upstream merge in Linux 2.6.0-test3, Aug 2003. • Linux 2.6.0 (“The beaver is out of detox”) released Dec 2003. • 20 years of SELinux ...
  18. [18]
    [PDF] Raising the Bar in Operating System Security: - GovInfo
    Over the past several years, the Security-Enhanced Linux. (SELinux) reference implementation of the Flask security architecture has undergone a rapid evolution ...
  19. [19]
    Linux_2_6_19 - Linux Kernel Newbies
    Summary of the changes and new features merged in the Linux Kernel during the 2.6.19 development.
  20. [20]
    [PDF] Development of Embedded SELinux - CE Linux Forum
    • We ported SELinux to Android on Zaurus. – File system is ext3. Page 40. Copyright © 2008 Hitachi Software Engineering Co., Ltd. 40. SELinux on Android Zaurus.<|control11|><|separator|>
  21. [21]
    SELinuxProject/selinux-kernel - GitHub
    SELinux is a security enhancement to Linux which provides users and administrators a more granular, powerful access control mechanism. It consists of a kernel ...
  22. [22]
    2 New Features and Changes - Oracle Help Center
    Various bug fixes and improvements; The default provider includes the RIPEMD160 hash function. SELinux User-Space Packages Updated to Version 3.5. SELinux ...
  23. [23]
    Security-Enhanced Linux
    The official website for the National Security Agency.
  24. [24]
    [PDF] Integrating Flexible Support for Security Policies into the Linux ...
    The Flask architec ture cleanly separates the definition of the policy logic from the enforcement mechanism. The security policy logic is encapsulated within a ...
  25. [25]
    SELinux Frequently Asked Questions (FAQ)
    What did they do? The Security-enhanced Linux prototype was developed by NSA in conjunction with research partners from NAI Labs, Secure Computing Corporation ...
  26. [26]
    Celebrating 15 Years of SELinux - Red Hat
    Dec 18, 2015 · On Dec. 22, 2000, the NSA released their code to the wider open source world in the form of SELinux, and in doing so forever ...
  27. [27]
    [PDF] IBM is a leader in Linux security
    IBM's contributions to the audit subsystem, labeled IPsec, and namespaces technologies help Linux to meet government security standards. The Common Criteria ...Missing: TrustedBSD | Show results with:TrustedBSD
  28. [28]
  29. [29]
    [PDF] Implementing SELinux as a Linux Security Module
    ... NSA SELinux web site (http://www.nsa.gov/selinux). In response to the NSA ... The Linux Security Modules (LSM) project was started by Immunix to develop such a ...
  30. [30]
    Linux Security Modules: General Security Support for the Linux Kernel
    The Linux Security Modules (LSM) project has developed a lightweight, general purpose, access control framework for the mainstream Linux kernel.
  31. [31]
    4.5. Changing SELinux Modes at Boot Time - Red Hat Documentation
    On boot, you can set several kernel parameters to change the way SELinux runs. This parameter causes the kernel to not load any part of the SELinux ...
  32. [32]
    Chapter 2. Changing SELinux states and modes
    The sestatus command returns the SELinux status and the SELinux policy being used: ... When SELinux is running in permissive mode, SELinux policy is not enforced.
  33. [33]
    Kernel Korner - Filesystem Labeling in SELinux - Linux Journal
    Oct 1, 2004 · The security server consults the security policy database and determines a result, which is cached in the AVC and returned to the SELinux hook.
  34. [34]
    49.7. SELinux Policy Overview | Red Hat Enterprise Linux | 5
    These new policies can be loaded into the kernel in real time. Otherwise, the policy is loaded during the boot process by init , as explained in Section 49.7.3, ...
  35. [35]
    49.7.3. The Role of Policy in the Boot Process | Deployment Guide
    SELinux plays an important role during the early stages of system start-up. Because all processes must be labeled with their correct domain.
  36. [36]
    Contributors to SELinux - National Security Agency
    Contributors to SELinux. The following organizations and individuals have contributed to the Security-enhanced Linux project. The listing of contributors is ...
  37. [37]
    13.2. Types | SELinux User's and Administrator's Guide
    The main permission control method used in SELinux targeted policy to provide advanced process isolation is Type Enforcement. All files and processes are ...
  38. [38]
    [PDF] Meeting Critical Security Objectives with Security-Enhanced Linux
    Jul 29, 2021 · Security-enhanced Linux incorporates a strong, flex ible mandatory access control architecture into. Linux. It provides a mechanism to ...
  39. [39]
    Chapter 2. SELinux Contexts | Red Hat Enterprise Linux | 7
    Part of SELinux is the Role-Based Access Control (RBAC) security model. The role is an attribute of RBAC. SELinux users are authorized for roles, and roles ...
  40. [40]
    Chapter 3. Managing confined and unconfined users | Using SELinux
    Each Linux user is mapped to an SELinux user according to the rules in the SELinux policy. Administrators can modify these rules by using the semanage login ...
  41. [41]
    Using SELinux | Red Hat Enterprise Linux | 8
    Security Enhanced Linux (SELinux) implements Mandatory Access Control (MAC). Every process and system resource has a special security label called an SELinux ...Using Selinux · Prevent Users And Processes... · Mcs Within Multi-Level...
  42. [42]
    4.7. SELinux Contexts – Labeling Files | Red Hat Enterprise Linux | 7
    Type Enforcement is the main permission control used in SELinux targeted policy. For the most part, SELinux users and roles can be ignored. 4.7.2 ...
  43. [43]
    selinux(8) - Linux manual page - man7.org
    The MLS (Multi-Level Security) policy is designed as a policy where all processes are partitioned into fine-grained security domains and confined by policy. MLS ...<|control11|><|separator|>
  44. [44]
  45. [45]
    semanage-user(8) - Linux manual page - man7.org
    `semanage-user` is a tool for SELinux policy management, controlling the mapping between SELinux users and their roles and MLS/MCS levels.
  46. [46]
  47. [47]
    4.6. Booleans | SELinux User's and Administrator's Guide
    Booleans allow parts of SELinux policy to be changed at runtime, without any knowledge of SELinux policy writing. This allows changes, such as allowing services ...
  48. [48]
    Chapter 3. Targeted Policy | SELinux User's and Administrator's Guide
    Targeted policy is the default SELinux policy used in Red Hat Enterprise Linux. When using targeted policy, processes that are targeted run in a confined ...
  49. [49]
    SELinux/Policies - Fedora Project Wiki
    We also added MCS policy to targeted and strict, which confines the sensitivity level to s0 but allows us to work with user defined capapabilites. This ...
  50. [50]
    Quick start to write a custom SELinux policy
    Apr 11, 2025 · For an introduction to SELinux refer to the RHEL 9 Using SELinux document. ... type_transition <source> <entrypoint>:process <target> ...
  51. [51]
    4.14. File Name Transition | SELinux User's and Administrator's Guide
    The file name transition feature allows policy writers to specify the file name when writing policy transition rules.
  52. [52]
    Chapter 11. Configuring polyinstantiated directories | Using SELinux
    You can verify that polyinstantiation is enabled in SELinux by entering the getsebool allow_polyinstantiation command. Create the directory structure for data ...
  53. [53]
    Chapter 7. Using Multi-Category Security (MCS) for data confidentiality
    You can use MCS to enhance the data confidentiality of your system by categorizing data, and then granting certain processes and users access to specific ...
  54. [54]
    6 Troubleshooting Access-Denial Messages - Oracle Help Center
    If the auditing service ( auditd ) isn't running, SELinux logs AVC denial messages to /var/log/messages . Otherwise, the messages are logged to the /var/log/ ...
  55. [55]
    Troubleshooting Problems Related to SELinux - Fedora Docs
    SELinux denials in the audit log. The Linux Audit system stores log entries in the /var/log/audit/audit.log file by default. To list only SELinux-related ...
  56. [56]
    8.3.6. Raw Audit Messages | Security-Enhanced Linux
    Raw audit messages are logged to /var/log/audit/audit.log . The following is an example AVC denial (and the associated system call) that occurred when the ...
  57. [57]
    How to read and correct SELinux denial messages - Red Hat
    Nov 16, 2020 · Check the /var/log/messages and /var/log/audit/audit.log files for SELinux denials. SELinux Permissive mode can be used briefly to check if ...
  58. [58]
    8.3.5. Searching For and Viewing Denials | Security-Enhanced Linux
    A number of tools are available for searching for and viewing SELinux denials, such as ausearch, aureport, and sealert.
  59. [59]
    8.3.8. Allowing Access: audit2allow | Security-Enhanced Linux
    After access is denied by SELinux, running the audit2allow command presents Type Enforcement rules that allow the previously denied access.
  60. [60]
    Using SELinux | Red Hat Enterprise Linux | 9
    SELinux is an implementation of Mandatory Access Control (MAC), and provides an additional layer of security. The SELinux policy defines how users and processes ...
  61. [61]
    SELinux/Setup - Debian Wiki
    May 7, 2024 · The following steps describe how to install and configure SELinux together with the default policy which enables SELinux for the most important parts of your ...xfs · mail servers (postfix/exim/etc)
  62. [62]
    Chapter 4. Working with SELinux | Red Hat Enterprise Linux | 7
    Also, by default, SELinux runs in enforcing mode and the SELinux targeted policy is used. The following SELinux packages are installed on your system by default ...Missing: strict | Show results with:strict
  63. [63]
    Chapter 8. Writing a custom SELinux policy - Red Hat Documentation
    An SELinux security policy is a collection of SELinux rules. A policy is a core component of SELinux and is loaded into the kernel by SELinux user-space tools.Missing: strict | Show results with:strict
  64. [64]
    Chapter 5. Troubleshooting problems related to SELinux
    You might need to troubleshoot situations potentially blocked by SELinux. Note that in most cases, SELinux denials are signs of misconfiguration.
  65. [65]
    SELinux User's and Administrator's Guide | Red Hat Enterprise Linux
    The SELinux subsystem in the kernel is driven by a security policy which is controlled by the administrator and loaded at boot. All security-relevant, kernel- ...
  66. [66]
  67. [67]
    Chapter 21. SELinux | Reference Guide | Red Hat Enterprise Linux | 4
    SELinux defines the access and transition rights of every user, application, process, and file on the system. SELinux then governs the interactions of these ...
  68. [68]
    Debian -- Details of package selinux-policy-src in sid
    Source of the SELinux reference policy for customization. The SELinux Reference Policy (refpolicy) is a complete SELinux policy, as an alternative to the ...Missing: optional | Show results with:optional
  69. [69]
    Configuring SELinux | Security and Hardening Guide | SLES 15 SP7
    In this chapter, you learn how to set up and manage SELinux on SUSE Linux Enterprise Server. The following topics are covered.
  70. [70]
    OpenWrt and SELinux - LWN.net
    Sep 30, 2020 · SELinux comes in handy to prevent potential exploits especially on embedded devices. As pointed out on this article, SELinux being part of ...Missing: appliances | Show results with:appliances
  71. [71]
    Linux Statistics 2025: Desktop, Server, Cloud & Community Trends
    Aug 3, 2025 · SELinux and AppArmor are actively enforced in 55.6% of enterprise Linux environments. Kernel live patching usage rose to 31.5%, reducing server ...
  72. [72]
    SELinux on Red Hat Enterprise Linux and Rocky Linux
    Security Enhanced Linux (SELinux) is enabled and set to enforcing mode for AppStream 2.0 image builders and streaming instances powered by Red Hat Enterprise ...
  73. [73]
    Security considerations for Red Hat Enterprise Linux on Azure
    Jul 29, 2024 · All Red Hat-produced images and installations can run SELinux in enforcing mode by default. When you design workload deployments, you can run ...
  74. [74]
    20.4. Configuration Examples | Red Hat Enterprise Linux | 7
    This example explains how to change the location of a MariaDB database and then how to label the new location so that SELinux can still provide its protection ...
  75. [75]
    Chapter 6. Docker SELinux Security Policy - Red Hat Documentation
    The Docker SELinux policy, based on libvirt, isolates containers by denying access to each other's resources and using unique categories. MCS provides  ...Missing: pod | Show results with:pod
  76. [76]
    Configure a Security Context for a Pod or Container - Kubernetes
    A security context defines privilege and access control settings for a Pod or Container, including SELinux, running as privileged, and Linux Capabilities.Seccomp · AppArmor · Configuring RunAsUserName · Discretionary Access ControlMissing: format | Show results with:format
  77. [77]
    Camera version support | Android Open Source Project
    Oct 9, 2025 · Update SELinux policies for cameraserver. If device-specific SELinux policies give mediaserver permissions to run the camera, you must update ...Missing: media_t | Show results with:media_t
  78. [78]
    Technologies for container isolation: A comparison of AppArmor and ...
    Sep 22, 2020 · MLS/MCS capabilities is a big difference between AppArmor and SELinux. With AppArmor, it's not possible to keep separation between containers.
  79. [79]
    AppArmor vs. SELinux: Comprehensive Comparison - phoenixNAP
    Nov 2, 2022 · AppArmor grants access first, then restricts, while SELinux restricts by default. AppArmor is simpler, while SELinux is more secure but complex.
  80. [80]
    Compare two Linux security modules: SELinux vs. AppArmor
    Jun 6, 2023 · SELinux offers more control and uses file labels, while AppArmor is easier to use, uses paths, and is often considered safer. SELinux is more ...
  81. [81]
    Securing Linux: Steady Momentum in AppArmor and SELinux Uptake
    Jul 24, 2025 · In recent times, two critical Linux security frameworks, AppArmor and SELinux, have seen noteworthy acceleration in real-world deployment.
  82. [82]
    LSM stacking (again) - LWN.net
    Jun 23, 2010 · So we can specify: "First use AppArmor to check filesystem access, but use SeLinux to check security labels on network packets". LSM stacking ...
  83. [83]
    A Case Study Comparing Linux Security Kernel Enhancements
    We determine that SELinux has a stronger MAC implementation, while grsecurity is simpler to use and offers other exclusive features, such as address space ...
  84. [84]
    Compare - grsecurity
    Jul 5, 2018 · "Which is better, grsecurity or SELinux?" ; Prevents auto-loading of vulnerable kernel modules by unprivileged users. (dependent on policy).Missing: PaX | Show results with:PaX
  85. [85]
    A Brief Tour of Linux Security Modules - Star Lab Software
    Nov 21, 2019 · Unlike SELinux, SMACK was designed for embedded systems and to be simpler to administer. SMACK is the default MAC implementation in Automotive ...
  86. [86]
    Smack for simplified access control - LWN.net
    Aug 8, 2007 · Smack is geared towards solving smaller security problems than SELinux, requiring much less configuration and very little application support.
  87. [87]
    A Comparative Overview of SELinux, AppArmor, Yama, TOMOYO ...
    May 19, 2023 · Let's explore five popular LSMs: SELinux, AppArmor, Yama, TOMOYO Linux, and Smack. Each of these modules offers unique features and approaches.
  88. [88]
  89. [89]
    Landlock LSM: Unprivileged sandboxing - LWN.net
    Sep 14, 2016 · This kind of map can be passed to Landlock eBPF functions to compare, for example, with a file access request. The handles are only ...
  90. [90]
    9.0 Release Notes | Red Hat Enterprise Linux | 9
    The SELinux policy includes new permissions, classes, and capabilities that are also part of the kernel. Therefore, SELinux can utilize the full potential ...
  91. [91]
    Kubernetes 1.27: Efficient SELinux volume relabeling (Beta)
    Apr 18, 2023 · Kubernetes 1.27 allows direct mounting of volumes with SELinux labels, avoiding recursive relabeling, if certain conditions are met, such as ...
  92. [92]
    kubernetes-sigs/aws-ebs-csi-driver - Add SELinux mounts - GitHub
    Mar 23, 2023 · The approach is to make the driver "SELinux aware" and then set the mount context in mountOptions to specify the label rather than enumerate and ...
  93. [93]
    Add SELinux support - WEKA documentation
    Aug 26, 2025 · Install and configure the WEKA CSI Plugin. To label volumes correctly, install the WEKA CSI Plugin in an SELinux-compatible mode. To do that ...
  94. [94]
    SELinux and RHEL: A technical exploration of security hardening
    Feb 10, 2025 · Use sestatus to display information including the current SELinux status (enabled or disabled) and mode (enforcing or permissive). For example:
  95. [95]
    RHBA-2025:7442 - Bug Fix Advisory - Red Hat Customer Portal
    May 13, 2025 · An update for selinux-policy is now available for Red Hat Enterprise Linux 9. Description. The selinux-policy packages contain the rules that ...Missing: 33 2023-2025
  96. [96]
    How custom SELinux policies secure servers and containers
    Oct 10, 2023 · This article demonstrates the creation and deployment of custom SELinux policies across server fleets and containerized environments.
  97. [97]
    How to Use SELinux SETroubleShoot on AlmaLinux - Siberoloji
    Jan 7, 2025 · SELinux SETroubleShoot is a diagnostic tool designed to simplify SELinux troubleshooting. It translates cryptic SELinux audit logs into human-readable messages.
  98. [98]
    Chapter 7. Security Profiles Operator | OpenShift Container Platform
    For SELinux profiles, the namespace must be labelled to allow privileged workloads. ... In addition, the namespace must be labeled with pod-security.kubernetes ...
  99. [99]
    Cloud Native Computing Foundation Announces Graduation of CRI-O
    Jul 19, 2023 · Its support of various security tools like selinux and seccomp enable CRI-O to run workloads in the least privileged mode is critical for ...
  100. [100]
    Chapter 4. New features | Red Hat Enterprise Linux | 9
    Starting with RHEL 9 Beta, kernels are signed with trusted SecureBoot certificates, hence users no longer need to enroll a separate Beta public key to use the ...Chapter 4. New Features · Making Open Source More... · About Red Hat
  101. [101]
    Build SELinux policy | Android Open Source Project
    Oct 9, 2025 · Starting March 27, 2025, we recommend using android-latest-release instead of aosp-main to build and contribute to AOSP. For more information, ...Missing: maintenance | Show results with:maintenance
  102. [102]
    Write SELinux policy - Android Open Source Project
    This article focuses on these device-specific customizations, how to write device-specific policy, and some of the pitfalls to avoid along the way.Missing: media_t | Show results with:media_t
  103. [103]
    [KCD UK 2024] Deep Dive into Kubernetes Runtime Security
    Aug 8, 2025 · BPF-LSM, a newer option, allows dynamic policy injection via eBPF code, offering flexibility without requiring application restarts. Saeid ...