Pcornel
Linux · AppArmor

Complain Mode

Cheat sheet · https://pcornel.dk/topic.php?topic=2864

Back to the Topic

Answer

In complain mode an AppArmor profile logs accesses its rules would deny, but allows them. It is used to learn and tune profiles.

Remember

Run the program through its normal tasks, then aa-logprof to turn logged events into rules. Return to enforce afterwards.

First checks

  • aa-status — loaded profiles and modes
  • journalctl -k | grep -i apparmor — denials
  • aa-complain / aa-enforce <profile> — change a profile's mode
  • apparmor_parser -r <profile> — reload a profile

Verify in this order

complain → accesses allowed and logged → rules learned → enforce

Where it usually breaks

First mismatch in identity/group resolution → Unix mode/ACL/capability → mount/sandbox constraint → SELinux/AppArmor policy → credential/TLS trust → protected operation; preserve identity/native diagnostic/pre-state before mutation.

Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=2864

Confirmation

Confirm action

Continue?