Use it when a program fails on Ubuntu/Debian and AppArmor is suspected.
AppArmor Troubleshooting
AppArmor troubleshooting finds the DENIED message, identifies profile, operation and path, and adds the smallest rule or fixes the program's paths.
1. journalctl -k --since '10 min ago' | grep DENIED.
2. Profile and path in the message.
3. Add the rule in /etc/apparmor.d/local/<profile>.
4. apparmor_parser -r the profile.
5. Retest.
failure → DENIED message → rule added locally → profile reloaded → works in enforce
For AppArmor → AppArmor Troubleshooting, continue with the first unproven Topic check: Record exact host, distribution/kernel, boot ID, time window, workload, identity and the authoritative configuration/policy source for AppArmor Troubleshooting. If that boundary is healthy, advance to the adjacent check: Read back the effective runtime state and precedence rather than assuming an edited file, package state or service status is active. Preserve the same host/time/identity scope and rerun the original workload before accepting recovery.
Continue only after interpreting the current observation.Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
journalctl -k | grep -i 'apparmor="DENIED"'Verification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 Operational evidence path Verify boundary
symptom/time → verify profile attachment/mode → correlate DENIED event/path/operation → inspect includes/transitions → minimal rule change → reload → enforcing retest → regression
Healthy evidence: denials correlate with the failing operation, attachment/mode are known, minimal rule changes load correctly and enforcing-mode workload tests pass
Step 2 Verification and output interpretation Verify boundary
Verification chain. symptom/time → verify profile attachment/mode → correlate DENIED event/path/operation → inspect includes/transitions → minimal rule change → reload → enforcing retest → regression
Step 3 Commands Verify boundary
journalctl -k | grep -i 'apparmor="DENIED"'
aa-logprof
aa-status
Step 4 Failure modes and next checks Narrow the fault
Suspicious evidence: wrong log window, stale profile source, path alias/namespace confusion, broad wildcard fixes, profile disablement or an unrelated DAC/service failure is mistaken for AppArmor
Step 5 Common mistakes Narrow the fault
- Disabling AppArmor instead of updating the profile.
Evidence · 1 on this Topic
Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.
Look for apparmor="DENIED" with profile, operation and name. Custom data directories often need a local rule. Do not disable the profile globally.
aa-status— loaded profiles and modesjournalctl -k | grep -i apparmor— denialsaa-complain / aa-enforce <profile>— change a profile's modeapparmor_parser -r <profile>— reload a profile
ReferenceImportant terms & boundaries5 sections · depth on demand
What this shows and what it does not
Troubleshooting is resolved when the first AppArmor boundary is confirmed, fixed minimally and the original workload succeeds under intended enforcement without broad exemptions.
In depth
Is AppArmor the cause?
$ sudo aa-status
apparmor module is loaded.
42 profiles are loaded.
38 profiles are in enforce mode.
/usr/sbin/nginx
...
$ sudo journalctl -k --since -10min | grep 'apparmor="DENIED"'
audit: type=1400 audit(1764238891.412:213): apparmor="DENIED" operation="open" profile="/usr/sbin/nginx" name="/srv/www/site/index.html" pid=2211 comm="nginx" requested_mask="r" denied_mask="r" fsuid=33 ouid=1000
Ubuntu's AppArmor guide shows aa-status for loaded profiles and explains that blocked actions log apparmor="DENIED" in the kernel log, naming the operation, profile and target — and that explicit deny rules may not log at all.
| Field | Meaning |
|---|---|
profile | Which profile decided |
operation | open, exec, mknod, connect, capable, … |
name | Path or object accessed |
requested_mask / denied_mask | r, w, x, m (mmap), k (lock) … |
Fix by changing the profile, not by disabling AppArmor
# local additions survive package updates
echo '/srv/www/** r,' | sudo tee -a /etc/apparmor.d/local/usr.sbin.nginx
sudo apparmor_parser -r /etc/apparmor.d/usr.sbin.nginx
| Tool | Use |
|---|---|
aa-complain <profile> | Log but allow — for testing a profile |
aa-enforce <profile> | Back to blocking |
aa-logprof | Suggest rules from logged denials (review each one) |
apparmor_parser -r | Reload after editing |
Confirm the fix
1. Put the profile back in enforce mode.
2. Repeat the action and check there is no new DENIED line.
3. Keep the rule as narrow as the path really needs (/srv/www/ r, rather than / rw,).
Containers and snaps
Docker applies docker-default to containers; denials name that profile. Snaps have their own generated profiles (snap.<name>.*); use snap interfaces (snap connect) instead of editing them.
*The profile counts and AppArmor denial record are constructed examples of mandatory access control diagnostics.*
How it works at runtime
AppArmor Troubleshooting is part of AppArmor → AppArmor Troubleshooting. AppArmor Troubleshooting determines whether a failure comes from profile attachment, mode, path resolution, abstraction/include, execution transition or a specific denied rule by correlating logs with the real operation.
Topic-specific state model. AppArmor Troubleshooting determines whether a failure comes from profile attachment, mode, path resolution, abstraction/include, execution transition or a specific denied rule by correlating logs with the real operation.
Interpretation rule. - An AppArmor denial near the incident ≠ automatic root cause.
- Turning the profile off and seeing success ≠ a safe or sufficiently diagnosed fix.
Method
AppArmor troubleshooting:
| Symptom | Check |
|---|---|
| Service fails after moving data/config | Denials for the new path; add rule or local/ override |
| Profile not loaded after edit | apparmor_parser -r <file>, syntax errors in journalctl -u apparmor |
| Container cannot mount/access | Docker docker-default profile; --security-opt apparmor=… |
| Snap app blocked | Snap interfaces (snap connections <app>) |
aa-status
dmesg | grep -i apparmor | tail
aa-unconfined --paranoid # network processes without profiles
Limits and how it fails
Primary failure point. Troubleshooting is resolved when the first AppArmor boundary is confirmed, fixed minimally and the original workload succeeds under intended enforcement without broad exemptions.
ReferenceConfiguration & state1 section · depth on demand
Configuration, persistence and lifecycle
Distribution/platform context. AppArmor Troubleshooting owns symptom-to-profile isolation; hand off to permissions, service or application branches when the first failure is elsewhere.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in AppArmor → AppArmor Troubleshooting. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://gitlab.com/apparmor/apparmor/-/wikis/Documentation · confidence 94%What changed and what may be affected
Recent technical edits are separated from ordinary page timestamps. Relationship impact is advisory: it identifies nearby canonical references to review, not automatic breakage.
Terms & aliases
Hover a linked term for a quick definition; click it to open its glossary entry. Aliases are other names that find this Topic in search.
Quick lookup tables
AppArmor Troubleshooting operational reference
Topic-specific lookup boundaries, proof limits and next-step Evidence for AppArmor Troubleshooting.
| Lookup boundary | Topic-specific reference | Operational use |
|---|---|---|
| Scope / effective state | AppArmor Troubleshooting determines whether a failure comes from profile attachment, mode, path resolution, abstraction/include, execution transition or a specific denied rule by correlating logs with the real operation. | Establish exactly what this Topic owns before crossing into another subsystem. |
| Fast verification | Pin host + boot/time + real identity/workload → identify authoritative policy/key/trust source → read back loaded/effective runtime state → reproduce one safe allow/deny/handshake test → correlate audit/service/kernel evidence → locate first failed boundary → make the smallest persistent change → repeat original workload + regression/recovery check. | Use the shortest evidence path first; a fast check is a boundary test, not blanket proof. |
| Verification chain | symptom/time → verify profile attachment/mode → correlate DENIED event/path/operation → inspect includes/transitions → minimal rule change → reload → enforcing retest → regression | Trace requested/configured state through effective state to the observed workload result. |
| Failure boundary | Troubleshooting closes when the first AppArmor boundary is proven, fixed minimally and the original workload succeeds under intended enforcement without broad exemptions. | Stop broad troubleshooting at the first boundary that is not supported by evidence. |
| Positive evidence | Correlated Linux security/trust evidence can establish this proof path: symptom/time → verify profile attachment/mode → correlate DENIED event/path/operation → inspect includes/transitions → minimal rule change → reload → enforcing retest → regression | Use this observation only for the specific claim it actually supports. |
| Evidence limit | It does not independently prove unobserved identities, objects, policies, namespaces, endpoints or time periods. Troubleshooting closes when the first AppArmor boundary is proven, fixed minimally and the original workload succeeds under intended enforcement without broad exemptions. | Do not promote a local success signal into end-to-end or adjacent-dependency proof. |
| Next troubleshooting check | Continue from the first unproven security/trust boundary, capture the adjacent effective state and audit/handshake evidence, make only the demonstrated persistent change, then repeat the original workload plus recovery/regression checks. | Continue to the next unresolved boundary while preserving the original test condition. |
AppArmor Troubleshooting · operational reference
Compact Linux state, persistence, verification and boundary reference for fast lookup.
| Reference boundary | AppArmor Troubleshooting |
|---|---|
| Topic path | AppArmor → AppArmor Troubleshooting |
| Runtime state | AppArmor Troubleshooting determines whether a failure comes from profile attachment, mode, path resolution, abstraction/include, execution transition or a specific denied rule by correlating logs with the real operation. |
| Fast checks | - Record exact host, distribution/kernel, boot ID, time window, workload, identity and the authoritative configuration/policy source for AppArmor Troubleshooting. - Read back the effective runtime state and precedence rather than assuming an edited file, package state or service status is active. - Reproduce one safe allowed/denied or handshake/access test and correlate kernel/service/audit evidence at the first relevant boundary. - Apply the smallest persistent cause-specific change, then repeat the original test plus an adjacent regression/recovery check. |
| Verification chain | symptom/time → verify profile attachment/mode → correlate DENIED event/path/operation → inspect includes/transitions → minimal rule change → reload → enforcing retest → regression Boundary chain: local authoritative state → adjacent dependency → effective/programmed state → original workload/request → return/regression → explicit Evidence boundary. Boundary chain: local authoritative state → adjacent dependency → effective/programmed state → original workload/request → return path or regression → explicit Evidence boundary. |
| Failure boundary | Troubleshooting closes when the first AppArmor boundary is proven, fixed minimally and the original workload succeeds under intended enforcement without broad exemptions. Boundary chain: process credentials/namespace → path/mount lookup → DAC/ACL/LSM → filesystem metadata → block/device/backend → completion/read-back. |
| Persistence rule | Prove which configuration source owns the state, then prove that the running consumer loaded or generated the intended state. |