← All rules
SOCLE-CLD-PKG-007// Packagesmediuminventory state

Ensure AppArmor is installed

Ensures the apparmor package is installed so the kernel's Mandatory Access Control (MAC) framework is available to confine programs.

Checked against what is installed or registered, packages present/absent, account databases.

A pass proves✓ running now✓ on disk✓ survives rebootthe qualified verdict →
Debian 12CIS 1.1.0Debian 13CIS 1.0.0Ubuntu 22.04CIS 3.0.0Ubuntu 24.04CIS 1.0.0Ubuntu 26.04
One check, maps to 3 standards

A mapping is a cross-reference to where each standard places this requirement, anchored and cross-validated, not a claim of equivalence. A passing check is evidence toward these references, how to read it.

Why this rule matters

Without a Mandatory Access Control system installed, the host relies solely on Discretionary Access Control (Unix ownership and permissions), where any compromised process runs with the full rights of its user. AppArmor adds per-program confinement profiles that cap what a service may read, write or execute, so a breached daemon cannot reach beyond its declared resources. It is required by CIS 1.3.1.x and ANSSI BP-028 R45.

What Pavois checks

Pavois asks the package database (via dpkg) whether apparmor is installed using the InSpec package resource. Querying the effective package state is reliable across Debian and Ubuntu where AppArmor ships by default but can be removed or held back.

describe package('apparmor') do
  it { should be_installed }
end

How to verify it is applied

Run dpkg -s apparmor, expected Status: install ok installed. Confirm the framework is actually active with aa-status (lists enforced/complain profiles) or systemctl is-active apparmor.

Inspect & investigate

  • dpkg -l apparmor confirms installation; aa-status shows loaded profiles.
  • AppArmor denials are logged by the kernel: journalctl -k | grep apparmor or dmesg | grep -i apparmor, and on audit-enabled hosts in /var/log/audit/audit.log (type=AVC apparmor="DENIED").

Remediation

Pavois's harden plan installs the apparmor package (package resource, install action) with pavois harden apply. Installing the package makes the framework available; profiles still need to be loaded and set to enforce mode for confinement to take effect.

Pavois applies this with its own harden engine, the plan below, not a shell script:

actioninstall
nameapparmor
resourcepackage
pavois harden plan local

where the target is local, a user@host SSH alias, or a container , Docs

Impact & precautions

Installing the package is non-disruptive. Risk appears when profiles move to enforce mode: an over-tight or buggy profile can block legitimate file access and break a service. Before enforcing, run profiles in complain mode (aa-complain), review audit.log denials, then enforce once clean. Keep a console/recovery path in case a profile confines sshd or a management agent.

Standards mapping

StandardReferenceTypeVersionConfidence
ANSSI BP-028R45direct2.0high
CIS1.3.1.1directper OS, see the benchmark tablehigh
DISA STIGUBTU-22-431010, UBTU-24-100500directper OS STIG releasehigh

Each reference is a cross-reference anchored in the upstream benchmark and cross-validated against the SCAP Security Guide and ansible-lockdown, not a claim of equivalence. Direct = a prescriptive, line-level requirement; supporting = an abstract control family (NIST) the check provides evidence toward. How to read a mapping.

Sources & references