Pcornel
Browse topics
Options
Recent
Favorites
Security · Technical reference

SELinux

Direct answer

SELinux is a Linux Security Module implementing label-based mandatory access control with subject domains, object types, roles, booleans, transitions and policy decisions layered after ordinary discretionary permissions.

When to use this

Use it when configuring, checking or troubleshooting SELinux in Linux Security.

First 30 seconds

1. SELinux enforces MAC with type enforcement.

2. Keep Enforcing.

3. Fix labels (restorecon) and booleans (setsebool) rather than disabling.

4. audit2allow carefully for custom apps.

5. Check AVC denials.

Operational verification

process domain + object type → policy → allow/deny

Context & applicabilityCommon mistakes · platform/version boundaries
Common mistakes
Common traps

An AVC denial shows SELinux blocked a labeled operation, but it does not show malicious intent, correct labeling elsewhere or that disabling SELinux is the right fix.

Suspicious evidence: permissive mode, mislabeled files, temporary label change, broad custom allow, boolean misuse, policy module drift, audit loss or denial treated as root cause without DAC/app check.

Platform / version applicability
Platform and workload security
applies
Structured applicability is explicit Topic metadata; it does not infer compatibility beyond the stored rows.
At a glance

Operational reference

Fast context before you go deeper.

PlatformPlatform and workload security
Scope / prerequisiteUse it when configuring, checking or troubleshooting SELinux in Linux Security.
What next?3 suggested next steps
Evidence1
On this pageJump to a specific section
Operational workflow

Verification & Troubleshooting

Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.

1 steps Observe → verify → isolate → change minimally → repeat the original test.
ObservedRecord what the original test actually shows

Capture the concrete output, symptom, packet, log or counter before changing anything.

Step 1 Verification path Verify boundary

process domain and object context → DAC/capability checks → SELinux policy/AVC decision → allow/deny → audit event → application outcome → label/policy remediation

Evidence references

Evidence · 1 on this Topic

Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.

observation · 1
Key points
  • SELinux enabled ≠ enforcing mode with correct loaded policy.
  • DAC allow ≠ SELinux allow; SELinux allow ≠ DAC allow.
  • Configuration file present ≠ parsed, loaded and effective runtime state.
  • One allow/deny result ≠ complete DAC, privilege, LSM, firewall and application outcome.
Key checks
  • getenforce; sestatus — mode
  • ausearch -m AVC -ts recent — denials
  • semanage port -l | grep http — port labels
ReferenceImportant terms & boundaries2 sections · depth on demand

What this shows and what it does not

An AVC denial shows SELinux blocked a labeled operation, but it does not show malicious intent, correct labeling elsewhere or that disabling SELinux is the right fix.

In depth

SELinux (Security-Enhanced Linux) enforces mandatory access control: every process and file has a security context, and policy decides which interactions are allowed — regardless of standard file permissions or even root. A compromised web server confined by SELinux cannot read home directories or SSH keys.

getenforce                              # Enforcing / Permissive / Disabled
ls -Z /var/www/html
ps -eZ | grep httpd
ausearch -m AVC -ts recent | audit2why  # why was something denied?
semanage fcontext -a -t httpd_sys_content_t '/srv/web(/.*)?'
restorecon -Rv /srv/web
setsebool -P httpd_can_network_connect on

Keep SELinux enforcing (default on RHEL family). Most denials come from files in non-standard locations with wrong labels — fix labels or booleans instead of disabling SELinux.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.
ReferenceConfiguration & state1 section · depth on demand

Commands

getenforce                         # Enforcing / Permissive / Disabled
ls -Z /var/www/html ; ps -eZ | grep httpd
ausearch -m avc -ts recent         # denials
sealert -a /var/log/audit/audit.log
semanage fcontext -a -t httpd_sys_content_t "/srv/web(/.*)?" ; restorecon -Rv /srv/web
setsebool -P httpd_can_network_connect on

Documented example, not captured output. Fix labels or booleans instead of disabling SELinux; audit2allow creates custom policy as a last resort.

Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Technical verification history

Verification history & basis

When and against what this Topic was checked. Later text edits do not count as a new check.

2026-09-14 · vendor docPlatform and workload security current

Authoritative/upstream documentation reviewed for bounded claims in Linux Security → SELinux. Documentation verification only; this is not observed lab or production Evidence.

Basis: https://docs.kernel.org/security/ · confidence 94%
Terminology layer

Terms & aliases

Hover a linked term for a quick definition; click it to open its glossary entry. Aliases are other names that find this Topic in search.

Aliases that resolve here
Security-Enhanced LinuxSELinux MACSELinux policy
Embedded reference data

Quick lookup tables

Linux Security → SELinux proof map

Fast scope, effective-state, runtime-evidence and closure boundaries for Linux Security → SELinux.

BoundaryEstablishDoes not establish
ScopeExact host, role, build/kernel, identity, workload and expected controlDoes not prove policy receipt or effective runtime state
Effective stateResultant/loaded policy, precedence, mode, labels/rules/keys and active services/kernel controlsConfiguration presence does not prove enforcement
Runtime evidenceCorrelated events/audit, process/token/credential, packet/syscall and workload resultOne event, clean status or allow/deny does not prove complete security
ClosureOriginal allowed/denied workload works, unsafe state is removed and recovery/regression passCommit, restart, block or compliance result alone is not closure
Confirmation

Confirm action

Continue?