SELinux
SELinux is a Linux kernel security system that labels processes and resources, then applies mandatory policy to decide which interactions are allowed. It limits what a process can do even when ordinary Unix permissions would allow more.
itLinux | OpenSkills.info
Course pathWalk it in order
Look it upDip in anytime
Go furtherLeaves this page
Don't Panic
Don't Panic — SELinux
SELinux is a label-based mandatory access control system in the Linux kernel. It decides whether a process may perform a specific operation on a specific resource, and it does this even when ordinary Unix permissions would say yes. It is not an antivirus, not a firewall, and not a replacement for file ownership — it is a second gate that opens only when the policy says the source and target are allowed to talk.
The problem it exists to solve is straightforward: a web server process runs as a single Unix identity that can read many files. If that server is compromised, the attacker inherits the same broad access. Before SELinux, the only way to narrow that access was application-level sandboxing or chroot, both of which are fragile. SELinux gives the kernel a policy that confines each service to exactly the types of resources and operations it actually needs.
Three ideas carry everything else. First, labels. Every process has a type — called a domain — and every file, socket, and port carries a type label. The kernel compares these labels against the loaded policy to decide each access. Second, deny by default. An operation needs an explicit allow rule; if no rule matches, the kernel denies it. Third, the Access Vector Cache, or AVC, stores recent decisions so the same policy lookup does not repeat on every system call.
The surprise for most newcomers is that labels are stored as extended attributes on files, not derived from paths. Moving a file can preserve a label that does not fit its new location, and the kernel will still enforce the old policy relationship. The practical lesson: check matchpathcon before writing policy, because the current label might simply be wrong rather than evidence that a new rule is needed.
Start with the Intro for the full access-decision flow and the glossary. Slides compress the relationships into a visual map. Cheatsheet is the command reference you will reach for during diagnosis. Field Notes covers where the operational costs hide. The quiz checks the distinctions that trip up every team.
Where this skill leads
Relevant careers
See how this topic contributes to broader role-level skill maps.
Sources
- https://selinuxproject.org/
Supports
- Upstream project identity, maintained components, and community resources
- Official URL and reference-study entry
- https://github.com/SELinuxProject/selinux-notebook
Supports
- SELinux architecture, security contexts, type enforcement, classes, and permissions
- Policy language, transitions, users, roles, MLS, and MCS concepts
- Reference link rationale
- https://docs.kernel.org/admin-guide/LSM/SELinux.html
Supports
- SELinux as a Linux Security Module
- Kernel configuration, boot controls, enforcement, and policy loading
- Kernel administration link rationale
- https://docs.redhat.com/en/documentation/red_hat_enterprise_linux/9/html-single/using_selinux/using_selinux
Supports
- MAC and DAC decision order, security-context fields, types, and domains
- Enforcing, permissive, and disabled states
- Targeted and MLS policy behavior
- Context inspection, persistent file contexts, restorecon, ports, and booleans
- AVC diagnosis, sealert, audit2allow review, custom modules, and automation
- Quiz answers and RHEL Landscape placement
- https://docs.oracle.com/en-us/iaas/oracle-linux/selinux/selinux-about-administering-selinux-in.htm
Supports
- Oracle Linux SELinux integration and mandatory-access decision flow
- Oracle Linux Landscape placement
- https://docs.oracle.com/en-us/iaas/oracle-linux/selinux/selinux-administering-selinux-policies.htm
Supports
- Targeted and MLS policy distinctions
- SELinux boolean administration on Oracle Linux
- https://source.android.com/docs/security/features/selinux
Supports
- Android use of SELinux for mandatory access control over all processes
- Permissive Android 4.3, partial enforcement in Android 4.4, and full enforcement in Android 5.0
- Per-domain permissive mode and Android Landscape placement
- https://source.android.com/docs/security/features/selinux/build
Supports
- Monolithic Android policy through 7.0
- Separate platform and vendor policy in Android 8.0
- Advanced reference-link rationale
- https://github.com/SELinuxProject/refpolicy/wiki
Supports
- Reference Policy organization, interfaces, and contribution documentation
- Reference-link rationale
- https://github.com/SELinuxProject/setools
Supports
- SETools as SELinux policy analysis tools
- Policy query, inspection, and comparison study path
- https://github.com/sindresorhus/awesome
Supports
- Starting index used for required awesome-list discovery
- https://github.com/wandapeter/awesome-fedora-security
Supports
- Discovery of Fedora SELinux Policy and RHEL 9 CIS automation role
- Archived status considered during curation
- https://github.com/fedora-selinux/selinux-policy
Supports
- Fedora distribution SELinux policy project and Awesome Links rationale
- Fedora Landscape placement
- https://github.com/ansible-lockdown/RHEL9-CIS
Supports
- RHEL 9 CIS automation role and SELinux hardening controls
- Awesome Links rationale
- https://www.nsa.gov/Research/NSA-Mission-Oriented-Research/LACR/
Supports
- SELinux open-source release on 2000-12-22
- SE for Android release in 2012 and Android 4.3 adoption in 2013
- https://www.nsa.gov/portals/75/documents/resources/everyone/digital-media-center/publications/research-papers/implementing-selinux-as-linux-security-module-report.pdf
Supports
- SELinux port to the Linux Security Modules framework
- Technical development between the original patch and mainline integration
- https://www.kernel.org/doc/mirror/ols2008v2.pdf
Supports
- Mainline merge for Linux 2.6 in December 2003
- Fedora Core 2 integration and release in May 2004
- https://source.android.com/docs/compatibility/4.3/android-4.3-cdd
Supports
- Android 4.3 SELinux support and permissive reference implementation
- https://source.android.com/docs/security/enhancements
Supports
- Android 4.4 SELinux enforcement for selected domains
- https://www.redhat.com/en/technologies/linux-platforms/enterprise-linux
Supports
- Red Hat Enterprise Linux product homepage and Landscape entry
- https://fedoraproject.org/
Supports
- Fedora product homepage and Landscape entry
- https://www.oracle.com/linux/
Supports
- Oracle Linux product homepage and Landscape entry
- https://www.android.com/
Supports
- Android product homepage and Landscape entry
- https://www.centos.org/centos-stream/
Supports
- CentOS Stream product homepage and Landscape entry
