Pcornel
Browse topics
Options
Recent
Favorites
Linux · Technical reference

Profiles

Direct answer

AppArmor profiles in /etc/apparmor.d/ list what a program may do: file paths with permissions (r, w, x variants), capabilities, network access, signals and mounts, often using abstractions.

When to use this

Use it to read or adjust what a confined program may access.

First 30 seconds

1. Profile for the program: aa-status | grep <prog>.

2. Read it: /etc/apparmor.d/<profile>.

3. Add local rules in /etc/apparmor.d/local/<profile>.

4. apparmor_parser -r /etc/apparmor.d/<profile>.

5. Test; check for new denials.

Operational verification

profile loaded → attached to the program path → rules checked on each access

Evidence · next step

For AppArmor → Profiles, 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 Profiles. 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
Scope / prerequisiteUse it to read or adjust what a confined program may access.
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.

7 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

profile source/includes → parser/load → process attachment → rule/transition match → audit/deny → workload

Healthy evidence: profile parses/loads, attachment matches the target executable, rules cover required accesses narrowly and enforcement tests pass

Step 2 Verification and output interpretation Verify boundary

For SELinux/AppArmor, correlate denial records with current mode/profile/labels and confirm the access vector/path actually matches the failing operation.

Verification chain. profile source/includes → parser/load → process attachment → rule/transition match → audit/deny → workload

Step 3 Specialized verification Verify boundary

Confirm the profile is loaded and the target process is attached to the expected profile. Reproduce the denied operation and correlate kernel/audit logs with profile and resource path. Determine whether the failure is AppArmor or ordinary DAC/other policy. After a scoped rule change, reload the profile, verify enforce mode and repeat the original operation. Also test a negative case when the rule is security-sensitive so the profile has not become overly permissive.

Step 4 Commands Verify boundary
aa-status
ls /etc/apparmor.d/
apparmor_parser -r /etc/apparmor.d/usr.sbin.nginx
Step 5 Failure modes and next checks Narrow the fault

Suspicious evidence: syntax/load error, wrong profile name/path, abstraction grants too much, local override drifts, child transition becomes unconfined or edited source is not the loaded profile

Step 6 Special cases and limits Narrow the fault

Profile-file syntax success does not show attachment, and complain mode success does not show the enforced profile is correct. Path aliases, mounts and namespace views can change which pathname AppArmor evaluates. A denial can coexist with DAC denial or application restrictions. Keep profile source, loaded policy, process attachment and workload behavior separate.

Step 7 Common mistakes Narrow the fault
  • Editing profiles without reloading.
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

Keep local changes in /etc/apparmor.d/local/ so updates do not overwrite them. Reload after editing. aa-logprof proposes rules from logged denials.

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 & boundaries6 sections · depth on demand

What this shows and what it does not

Profile changes are confirmed only when the loaded profile reflects the intended source, the correct process is attached and allowed/denied workload tests match expectations.

In depth

Writing and reading AppArmor profiles

