# apparmor.d - Full set of apparmor profiles # Copyright (C) 2021 Mikhail Morfikov # Copyright (C) 2023 Alexandre Pujol # SPDX-License-Identifier: GPL-2.0-only abi , include @{exec_path} = @{bin}/psi profile psi @{exec_path} { include include include include include include include include include include include include include include include include include network inet dgram, network inet6 dgram, network inet stream, network inet6 stream, network netlink dgram, signal (send) set=(term, kill) peer=lsb_release, @{exec_path} mr, @{bin}/aplay rCx -> aplay, @{bin}/gpg{,2} rCx -> gpg, @{bin}/lsb_release rPx -> lsb_release, @{bin}/xdg-open rCx -> open, @{lib}/firefox/firefox rPUx, /usr/share/hwdata/pnp.ids r, /usr/share/psi/{,**} r, /usr/share/qt5ct/** r, /etc/debian_version r, /etc/fstab r, /etc/machine-id r, /var/lib/dbus/machine-id r, owner /var/tmp/etilqs_@{hex} rw, owner @{HOME}/ r, owner @{user_cache_dirs}/ rw, owner @{user_cache_dirs}/#[0-9]*[0-9] rw, owner @{user_cache_dirs}/psi/{,**} rw, owner @{user_config_dirs}/autostart/psi.desktop rw, owner @{user_config_dirs}/psi/ rw, owner @{user_config_dirs}/psi/** rwkl -> @{user_config_dirs}/psi/#[0-9]*[0-9], owner @{user_config_dirs}/qt5ct/{,**} r, owner @{user_share_dirs}/psi/ rw, owner @{user_share_dirs}/psi/** rwk, owner /tmp/#[0-9]*[0-9] rw, owner /tmp/Psi.* rwl -> /tmp/#[0-9]*[0-9], @{run}/systemd/inhibit/[0-9]*.ref rw, owner @{PROC}/@{pid}/mountinfo r, owner @{PROC}/@{pid}/mounts r, deny @{PROC}/sys/kernel/random/boot_id r, deny owner @{PROC}/@{pid}/cmdline r, /dev/shm/#[0-9]*[0-9] rw, # file_inherit owner /dev/tty[0-9]* rw, profile aplay { include include @{bin}/aplay mr, #@{bin}/pulseaudio rPUx, /var/lib/dbus/machine-id r, /etc/machine-id r, /usr/share/psi/sound/** r, owner @{HOME}/.Xauthority r, # file_inherit /dev/dri/card[0-9]* rw, } profile gpg { include @{bin}/gpg{,2} mr, owner @{HOME}/.gnupg/ rw, owner @{HOME}/.gnupg/** rwkl -> @{HOME}/.gnupg/**, # file_inherit /dev/dri/card[0-9]* rw, } profile open { include include @{bin}/xdg-open mr, @{bin}/{,ba,da}sh rix, @{bin}/{m,g,}awk rix, @{bin}/readlink rix, @{bin}/basename rix, owner @{HOME}/ r, owner @{run}/user/@{uid}/ r, # Allowed apps to open @{lib}/firefox/firefox rPUx, # file_inherit owner @{HOME}/.xsession-errors w, } include if exists }