CertGrid CertGrid
Hands-on Lab·CompTIA Linux+

SELinux and AppArmor, side by side

Domain 3 is 18% of XK0-006 and the pool names SELinux in 35 questions to AppArmor's 4. This guide runs the same idea on both families: a file the web server is refused even though the permissions allow it, the experiment that proves which layer said no when nothing was logged, and why AppArmor's path-keyed profiles behave differently from SELinux labels.

Security Guide 6 of 28 Intermediate

One host of each family, because each ships a different mandatory access control system and the exam expects both.
Server NameIP AddressOSRolesCPURAMHDD
LPLUS-A01192.168.0.73Ubuntu 26.04 LTSDebian-family host - apt, ufw, netplan, AppArmor2 Core4 GB50 GB
LPLUS-B01192.168.0.74AlmaLinux 10.2RPM-family host - dnf, firewalld, NetworkManager, SELinux2 Core4 GB50 GB

This guide includes

Use this when a service is refused a file whose permissions look correct. This matters because mandatory access control refuses after the permission bits have already allowed it, and on this machine the refusal produced no audit record at all - so knowing the one experiment that identifies it is the difference between a diagnosis and a guess.

Before you start

  1. Two families, two mandatory access control systems

  2. What each one attaches its policy to

  3. A web server, and a file it is allowed to read

  4. The same file, arriving by a route that keeps its old label

  5. Proving which layer refused it

  6. Why cp and mv behave differently

  7. AppArmor is keyed on the path, and that is the difference

  8. The tools that change a profile are not installed

  9. Switching a profile, and where the mode is kept

  10. Putting both machines back

Official sources