# apparmor.d - Full set of apparmor profiles # Copyright (C) 2017-2021 Mikhail Morfikov # Copyright (C) 2023 Alexandre Pujol # SPDX-License-Identifier: GPL-2.0-only abi , include @{exec_path} = /{usr/,}bin/xinit profile xinit @{exec_path} { include include @{exec_path} mr, signal (receive) set=(usr1) peer=xorg, signal (send) set=(term, kill) peer=xorg, signal (send) set=(hup), /{usr/,}bin/ r, /{usr/,}bin/{,ba,da}sh rix, /{usr/,}bin/{,e}grep rix, /{usr/,}bin/{m,g,}awk rix, /{usr/,}bin/cat rix, /{usr/,}bin/chmod rix, /{usr/,}bin/date rix, /{usr/,}bin/head rix, /{usr/,}bin/id rix, /{usr/,}bin/mktemp rix, /{usr/,}bin/rm rix, /{usr/,}bin/sed rix, /{usr/,}bin/tail rix, /{usr/,}bin/tempfile rix, /{usr/,}bin/touch rix, /{usr/,}bin/which{,.debianutils} rix, /etc/X11/xinit/xinitrc rix, /etc/X11/xinit/xserverrc rix, /{usr/,}bin/dbus-update-activation-environment rix, /{usr/,}bin/gpgconf rPx, /{usr/,}bin/run-parts rCx -> run-parts, /{usr/,}bin/udevadm rCx -> udevadm, /{usr/,}bin/flatpak rPUx, /{usr/,}bin/glxinfo rPx, /{usr/,}bin/numlockx rPx, /{usr/,}bin/X rPx, /{usr/,}bin/xhost rPx, /{usr/,}bin/Xorg rPx, /{usr/,}bin/xrdb rPx, # Allowed GUI sessions to start /{usr/,}bin/openbox-session rPx, /{usr/,}bin/enlightenment_start rPUx, /{usr/,}bin/sway rPUx, /{usr/,}bin/ssh-agent rPx, /etc/X11/{,**} r, /etc/default/{,*} r, owner @{HOME}/ r, owner @{HOME}/.Xauthority r, owner @{HOME}/.xserverrc r, owner @{HOME}/.xsession-errors w, owner /tmp/file* rw, owner /tmp/tmp.* rw, /dev/tty rw, profile run-parts { include /{usr/,}bin/run-parts mr, /etc/X11/Xsession.d/ r, /etc/X11/Xresources/ r, # file_inherit owner /dev/tty[0-9]* rw, owner @{HOME}/.xsession-errors w, } profile udevadm { include /{usr/,}bin/udevadm mr, /etc/udev/udev.conf r, owner @{PROC}/@{pid}/stat r, @{PROC}/cmdline r, @{PROC}/1/sched r, @{PROC}/1/environ r, @{PROC}/sys/kernel/osrelease r, @{sys}/firmware/efi/efivars/SecureBoot-@{uuid} r, @{sys}/bus/ r, @{sys}/bus/*/devices/ r, @{sys}/class/ r, @{sys}/class/*/ r, @{sys}/devices/**/uevent r, @{run}/udev/data/* r, # file_inherit owner /dev/tty[0-9]* rw, owner @{HOME}/.xsession-errors w, } include if exists }