- SELinux enforcement modes (enforcing, permissive, disabled)
- File contexts (security labels)
- SELinux booleans
- SELinux port rules
- Troubleshooting and investigation techniques


- Reduced blast radius for compromised services
- Confinement of processes to only the resources they need
- Centralized, system-wide policy enforcement

- Which files a daemon may read/write (via file contexts)
- Which ports a service may bind
- Whether one process may send signals or trace another


Example: check current mode and detailed status
/etc/selinux/config and set SELINUX to one of enforcing, permissive, or disabled. Example:
/etc/selinux/config, reboot the system for persistent changes to take effect.
Controlling SELinux via kernel boot parameters
You can control SELinux at boot time using kernel arguments. Common kernel parameters:
selinux=0— disable SELinux entirely at kernel levelenforcing=0— start in permissive mode at bootenforcing=1— enforce at bootautorelabel=1— force a full filesystem relabel on next boot (useful after changing policies or contexts)
grubby to add or remove kernel arguments persistently:
selinux=0) removes a critical protection layer from the kernel. Prefer using permissive when diagnosing problems, then return to enforcing and fix the underlying configuration (contexts, booleans, or policy) rather than leaving the system permissive or disabled.
Keep SELinux enabled and in enforcing mode in production. Use permissive mode temporarily to collect denial logs, then fix the root cause — adjust file contexts, update booleans, or modify policy — instead of leaving the system permissive or disabled.
- Check audit logs: examine
/var/log/audit/audit.log(orjournalctlon systems forwarding logs) for AVC denials. - Use
ausearchandaudit2why/audit2allowto understand the denial and generate policy suggestions. - Verify file contexts with
ls -Zand correct them withrestorecon -Rvorsemanage fcontext -a -t <type> '<path>'followed byrestorecon. - Inspect SELinux booleans with
getsebool -aand toggle them withsetsebool -P <boolean> on|off. - Confirm port rules with
semanage port -land add custom port mappings if a service binds to a non-standard port.
- SELinux Project Wiki
- Red Hat SELinux Guide
- Audit utilities:
ausearch,audit2why,audit2allow
- SELinux adds Mandatory Access Control to the system by labeling processes and resources and enforcing policy-based access decisions.
- Use
getenforce,setenforce, andsestatusto inspect and control runtime mode. - Persist mode changes by editing
/etc/selinux/configor adjusting kernel boot arguments. - For troubleshooting, prefer
permissivetemporarily to gather logs, then remediate using context fixes, booleans, or targeted policy updates rather than disabling SELinux permanently.