---
name: "apparmor-profile-enforcement"
description: "Confine Linux applications and microservices to strict least-privilege profiles with AppArmor."
metadata:
  author: "AppArmor"
  version: "1.0.0"
  runtime_compatibility:
    - "codex"
    - "claude-code"
    - "cursor"
    - "windsurf"
triggers:
  - "create apparmor profile"
  - "enforce apparmor profile"
  - "debug apparmor denials"
permissions:
  fs_read: true
  fs_write: "workspace"
  shell_exec: false
  net_access: false
---

# AppArmor Linux Security Module Profiles

Authors and enforces AppArmor profiles (/etc/apparmor.d): aa-genprof profiling, file access restrictions (r, w, m, k), network family permissions, and aa-enforce activation.

## When to Invoke
Invoke this skill whenever you need to:
- create apparmor profile
- enforce apparmor profile
- debug apparmor denials

## Execution SOP & Rules
1. Scaffold profile generation using aa-genprof /path/to/binary.
2. Define file access permissions explicitly: /etc/nginx/** r, /var/log/nginx/* w.
3. Transition profile from complain mode to enforce mode using aa-enforce /etc/apparmor.d/profile.
4. Verify active enforcement status using aa-status command.

## Verification Checklist
- Run local linting, syntax validation, and type-checks before reporting completion.
- Ensure all created or modified files adhere to workspace boundaries and avoid uncommitted secrets.
- Verify tests or build commands exit cleanly with return code 0.
