Confine a Linux service with AppArmor profiles
8 steps · about 1 h 56 min · Intermediate
- Understand AppArmor as a Linux security module (reference, Linux kernel documentation, 8 min)
The kernel's own page on what AppArmor is and how it is enabled at boot.
- Check AppArmor status and profile modes on Ubuntu (article, Ubuntu Server documentation, 15 min)
Shows aa-status, profile locations and switching between complain and enforce.
- Enable AppArmor and load profiles on Debian (article, Debian Wiki, 12 min)
Covers installing the utilities, kernel parameters and loading extra profiles.
- Read the AppArmor profile language quickly (reference, AppArmor project wiki, 20 min)
A compact tour of file rules, permissions, capabilities and abstractions.
- Build a profile with the AppArmor tools (tutorial, AppArmor project wiki, 25 min)
The upstream walkthrough of generating a profile from observed behaviour.
- Generate a starting profile with aa-genprof (reference, Arch Linux manual pages, 8 min)
Explains the interactive loop of running the program and answering prompts.
- Refine a profile from denial logs with aa-logprof (reference, Arch Linux manual pages, 8 min)
Turns logged denials into rules so the profile can move to enforce mode.
- Look up profile syntax in apparmor.d (reference, Arch Linux manual pages, 20 min)
The full grammar reference for when a rule does not behave as expected.