Checks / Host

AppArmor or SELinux is off

Check
mac.enabled
Severity
low
Runs
on the server, in the daily run of the agent
Looks at
AppArmor enabled or SELinux enforcing
Updated 26 Nov 2026

What the check looks at

The agent checks whether AppArmor is enabled (/sys/module/apparmor/parameters/enabled is Y) or SELinux is in enforcing mode (getenforce prints Enforcing). One of the two is enough for a pass.

Why it matters

AppArmor and SELinux are mandatory access control systems in the kernel. They limit what a program may read, write and run, on top of the normal file permissions, and they apply to processes that run as root too. When a confined service is taken over, the attacker is still bound by its profile or SELinux type.

Docker uses them as well: on hosts with AppArmor, containers run with the docker-default profile unless started with --security-opt apparmor=unconfined. On hosts with SELinux, containers get a confined SELinux type when the Docker daemon runs with SELinux support ("selinux-enabled": true in daemon.json).

The severity is low: a server is not open because of this, but a working layer of protection is gone.

How to fix it

Debian and Ubuntu (AppArmor)

AppArmor is on by default on Ubuntu and on Debian since Debian 10. If it is off, install the tools and look at the kernel command line:

sudo apt install apparmor apparmor-utils
cat /proc/cmdline

If the command line contains apparmor=0 or a security= value other than apparmor, remove it from GRUB_CMDLINE_LINUX_DEFAULT in /etc/default/grub (or the file in /etc/default/grub.d/ that sets it), then:

sudo update-grub
sudo reboot

RHEL, Rocky Linux and AlmaLinux (SELinux)

SELinux is enforcing by default. If it is in permissive mode, switch at runtime and make it permanent:

sudo setenforce 1
sudo sed -i 's/^SELINUX=.*/SELINUX=enforcing/' /etc/selinux/config

If SELinux is disabled, the file system labels are probably out of date, and switching straight to enforcing can stop services from starting. Re-enable it in steps:

  1. On RHEL 9 and later, remove the kernel argument that disables it: sudo grubby --update-kernel ALL --remove-args selinux.
  2. Set SELINUX=permissive in /etc/selinux/config.
  3. Run sudo fixfiles -F onboot and reboot; the system relabels the files during the boot.
  4. Look for denials with sudo ausearch -m AVC,USER_AVC,SELINUX_ERR,USER_SELINUX_ERR -ts boot and fix them.
  5. Set SELINUX=enforcing and run sudo setenforce 1.

Alpine

The default Alpine setup does not load AppArmor profiles or an SELinux policy. Treat this check as information on Alpine hosts.

How to check the fix

sudo aa-status          # Debian, Ubuntu: "apparmor module is loaded." and the profiles
getenforce              # RHEL, Rocky, Alma: Enforcing
sestatus

When a warning is fine

On a container-based VPS (OpenVZ, LXC), the kernel belongs to the provider, and AppArmor or SELinux cannot be turned on from inside. There is nothing to do on the server itself; accept the result on the dashboard. A single application that fails under its profile is a reason to fix or loosen that profile (aa-complain <profile> on AppArmor, a local policy module on SELinux), not to turn the whole system off.

An accepted result is left out of the digest and the counts until it changes; then it shows again.

Sources