Debian GNU/Linux · Boot & system hardening

Install and enable AppArmor

When it fails: AppArmor mandatory access control is not active. Without a mandatory access control system, a compromised service keeps every right of its Unix user.

CB-DEB-BOOT-008mediumactiveautomatedautomated fixprofile core

As released in v0.1.0 beta · pre-release. Current state.

Description

AppArmor is the mandatory access control (MAC) system of Debian. It confines programs with per-program profiles that list the files, capabilities and network access they may use, on top of the classic Unix permissions. It needs the apparmor package (parser and profiles) and the AppArmor security module enabled in the running kernel.

AppArmor is enabled by the Debian kernel by default. If it was disabled with apparmor=0 or a security= / lsm= kernel parameter, remove that parameter from GRUB_CMDLINE_LINUX in /etc/default/grub, run update-grub and reboot.

Rationale

Unix permissions only depend on the user a program runs as. A compromised service confined by an AppArmor profile cannot read or write outside what its profile allows, even as root, which limits what an attacker can do after exploiting it.

Impact

None known on a default install: Debian ships AppArmor enabled since Debian 10, and its profiles are written not to break the packaged programs.

Setting

LocationPackage `apparmor`; kernel security modules (`/sys/kernel/security/lsm`)
DefaultInstalled and enabled
RecommendedInstalled and enabled

Audit

  1. Run dpkg -s apparmor. The package must be installed.
  2. Run aa-enabled. It must print Yes.

Automated: every check must pass. Scanners report each check by its id.

package

The apparmor package is installed.

name: apparmor
state: installed

enabled

The AppArmor kernel module reports itself enabled.

path: /sys/module/apparmor/parameters/enabled
pattern: ^Y$

Remediation

  1. Install the package: apt install apparmor.
  2. If aa-enabled still says it is disabled, remove apparmor=0, security= or lsm= from the kernel command line in /etc/default/grub, run update-grub and reboot.
Restartnone
Disruptionlow

Rollback

AppArmor can be disabled for one boot with the apparmor=0 kernel parameter.

install

Generated from check package: the engine writes the fix for every output, it sets the expected value and the check runs again after.

Each release turns these fixes into remediate.sh and an Ansible role per profile: dry run by default, a fix runs only when its check fails.

References

Mappings

FrameworkIDRelationNote
ANSSI-BP-028 - Recommandations de configuration d'un système GNU/Linux2.0R45partialR45 also asks to put every profile in enforce mode, which is CB-DEB-BOOT-010.
NIST SP 800-53 Rev. 55.1.1AC-3related

How this control relates to the other framework's: equivalent, stricter, looser, partial or related.

Threats mitigated

People and lifecycle

Authors
Verified2026-10-18 by Sn0wAlice on 12, Proxmox VM, Debian 12 genericcloud image, kernel 6.1.0-54-cloud-amd64, BIOS boot. Check passes on a fresh install.
Verified2026-10-18 by Sn0wAlice on 13, Proxmox VM, Debian 13 genericcloud image, kernel 6.12.113+deb13-cloud-amd64, BIOS boot. Check passes on a fresh install.
Introduced inv0.1.0
Created, updated2026-10-18, 2026-10-18
Translationsfr