How to display AppArmor denied messages as desktop notifications

This can be done with apparmor-notify

  1. Install it through apt (sudo apt-get install apparmor-notify)
  2. In /etc/apparmor/notify.conf change the usergroup to 'adm' (all users using sudo are in this group)
  3. add aa-notify -p to your startup applications.

You can then test it by triggering a AppArmor Denied event with

sudo tcpdump -i eth0 -n -s 0 -w /foo