# Simple test profile with all rules used abi , alias /mnt/usr -> /usr, include # optional: a comment include if exists "/etc/apparmor.d/global/dummy space" @{name}=torbrowser "tor browser" @{lib_dirs} = @{lib}/@{name} /opt/@{name} # another comment @{config_dirs} = @{HOME}/.mozilla/ @{cache_dirs}=@{user_cache_dirs}/mozilla/ alias /mnt/{,usr.sbin.}mount.cifs -> /sbin/mount.cifs, @{exec_path} = @{bin}/@{name} @{lib_dirs}/@{name} profile foo @{exec_path} xattrs=(security.tagged=allowed) flags=(complain attach_disconnected) { include include include "/etc/apparmor.d/abstractions/dummy space" all, set rlimit nproc <= 200, userns, capability dac_read_search, capability dac_override, network inet stream, network netlink raw, mount /{,**}, mount options=(rw rbind) /tmp/newroot/ -> /tmp/newroot/, mount options=(rw silent rprivate) -> /oldroot/, mount fstype=devpts options=(rw nosuid noexec) devpts -> /newroot/dev/pts/, remount /newroot/{,**}, umount @{run}/user/@{uid}/, pivot_root oldroot=/tmp/oldroot/ /tmp/, change_profile -> libvirt-@{uuid}, mqueue r type=posix /, io_uring sqpoll label=foo, signal (receive) set=(cont,term,winch) peer=at-spi-bus-launcher, ptrace (read) peer=nautilus, unix (send receive) type=stream addr="@/tmp/.ICE[0-9]-unix/19 5" peer=(label=gnome-shell, addr=none), dbus bind bus=session name=org.gnome.*, dbus receive bus=system path=/org/freedesktop/DBus interface=org.freedesktop.DBus member=AddMatch peer=(name=:1.3, label=power-profiles-daemon), # A comment! before a paragraph of rules "/opt/Mullvad VPN/resources/*.so*" mr, "/opt/Mullvad VPN/resources/*" r, "/opt/Mullvad VPN/resources/openvpn" rix, /usr/share/gnome-shell/extensions/ding@rastersoft.com/{,*/}ding.js rPx, /opt/intel/oneapi/compiler/*/linux/lib/*.so./* rm, owner @{user_config_dirs}/powerdevilrc{,.@{rand6}} rwl -> @{user_config_dirs}/#@{int}, link @{user_config_dirs}/kiorc -> @{user_config_dirs}/#@{int}, @{run}/udev/data/+pci:* r, @{sys}/devices/@{pci}/class r, owner @{PROC}/@{pid}/task/@{tid}/comm rw, ^action { include include if exists } profile systemctl { include include capability net_admin, include if exists } profile sudo { include include @{sh_path} rix, include if exists } include if exists } profile foo2 { include include if exists }