sudo apparmor_status
-
aa-complain places a profile into complain mode.
sudo aa-complain /path/to/bin
-
aa-enforce places a profile into enforce mode.
sudo aa-enforce /path/to/bin
-
The /etc/apparmor.d directory is where the AppArmor profiles are located. It can be used to
manipulate the mode of all profiles.
Enter the following to place all profiles into complain mode:
sudo aa-complain /etc/apparmor.d/*
To place all profiles in enforce mode:
sudo aa-enforce /etc/apparmor.d/*
-
apparmor_parser is used to load a profile into the kernel. It can also be used to
reload a currently loaded profile using the -r option. To load a profile:
cat /etc/apparmor.d/profile.name | sudo apparmor_parser -a
To reload a profile:
cat /etc/apparmor.d/profile.name | sudo apparmor_parser -r
-
/etc/init.d/apparmor can be used to reload all profiles:
sudo /etc/init.d/apparmor reload
-
The /etc/apparmor.d/disable directory can be used along with the apparmor_parser -R
option to disable a profile.
sudo ln -s /etc/apparmor.d/profile.name /etc/apparmor.d/disable/
sudo apparmor_parser -R /etc/apparmor.d/profile.name
To re-enable a disabled profile remove the symbolic link to the profile in
/etc/apparmor.d/disable/. Then load the profile using the -a option.
sudo rm /etc/apparmor.d/disable/profile.name
cat /etc/apparmor.d/profile.name | sudo apparmor_parser -a
-
AppArmor can be disabled, and the kernel module unloaded by entering the following:
sudo /etc/init.d/apparmor stop
sudo update-rc.d -f apparmor remove
-
To re-enable AppArmor enter:
sudo /etc/init.d/apparmor start
sudo update-rc.d apparmor defaults