Skip to content

SELinux and AppArmor

Mandatory access control: why a service gets "Permission denied" although the file permissions are right, and how to fix it properly instead of switching the protection off.

Basics: How SELinux and AppArmor work, which distribution uses which, and the way from a denial to a fix

SELinux: status and mode

SELinux: fixing denials

AppArmor

  • aa-status


    Loaded profiles and protected processes.

  • aa-complain


    Switch profiles between complain and enforce.

From other chapters

  • ausearch


    ausearch -m AVC -ts recent finds the SELinux denials. Covered in the chapter Logs.

  • ls


    ls -Z shows the SELinux label of files. Covered in the chapter Navigation.

  • ps


    ps -eZ shows the SELinux domain of processes. Covered in the chapter Processes.

  • journalctl


    journalctl -k shows AppArmor denials in the kernel log. Covered in the chapter systemd.