Join our Newsletter — 33% off our NHI Course
Home› Glossary› Architecture & Implementation› SELinux or AppArmor
Architecture & Implementation

SELinux or AppArmor

← Back to Glossary
By NHI Mgmt Group Updated November 26, 2026 Domain: Architecture & Implementation

SELinux or AppArmor are Linux mandatory access control modules that confine each process to the files, capabilities and resources its policy allows, regardless of the user it runs as. SELinux uses labels; AppArmor uses path-based profiles. Keeping them enforcing limits damage from a compromised service; disabling them or leaving them in permissive or complain mode removes that containment.

What SELinux and AppArmor actually do

SELinux and AppArmor are both Linux mandatory access control systems, so they add a policy layer that limits what a process can do even if the process is running as root or has been compromised. That is why they are valuable for containing service-level compromise rather than merely controlling user logins.

They differ in policy model, but the security goal is the same: restrict file access, capabilities, and other kernel-mediated actions to the minimum allowed by policy. SELinux is label-based, while AppArmor is path-profile based, which changes how administrators write and reason about the rules.

How the two models contain damage

The practical value of mandatory access control is that the policy remains in force after a service is started, so the process cannot freely expand its reach just because it has a valid user context. That makes these modules especially useful for exposed daemons, container workloads, and software that must run with some privilege but should not have general system access.

SELinux usually offers finer-grained separation because labels can distinguish subjects and objects independently of filesystem paths, which is useful when paths move or are shared. AppArmor is often simpler to deploy because its path-based profiles are easier to read and tune, though that simplicity can make rule maintenance more dependent on stable paths and profile completeness.

What changes when they are not enforcing

When either module is disabled, permissive, or in complain mode, the system still records policy events but no longer blocks the denied action. That means the control no longer contains the blast radius of a compromised process, and a single application flaw can more easily lead to file tampering, privilege misuse, or unintended access to local resources.

Operationally, the gap is often not obvious until an incident or a test denial reveals that the policy was carrying real security weight. In other words, an application that appears to work in permissive mode may only be safe because the enforcement path has not yet been exercised.

Why administrators treat them as hardening controls

These modules are best understood as confinement controls, not as substitutes for secure code, patching, or least-privilege service design. They work alongside filesystem permissions, capabilities, and service sandboxing, but they add a separate decision point that can prevent a process from acting on resources it would otherwise reach through inherited permissions alone.

That is also why rollout usually needs careful testing: policy must be specific enough to confine the service without breaking legitimate behavior. The right mental model is containment first, convenience second, because the security value comes from denying unexpected paths rather than from making the service feel unrestricted.

Risk and Threat Considerations

Disabled or overly permissive MAC profiles create a clear exposure: a successful exploit inside one service can turn into broader host impact if the process can read sensitive files, modify configuration, or invoke kernel-mediated capabilities beyond its intended scope. The risk is not theoretical, because the control is designed to reduce exactly that post-compromise expansion.

Failure mechanism: Attackers first compromise an application, then use the process's existing privileges and ambient filesystem reach to pivot into other local assets, with no MAC enforcement to stop the escalation path.

Impact: The result can be configuration tampering, secret exposure, service persistence, lateral movement, or a larger host compromise than the application bug alone would have allowed.

Standards & Framework Alignment

This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.

NIST SP 800-53 Rev 5 and CIS Controls v8 set the governance and control requirements practitioners need to meet.

FrameworkControl / ReferenceRelevance
NIST SP 800-53 Rev 5AC-3 — Access EnforcementSELinux and AppArmor enforce access decisions on kernel-mediated actions.
SC-39 — Process IsolationThese modules confine processes to reduce the impact of compromise.
SI-4 — System MonitoringEnforcement and denials create signals that should be monitored for policy drift or abuse.
Recommendation — Use AC-3 to enforce mandatory access rules on processes and services. Apply SC-39 to isolate services and limit what a compromised process can reach. Monitor policy denials and drift as indicators of misuse or misconfiguration.
CIS Controls v8CIS-4 — Secure Configuration of Enterprise Assets and SoftwareSELinux and AppArmor are hardening controls that rely on secure configuration.
CIS-13 — Network Monitoring and DefensePolicy denials and containment events can support detection of suspicious service behavior.
Recommendation — Enable and maintain enforcing MAC profiles as part of secure baseline configuration. Feed enforcement and denial events into monitoring to spot abnormal process activity.

Practitioner Guidance

Why practitioners should care: Treat SELinux and AppArmor as production controls, not optional tuning knobs. If a service cannot run with enforcement enabled, that is a signal to fix policy, service design, or dependency assumptions rather than permanently weakening the control.

What to watch for: Repeated denials, broad allow rules, or a long-term drift into permissive or complain mode usually mean the policy is no longer doing meaningful containment. The useful operational question is whether the service is being constrained for real, not whether it merely starts cleanly.

Practitioner takeaway: The safest default is to keep the module enforcing and make policy adjustments deliberately, because the control only adds value when it is actively blocking the actions it is meant to contain.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

NHIMG Editorial Note
Reviewed and updated by the NHIMG editorial team on November 26, 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org