Tracing why the world needs SELinux: the limitations of DAC that only restricts based on user and group, the birth of the SELinux project by NSA together with Red Hat, its integration into the Linux 2.6 kernel in 2003, and the modern userspace 3.11 ecosystem used today.

In episode 0, we set up the environment: installing SELinux userspace tools and verifying that the system runs in enforcing mode. In this episode, we'll take a break from the hands-on work and answer the most fundamental question: why does SELinux exist? Without understanding the problem it's trying to solve, you'll only memorize commands without ever understanding when and why those commands are needed.
We'll trace the birth of SELinux, understand the limitations of Linux's classic permission system (DAC), and see how Mandatory Access Control (MAC) changes the security rules of the game at the operating system level. As the saying goes, we need to understand the past so we don't repeat the same mistakes in the future.
Before SELinux was born, Linux relied on DAC (Discretionary Access Control) — the permission system you learned in episode 0: files have owners, and owners have the right to decide who can access them. This is called discretionary because the access decision is in the hands of the object's owner (the user), who can "grant" access to anyone at will.
The problem is that DAC has three fundamental weaknesses:
chmod rules don't apply to root. This is like giving one person the key to the whole building.The most fitting analogy: DAC is like a building door with an ID card. As long as you have a card (a valid user), you can enter any room whose door isn't locked — even rooms that have nothing to do with your job. A card in a criminal's hand works just as well.
From those limitations came the concept of MAC (Mandatory Access Control). Unlike DAC, which is "discretionary" (up to the owner), MAC is "mandatory": access rules are determined by a centralized policy, not by the object's owner. File owners cannot "grant" access beyond what the policy allows.
A key principle you must remember throughout this series:
With MAC, even root is restricted by the policy.
This is a huge leap. In the MAC world, every process and every object is given a security context label. The policy determines which process-label pairs may interact with which object-label pairs. Root is just another labeled process — if the policy doesn't allow it to access something, that access will be denied, even if its UID is zero.
To make the difference between these two worlds clearer, let's compare DAC and MAC side by side:
| Aspect | DAC (classic) | MAC (SELinux) |
|---|---|---|
| Access decider | Object owner (user) | Centralized policy |
| Decision basis | User and group | Context labels of processes and objects |
| Root | Not restricted | Restricted by policy |
| File owner | Free to change its permissions | Cannot grant access beyond the policy |
| Default principle | Open access unless locked | Closed unless allowed |
Consider one scenario to feel the difference. Imagine a web server exploited by an attacker: in the DAC world, the web server process runs as the user www-data — once the application is exploited, the attacker can read any file www-data can read, including application config files, database credentials, and even user data if the permissions are loose. In the MAC world, that process runs in a domain labeled httpd_t — the attacker stays trapped in that domain and can't touch files labeled passwd_t or shadow_t, no matter what the file permissions are. That's the power SELinux wants to bring to Linux: limiting the damage, not just preventing the attack.
Before going further, let's clear up some misconceptions that often make people afraid of SELinux:
chmod and chown.SELinux is a MAC implementation for Linux developed by the National Security Agency (NSA) in collaboration with Red Hat and the Linux community. The project started in the early 2000s, with the goal of bringing defense-agency-grade security (long applied in specialized operating systems) to mainstream Linux.
Its journey in brief:
| Year | Milestone |
|---|---|
| Early 2000s | NSA and Red Hat began developing SELinux as a joint project |
| 2003 | SELinux was integrated into the Linux 2.6 kernel — available for all distros |
| 2004–2005 | Red Hat Enterprise Linux enabled SELinux by default |
| ~2013 | SEAndroid brought SELinux to Android — now used by billions of devices |
Today, SELinux is enforcing by default on RHEL, Fedora, and CentOS. On Debian, the situation is the opposite — minimal and not default (they chose AppArmor). Android itself runs SEAndroid, a SELinux variant optimized for mobile devices — so the device in your pocket every day is actually already running this technology.
As an illustration, here's a log snippet that will become very familiar to you in the troubleshooting episodes later — an example of an AVC (Access Vector Cache) denial when a process is denied:
type=AVC msg=audit(1754256000.123:456): avc: denied { read } for pid=1234 comm="nginx" name="index.html" dev="sda1" ino=5678 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:user_home_t:s0 tclass=fileNotice the scontext part (subject/process context) and tcontext part (target/object context): a process labeled httpd_t was denied reading a file labeled user_home_t. This is the essence of MAC — it's not who the user is, but what labels are involved. We'll dissect every part of this log in episodes 2 and 3.
SELinux isn't just a kernel — it's a complete ecosystem that keeps evolving. By July 2026, the SELinux userspace reached version 3.11, with a set of modern tools you'll actually use every day:
semodule — manages policy modules: installs, removes, and disables modules.semanage — manages runtime configuration such as filesystem label mappings, ports, and users.audit2allow — reads denial logs and generates policy rules that allow access — a tool we'll dive into in the following episodes.These tools are what separate modern SELinux from its old image of being "hard and scary". With a mature userspace, managing SELinux policies today is far easier than ten years ago — and that's one of the reasons this series is worth learning from scratch.
chmod/firewall. The three work at different layers. You still need DAC, you still need a firewall — SELinux complements, not replaces.In this episode 1, we've traced why SELinux was born: the limitations of DAC that only restricts based on user and group, the MAC concept that restricts everyone — including root — based on a centralized policy and context labels, the development history of NSA together with Red Hat since the early 2000s, integration into the 2.6 kernel in 2003, and the modern userspace 3.11 ecosystem used today.
The essentials to take with you:
scontext and tcontext — not enemies, but data to be diagnosed.This understanding of the "why" becomes the foundation for understanding the "how" of how SELinux works. In the next episode 2, we'll discuss core concepts & main architecture — dissecting Type Enforcement, unpacking the user:role:type:sensitivity security context format, understanding the role of the AVC, and the kernel LSM structure and userspace tools that make up the entire system. Stay motivated, because this is where you start truly understanding how SELinux works from the inside!