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
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:
- On RHEL 9 and later, remove the kernel argument that disables it:
sudo grubby --update-kernel ALL --remove-args selinux. - Set
SELINUX=permissivein/etc/selinux/config. - Run
sudo fixfiles -F onbootand reboot; the system relabels the files during the boot. - Look for denials with
sudo ausearch -m AVC,USER_AVC,SELINUX_ERR,USER_SELINUX_ERR -ts bootand fix them. - Set
SELINUX=enforcingand runsudo 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
- Debian wiki: AppArmor HowToUse — default since Debian 10, checking and enabling
- Docker: AppArmor security profiles — the
docker-defaultprofile - Red Hat: changing SELinux states and modes (RHEL 10)
- Red Hat: how to turn SELinux off —
selinux=0andgrubbyon RHEL 9 /etc/selinux/configof selinux-policy 38.1.86 on Rocky Linux 9.9 (read on 2026-11-26):SELINUX=enforcing, and its comment that from RHEL 9 on onlyselinux=0on the kernel command line turns SELinux off, removed withgrubby --update-kernel ALL --remove-args selinux