An AppArmor profile lists what a program may do. The apparmor.d(5) manual page defines the syntax:

  • A profile has a name or path, optional flags in parentheses, such as flags=(complain), and rules in braces.
  • #include <abstractions/base> pulls in rules that nearly every program needs.
  • File rules are a path followed by permissions: r (read), w (write), a (append), l (link), k (lock) and m (memory map executable).
  • Execute rules control transitions: ix (inherit this profile), px (switch to that program's own profile), cx (a child profile) and ux (unconfined).
  • capability net_bind_service, allows a capability, and network inet tcp, allows IPv4 TCP sockets.
  • deny blocks without logging, and owner requires the file to belong to the process's user.
  • * matches within one directory level, and ** matches across levels.

A small profile for a custom service

host$ cat /etc/apparmor.d/opt.reportapi.bin.reportapi
#include <tunables/global>

/opt/reportapi/bin/reportapi {
  #include <abstractions/base>
  #include <abstractions/nameservice>

  capability net_bind_service,
  network inet tcp,
  network inet6 tcp,

  /opt/reportapi/bin/reportapi mr,
  /opt/reportapi/lib/** mr,
  /etc/reportapi/*.yml r,
  /var/lib/reportapi/** rwk,
  owner /var/log/reportapi/*.log a,
  /usr/bin/gzip ix,

  deny /etc/shadow r,
  deny /home/** rw,

  #include <local/opt.reportapi.bin.reportapi>
}
host$ sudo apparmor_parser -r /etc/apparmor.d/opt.reportapi.bin.reportapi
host$ sudo systemctl restart reportapi
host$ ps -eo label,comm | grep reportapi
/opt/reportapi/bin/reportapi (enforce) reportapi

Reading the profile

RuleMeaning
abstractions/nameserviceDNS, NSS and hosts lookups
capability net_bind_serviceBind ports below 1024 without root
/opt/reportapi/lib/** mrRead and map libraries anywhere below lib
/var/lib/reportapi/** rwkRead, write and lock its own data
owner ... aOnly append to logs it owns
/usr/bin/gzip ixgzip runs under this same profile
deny linesExplicitly forbidden, and not logged

Capabilities weaken confinement

The manual warns that some capabilities, such as sys_admin or dac_override, make the confinement largely advisory. Grant only what the program needs. Prefer file rules over capabilities that bypass file permissions.

Documented example, not captured output.

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

Profiles is part of AppArmor → Profiles. AppArmor Profiles define path, capability, network, mount, signal and execution permissions for named applications using abstractions, local overrides and transition rules.

Runtime state ownership and mechanics. Linux security composes authentication (PAM and service mechanisms), identity/credentials, DAC permissions/ACLs, capabilities, LSM policy such as SELinux/AppArmor, audit and service/network policy. SELinux labels/types and AppArmor path/profile rules differ in policy model, while auditd records selected security-relevant events rather than making authorization decisions.

Topic-specific state model. AppArmor Profiles define path, capability, network, mount, signal and execution permissions for named applications using abstractions, local overrides and transition rules.

Interpretation rule. - Profile file present ≠ profile loaded or attached.

  • A broad abstraction include ≠ least-privilege policy for the specific application.

Specialized mechanics

AppArmor confines programs using pathname-oriented profiles loaded into the kernel. Profiles define executable attachment and permissions for files, capabilities, network, signals and other resources. Hat/subprofile transitions and abstractions can compose policy. Enforcement applies to a task only when the intended profile is loaded and attached; the mere presence of a profile file under /etc does not show the running process is confined by it. Complain mode records policy violations without enforcing denials, whereas enforce mode blocks operations that violate the loaded profile.

Quick reference

AppArmor profiles list allowed paths, capabilities and network access for a program.

#include <tunables/global>
profile myapp /opt/myapp/bin/myapp flags=(attach_disconnected) {
  #include <abstractions/base>
  #include <abstractions/nameservice>
  network inet stream,
  capability net_bind_service,
  /opt/myapp/** r,
  /opt/myapp/bin/myapp ix,
  /var/lib/myapp/** rw,
  /var/log/myapp/*.log w,
}

Documented example, not captured output. Generate a starting profile with aa-genprof /opt/myapp/bin/myapp, exercise the program, then refine with aa-logprof. Local tweaks to distribution profiles go in /etc/apparmor.d/local/<profile> so package updates keep them.

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. Profile changes are confirmed only when the loaded profile reflects the intended source, the correct process is attached and allowed/denied workload tests match expectations.

Disabling SELinux/AppArmor to make an error disappear only localizes a policy boundary and can hide the real label/profile defect.

ReferenceConfiguration & state2 sections · depth on demand

Configuration, persistence and lifecycle

PAM stack order/control flags matter; sudo/SSH hardening can lock out administration; SELinux policy should normally be fixed through correct labels/booleans/policy rather than permanent disablement; AppArmor profiles should move from complain to enforce only after reviewing legitimate workload behavior.

Specialized lifecycle

Keep profiles in the distribution-supported location and use abstractions/tunables where they express shared policy. Validate and reload the profile after edits, then confirm its enforce/complain state. Complain mode is useful for observation but is not equivalent to enforced security. When paths are dynamic, account for real resolved paths and application behavior rather than broad wildcard rules. Avoid auto-generating and accepting large permission sets without reviewing what the workload should actually access.

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 → Profiles. Documentation verification only; this is not observed lab or production Evidence.

Basis: https://gitlab.com/apparmor/apparmor/-/wikis/Documentation · confidence 94%
2026-09-13 · vendor docAppArmor current

Authoritative Linux project/vendor documentation reviewed for bounded reference claims: profile syntax, attachment, enforce/complain modes and policy scope. Documentation-based technical verification only; not lab or production-runtime proof. The schema vendor_doc method is used for authoritative project/vendor documentation; deployment applicability remains separate evidence.

Basis: https://apparmor.net/ · confidence 93%
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 profileapparmor rulesapparmor abstractions
Embedded reference data

Quick lookup tables

Profiles operational reference

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

Lookup boundaryTopic-specific referenceOperational use
Scope / effective stateAppArmor Profiles define path, capability, network, mount, signal and execution permissions for named applications using abstractions, local overrides and transition rules.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 chainprofile source/includes → parser/load → process attachment → rule/transition match → audit/deny → workloadTrace requested/configured state through effective state to the observed workload result.
Failure boundaryProfile changes are proven only when the loaded profile reflects the intended source, the correct process is attached and allowed/denied workload tests match expectations.Stop broad troubleshooting at the first boundary that is not supported by evidence.
Positive evidenceCorrelated Linux security/trust evidence can establish this proof path: profile source/includes → parser/load → process attachment → rule/transition match → audit/deny → workloadUse 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. Profile changes are proven only when the loaded profile reflects the intended source, the correct process is attached and allowed/denied workload tests match expectations.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.

Profiles · operational reference

Compact Linux state, persistence, verification and boundary reference for fast lookup.

Reference boundaryProfiles
Topic pathAppArmor → Profiles
Runtime stateAppArmor Profiles define path, capability, network, mount, signal and execution permissions for named applications using abstractions, local overrides and transition rules.
Fast checks- Record exact host, distribution/kernel, boot ID, time window, workload, identity and the authoritative configuration/policy source for Profiles. - 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 chainprofile source/includes → parser/load → process attachment → rule/transition match → audit/deny → workload Boundary chain: local authoritative state → adjacent dependency → effective/programmed state → original workload/request → return/regression → explicit Evidence boundary.
Failure boundaryProfile changes are proven only when the loaded profile reflects the intended source, the correct process is attached and allowed/denied workload tests match expectations. 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.

Profiles · specialized operational reference

Topic-specific Linux mechanics, lifecycle, proof path and failure-boundary lookup.

Operational boundaryTopic-specific reference
StateProfile source → loaded kernel policy → process attachment
Modesenforce vs complain
EvidenceAppArmor denial matched to process/path
ProofScoped rule works in enforce mode without broad bypass
Confirmation

Confirm action

Continue?