Pcornel
Browse topics
Options
Recent
Favorites
Linux · Technical reference

AppArmor Troubleshooting

Direct answer

AppArmor troubleshooting finds the DENIED message, identifies profile, operation and path, and adds the smallest rule or fixes the program's paths.

When to use this

Use it when a program fails on Ubuntu/Debian and AppArmor is suspected.

First 30 seconds

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.

Operational verification

failure → DENIED message → rule added locally → profile reloaded → works in enforce

Evidence · next step

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
Platform / version applicability
linux
applies
Structured applicability is explicit Topic metadata; it does not infer compatibility beyond the stored rows.
At a glance

Operational reference

Fast context before you go deeper.

Platformlinux
Key commandjournalctl -k | grep -i 'apparmor="DENIED"'
Scope / prerequisiteUse it when a program fails on Ubuntu/Debian and AppArmor is suspected.
What next?3 suggested next steps
Evidence1
On this pageJump to a specific section
Operational workflow

Verification & Troubleshooting

Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.

5 steps Observe → verify → isolate → change minimally → repeat the original test.
ObservedRecord what the original test actually shows

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 references

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.

observation · 1
Key points

Look for apparmor="DENIED" with profile, operation and name. Custom data directories often need a local rule. Do not disable the profile globally.

Key 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
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.

FieldMeaning
profileWhich profile decided
operationopen, exec, mknod, connect, capable, …
namePath or object accessed
requested_mask / denied_maskr, 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
ToolUse
aa-complain <profile>Log but allow — for testing a profile
aa-enforce <profile>Back to blocking
aa-logprofSuggest rules from logged denials (review each one)
apparmor_parser -rReload 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.*

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.

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:

SymptomCheck
Service fails after moving data/configDenials for the new path; add rule or local/ override
Profile not loaded after editapparmor_parser -r <file>, syntax errors in journalctl -u apparmor
Container cannot mount/accessDocker docker-default profile; --security-opt apparmor=…
Snap app blockedSnap interfaces (snap connections <app>)
aa-status
dmesg | grep -i apparmor | tail
aa-unconfined --paranoid          # network processes without profiles
Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.

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
Technical verification history

Verification history & basis

When and against what this Topic was checked. Later text edits do not count as a new check.

2026-09-14 · vendor doclinux current

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%
Technical changelog & impact

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.

Related reference impactReview these references after material technical changes when their shared boundary is affected.
Terminology layer

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.

Aliases that resolve here
apparmor troubleshootingapparmor deniedapparmor profile debug
Embedded reference data

Quick lookup tables

AppArmor Troubleshooting operational reference

Topic-specific lookup boundaries, proof limits and next-step Evidence for AppArmor Troubleshooting.

Lookup boundaryTopic-specific referenceOperational use
Scope / effective stateAppArmor 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 verificationPin 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 chainsymptom/time → verify profile attachment/mode → correlate DENIED event/path/operation → inspect includes/transitions → minimal rule change → reload → enforcing retest → regressionTrace requested/configured state through effective state to the observed workload result.
Failure boundaryTroubleshooting 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 evidenceCorrelated 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 → regressionUse this observation only for the specific claim it actually supports.
Evidence limitIt 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 checkContinue 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 boundaryAppArmor Troubleshooting
Topic pathAppArmor → AppArmor Troubleshooting
Runtime stateAppArmor 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 chainsymptom/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 boundaryTroubleshooting 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 ruleProve which configuration source owns the state, then prove that the running consumer loaded or generated the intended state.
Confirmation

Confirm action

Continue?