- 1 Preventing circumvention of path-based MAC via links
- 2 Implementation Status
- 3 Links
- 4 AppArmor Packages
- 5 Kernel Configuration
- 6 Bootloader Configuration
- 7 System Configuration
- 8 UserSpace Tools
- 9 More Info
- 10 See also
AppArmor can be circumvented via hardlinks in the standard POSIX security model. However, the kernel now includes the ability to prevent this vulnerability, without needing the patches distributions like Ubuntu have applied to their kernels as workarounds.
See Sysctl#Preventing_link_TOCTOU_vulnerabilities for details.
AppArmor is currently available in the Arch Linux kernel, but it has to be activated on kernel boot.
The userspace support requires AUR packages.
Not all the packages work out-of-the-box, but it is a work in progress. If you know how to build profiles yourself you shouldn't have too many problems. Also there is an AUR kernel which includes apparmor specific patches from Ubuntu's launchpad.
Added lot of features:
But we still miss following features (TODO):
- init (rc.d) scripts! http://aur.pastebin.com/beQ4BjGX
- chase missing dependencies
- test everything
- make list of files that should go to backup=() arrays in packages...
- changehat modules for PAM(!), Apache and Tomcat (btw those are dependent on libapparmor)
- out-of-box-experience know-how
- make some package with profiles for all [core] packages enabled by default without need for any further user configuration
- apparmor gnome applet (can't build, deprecated...)
When compared to Ubuntu
we have almost everything that is in following Ubuntu packages:
We do not have
- packages: libapache2-mod-apparmor libpam-apparmor
- Official pages
- http://ubuntuforums.org/showthread.php?t=1008906 (Tutorial)
- Arch's package has AppArmor support
Here is configuration of ArchLinux kernel which enables AppArmor (just FYI, you do not need to touch it):
CONFIG_SECURITY_APPARMOR=y CONFIG_SECURITY_APPARMOR_BOOTPARAM_VALUE=0 # CONFIG_DEFAULT_SECURITY_APPARMOR is not set
However, integration of AppArmor into the 2.6.36 kernel is not quite complete. It is missing network mediation and some of the interfaces for introspection. See here for details. There are compatibility patches that can be applied to every recent kernel to reintroduce these interfaces. The patchset is pretty small and should be applied if you decide to use AppArmor. (Note: the patchset for 2.6.39 works with Kernel 3.0.x)
To test profiles, or enforce the use of AppArmor it must be enabled at boot time. To do this add
apparmor=1 security=apparmor to the kernel boot parameters.
After reboot you can test if AppArmor is really enabled using this command as root:
# cat /sys/module/apparmor/parameters/enabled Y
(Y=enabled, N=disabled, no such file = module not in kernel)
DisableAppArmor will be disabled by default in Arch Linux, so you will not need to disable it explicitly until you will build your own kernel with AppArmor enabled by default. If so, Add
to kernel boot parameters.
Mounts (/etc/fstab securityfs)
none /sys/kernel/security securityfs defaults 0 0
In the future, we'll implement some
/etc/rc.d/ scripts that will enable and load profiles during startup.
The RC.d file of Slackware might be more interesting than Ubuntu's init.d version http://bazaar.launchpad.net/~apparmor-dev/apparmor/2.8/view/head:/parser/rc.apparmor.slackware. NOTE: when using
/usr/lib/apparmor/rc.apparmor.functions (indirectly used by rc.apparmor.slackware) or the
aa-status program, you NEED a kernel with 0001-UBUNTU-SAUCE-AppArmor-Add-profile-introspection-file.patch. This is at least true for AppArmor 2.8, in version 2.9 things will go into mainline and a different interface will be used for introspecting profiles.
# NOTE: rc.apparmor initscripts that source this file need to implement # the following set of functions: # aa_action # aa_log_action_start # aa_log_action_end # aa_log_success_msg # aa_log_warning_msg # aa_log_failure_msg # aa_log_skipped_msg # aa_log_daemon_msg # aa_log_end_msg
You can currently install userspace tools from AUR.
You need userspace tools that are compatible with your kernel version. The compatibility list can be found here: https://apparmor.wiki.kernel.org/index.php/AppArmor_versions e.g.: Kernel 2.6.36 is compatible with AppArmor 2.5.1
AppArmor, like most other LSMs, supplements rather than replaces the default Discretionary access control. As such it's impossible to grant a process more privileges than it had in the first place.
Ubuntu, SUSE and a number of other distributions use it by default. RHEL (and it's variants) use SELinux which requires good userspace integration to work properly. People tend to agree that it is also much much harder to configure correctly.
Taking a common example - A new Flash vulnerability: If you were to browse to a malicious website AppArmor can prevent the exploited plugin from accessing anything that may contain private information. In almost all browsers, plugins run out of process which makes isolating them much easier.
AppArmor profiles (usually) get stored in easy to read text files in
Every breach of policy triggers a message in the system log, and many distributions also integrate it into DBUS so that you get real-time violation warnings popping up on your desktop.