# vim:syntax=apparmor # ------------------------------------------------------------------ # # Copyright (C) 2018-2021 Mikhail Morfikov # # This program is free software; you can redistribute it and/or # modify it under the terms of version 2 of the GNU General Public # License published by the Free Software Foundation. # # ------------------------------------------------------------------ abi , include @{exec_path} = /{usr/,}bin/xdg-open profile xdg-open @{exec_path} { include include @{exec_path} r, /{usr/,}bin/{,ba,da}sh rix, /{usr/,}bin/{,e}grep rix, /{usr/,}bin/sed rix, /{usr/,}bin/cut rix, /{usr/,}bin/which rix, /{usr/,}bin/cat rix, /{usr/,}bin/uname rix, /{usr/,}bin/xprop rPx, /{usr/,}bin/xdg-mime rPx, /{usr/,}bin/exo-open rPx, /{usr/,}bin/gio rPx, #/{usr/,}bin/kde-open5 rPUx, # When xdg-open is run as root, it wants to exec dbus-launch, and hence it creates the two # following root processes: # dbus-launch --autolaunch e0a30ad97cd6421c85247839ccef9db2 --binary-syntax --close-stderr # /usr/bin/dbus-daemon --syslog-only --fork --print-pid 5 --print-address 7 --session # # Should this be allowed? Xdg-open works fine without this. #/{usr/,}bin/dbus-launch rCx -> dbus, #/{usr/,}bin/dbus-send rCx -> dbus, deny /{usr/,}bin/dbus-launch rx, deny /{usr/,}bin/dbus-send rx, /usr/share/applications/*.desktop r, owner @{HOME}/.local/share/applications/ r, owner @{HOME}/.Xauthority r, /** r, owner /** rw, # file_inherit /dev/dri/card[0-9]* rw, profile dbus { include include /{usr/,}bin/dbus-launch mr, /{usr/,}bin/dbus-send mr, /{usr/,}bin/dbus-daemon rPUx, # for dbus-launch owner @{HOME}/.dbus/session-bus/[0-9a-f]*-[0-9] w, @{HOME}/.Xauthority r, } include if exists }