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
Whether SELinux is in enforcing mode (/sys/fs/selinux/enforce is 1, and getenforce prints Enforcing) or
AppArmor is enabled (/sys/module/apparmor/parameters/enabled is Y). One of the two passes. SELinux in
permissive mode warns; when neither is enabled, the check fails.
Risk
AppArmor and SELinux limit what a program may read, write and run, on top of the file permissions, also for
processes that run as root. An attacker who takes over a confined service is still bound by its profile or
SELinux type. Docker uses them too: with AppArmor, containers run with the docker-default profile unless
started with --security-opt apparmor=unconfined; with SELinux, containers get a confined type when the daemon
runs with "selinux-enabled": true in daemon.json. The severity is low, since this layer comes on top of the
others.
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 from 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. From 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 a direct switch to enforcing can stop services from starting. Turn it on 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. On Alpine hosts, read this check as information.
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. The server itself has nothing to change; accept the result on the dashboard.
When one application fails under its profile, fix or loosen that profile (aa-complain <profile> on AppArmor, a
local policy module on SELinux) and keep the rest of the system confined.
An accepted result stays out of the digest and the counts until it changes.
Sources
- Debian wiki: AppArmor HowToUse (default since Debian 10)
- Docker: AppArmor security profiles (
docker-default) - 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 the comment that from RHEL 9 on onlyselinux=0on the kernel command line turns SELinux off, removed withgrubby --update-kernel ALL --remove-args selinux.