Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 19 additions & 4 deletions src/config/security/apparmor.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,34 @@
# AppArmor

AppArmor is a mandatory access control mechanism (like SELinux). It can
constrain programs based on pre-defined or generated policy definitions.
[AppArmor](https://apparmor.net/) is a mandatory access control mechanism (like
SELinux). It can constrain programs based on pre-defined or generated policy
definitions.

Void ships with some default profiles for several services, such as `dhcpcd` and
`wpa_supplicant`. Container runtimes such as LXC and podman integrate with
AppArmor for better security for container payloads.

To use AppArmor install the `apparmor` package and add `apparmor=1
security=apparmor` to the [kernel cmdline](./../kernel.md#cmdline).
To use AppArmor install the `apparmor` package and add `apparmor=1 lsm=apparmor`
to the [kernel cmdline](./../kernel.md#cmdline).

By default AppArmor will boot in `enforce` mode and disallow all policy
violations. To boot in `complain` mode, add `apparmor.mode=complain` to the
kernel cmdline.

A few extra profiles, not enabled by default, are shipped in
`/usr/share/apparmor/extra-profiles/`. Enable the desired ones by copying them
into `/etc/apparmor.d/`. Some programs (e.g. `firefox`) have a default profile
file in `unconfined` mode. Changes to these files will be overwritten by `xbps`
when updating the `apparmor` package. In this case, to use a custom profile in
`enforce` or `complain` mode, disable the system-provided file by symlinking it
in `/etc/apparmor.d/disable/` and copy the custom profile into
`/etc/apparmor.d/` with a different name. E.g.:

```
# ln -s ../<profile_file> /etc/apparmor.d/disable/
# cp </path/to/custom/profile_file> /etc/apparmor.d/<profile_file>_local
```

AppArmor tools [aa-genprof(8)](https://man.voidlinux.org/aa-genprof.8) and
[aa-logprof(8)](https://man.voidlinux.org/aa-logprof.8) require either
configured [syslog](../services/logging.md) or a running
Expand Down
Loading