The finale: comparing SELinux with AppArmor, Smack, TOMOYO, seccomp, and capabilities; when to choose SELinux; a recap of the 23-episode journey; a production checklist; and learning resources to go further.

After seeing SELinux's future in episode 21 — userspace 3.11 and the 3.12 roadmap — the finale has arrived. We won't add new tools; we'll place SELinux in its proper place within the broader Linux security ecosystem, compare it with real alternatives, recap the whole journey from episode 0 to 21, and close with a production checklist and a map for further learning. This is the final map of this 23-episode series.
Before comparing, one important framework. Linux has two layers of access control:
An analogy we often use: DAC is like a house with one key the owner can copy; MAC is like a building with access cards managed by one central authority — even if the room owner sticks a card on the door, the security guard still holds the list of who's allowed in. SELinux is one implementation of MAC; others are AppArmor, Smack, and TOMOYO, all living under the LSM (Linux Security Module) framework.
| Mechanism | Rule Basis | Learning Curve | Main Strength | Common Users |
|---|---|---|---|---|
| SELinux | Labels + Type Enforcement | Steep | Most detailed and flexible | RHEL, Fedora, their derivatives |
| AppArmor | Path-based profiles | Gentle | Fast to confine one application | Ubuntu, Debian, SUSE |
| Smack | Simple labels | Gentle | Lightweight, good for embedded | Industrial and IoT systems |
| TOMOYO | Path + capability | Gentle | Has automatic learning mode | Systems needing quick setup |
A short explanation of each:
/usr/bin/myapp may read /etc/config, nothing else". Because it attaches to paths, it's very easy to understand, but its rules are less expressive than SELinux labels and can be "bypassed" if a file is renamed or hardlinked without the profile knowing.It must be stressed: this comparison isn't about "who's best", but "what conditions are you dealing with". The technical details and limits of each can be dug up from each project's official documentation.
Beyond LSM, there are two mechanisms often mistaken for SELinux replacements:
CAP_NET_BIND_SERVICE, CAP_DAC_OVERRIDE, and so on). They limit what root can do, but don't provide label-based access control. Think of them as an employee permission list, not a room map.Neither is a "SELinux replacement" — they layer with it. The safest scenario uses all three at once: SELinux confines object access, capabilities trim root rights, and seccomp blocks dangerous syscalls.
With all those options, when is SELinux the right answer?
If your need is just "confine one app by tomorrow afternoon" on Ubuntu, AppArmor is an honest and good choice. There's no mandate to use SELinux everywhere — the right decision is the one that fits the context.
The twenty-two episodes before this were built in layers, much like the SELinux policy itself. Here's a short map:
| Range | Theme | Core Content |
|---|---|---|
| 0–3 | Foundations | Setup, history, MAC concepts, modes, and basic troubleshooting |
| 4–7 | Basic Policy | Labeling, domains and types, booleans, audit2allow |
| 8–12 | Services & Virtualization | Users/roles/MLS, web server, containers, NFS/Samba, virtualization |
| 13–17 | Networking & Observability | Port/socket labeling, hardening, audit, selinuxfs, CIL |
| 18–21 | Production & Direction | Performance, sandbox, policy-as-code, the 3.11 release |
Notice the pattern repeated throughout the series: always start from observation (what's denied), then narrow the change (allow as little as possible), then verify (denials gone, service still running). That pattern is the most valuable skill you take out of this series — far more valuable than memorized commands.
Before considering a system "done", run this checklist:
| Item | Description |
|---|---|
| Enforcing mode | getenforce must be Enforcing, except during planned recovery |
| Audit monitored | auditd active, logs shipped to a SIEM or aggregator, alarms for unusual denials |
| Minimal booleans | The number of changed booleans is small and documented |
| Correct contexts | restorecon -Rv on service directories; no suspicious unlabeled_t |
| Versioned modules | All custom modules in git, versioned .pp artifacts in CI (episode 20) |
| Regular upgrades | Userspace 3.11 and up, kernel following distro updates (episode 21) |
| Recovery plan | Written procedure for temporary permissive and full relabel |
Check status with getenforce, list modules with semodule -l, and trace denials with aureport. A quick verification you can run right now:
sestatus && semodule -l | grep -E "^(myapp|sandbox)"aureport -a --start today --summaryNote
This checklist isn't a judgment tool, but an improvement tool — exactly as we emphasized in the other series. No system is born perfect; what exists is a system maintained toward perfection. Run this checklist periodically (a quarterly rhythm is reasonable), mark what hasn't passed, and make a plan to close the gaps.
Your SELinux journey doesn't stop at episode 22. Here are the resources we recommend to go deeper:
seinfo, sesearch, and sedta for analyzing policy; also Python libraries for automation.man selinux, man semanage, man semodule, man restorecon are the most accurate and closest references.And here's the end point. Over 23 episodes — from episode 0 to 22 — you've built an understanding of SELinux from zero: why MAC is needed, how contexts and type enforcement work, how to write modules, manage booleans and ports, read denials from the audit log, keep performance healthy, confine programs with a sandbox, automate the policy as code, follow the 3.11 release, and now place SELinux in the broader ecosystem. That's a complete journey — not just a collection of commands, but a way of thinking.
Let's close with the three most important messages.
First, SELinux is a tool, not a goal. It answers the question "who may access what" in a strict, consistent, auditable way. On the right systems (RHEL family, multi-tenant, regulated) it's a real advantage; elsewhere, an honest alternative like AppArmor can be the more sensible choice. True expertise is choosing and using the tool that fits the context.
Second, security is built from observation and iteration, not boldness. The whole series taught one pattern: see the denial, understand it, allow as little as possible, verify. No denial was ever "fixed without being read" — and that pattern is what will save you in production, again and again.
Third, keep practicing. A healthy SELinux policy is one that's tested and maintained, not written once and forgotten. Build a lab, simulate incidents, test rollbacks, and update the userspace regularly. These skills are rare and highly valuable — in the DevOps, SRE, and infrastructure security world, an admin who understands MAC is an irreplaceable asset.
Thank you for following this series to the end. You now have a complete map to not just understand SELinux, but manage it with confidence. Build something secure, write down what you learn, and share it back to the community. See you in the next learning series — and happy building as a Linux security practitioner!