# vim:syntax=apparmor # ------------------------------------------------------------------ # # Copyright (C) 2019-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 @{MEDIA_LIB} = /media/*/mp3/ @{exec_path} = /{usr/,}bin/strawberry profile strawberry @{exec_path} { include include include include include include include include include include include include include include include include include signal (send) set=(term, kill) peer=strawberry-tagreader, signal (receive) set=(term, kill) peer=anyremote//*, network inet dgram, network inet6 dgram, network inet stream, network inet6 stream, network netlink dgram, network netlink raw, @{exec_path} mr, /{usr/,}bin/strawberry-tagreader rPx, /{usr/,}lib/@{multiarch}/gstreamer[0-9]*.[0-9]*/gstreamer-[0-9]*.[0-9]*/gst-plugin-scanner rPUx, /{usr/,}bin/xdg-open rCx -> open, # Media library / r, /media/ r, owner /media/*/ r, owner @{MEDIA_LIB}/ r, owner @{MEDIA_LIB}/** rw, # Playlists owner @{HOME}/**.{m3u,xspf,pls,asx,cue,wpl} rw, owner @{HOME}/**.{M3U,XSPF,PLS,ASX,CUE,WPL} rw, owner @{HOME}/ r, owner @{HOME}/.config/strawberry/ rw, owner @{HOME}/.config/strawberry/* rwkl -> @{HOME}/.config/strawberry/#[0-9]*[0-9], owner @{HOME}/.local/share/strawberry/ rw, owner @{HOME}/.local/share/strawberry/** rwk, owner @{HOME}/.cache/ rw, owner @{HOME}/.cache/strawberry/ rw, owner @{HOME}/.cache/strawberry/** rwl -> @{HOME}/.cache/strawberry/networkcache/prepared/#[0-9]*[0-9], owner @{HOME}/.cache/gstreamer-[0-9]*/ rw, owner @{HOME}/.cache/gstreamer-[0-9]*/registry.*.bin{,.tmp*} rw, owner @{HOME}/.cache/xine-lib/ rw, owner @{HOME}/.cache/xine-lib/plugins.cache{,.new} rw, owner @{HOME}/.config/qt5ct/{,**} r, /usr/share/qt5ct/** r, owner @{PROC}/@{pid}/mountinfo r, owner @{PROC}/@{pid}/mounts r, deny owner @{PROC}/@{pid}/cmdline r, owner @{PROC}/@{pid}/fd/ r, deny @{PROC}/sys/kernel/random/boot_id r, @{run}/mount/utab r, /etc/fstab r, deny /dev/ r, /dev/shm/#[0-9]*[0-9] rw, /dev/sr[0-9]* r, @{sys}/devices/system/node/ r, @{sys}/devices/system/node/node[0-9]/meminfo r, # The orcexec.* file is JIT compiled code for various GStreamer elements. # If one is blocked the next is used instead. owner @{run}/user/[0-9]*/orcexec.* mrw, #owner @{HOME}/orcexec.* mrw, #owner /tmp/orcexec.* mrw, owner /tmp/qipc_{systemsem,sharedmemory}_*[a-f0-9]* rw, owner /tmp/.*/ rw, owner /tmp/.*/s rw, owner /tmp/strawberry*[0-9] w, owner /tmp/strawberry-cover-*.jpg rwl -> /tmp/#[0-9]*[0-9], owner /tmp/#[0-9]*[0-9] rw, owner /tmp/*= w, owner /var/tmp/etilqs_[0-9a-f]* rw, /var/lib/dbus/machine-id r, /etc/machine-id r, /usr/share/hwdata/pnp.ids r, # Allowed apps to open /{usr/,}lib/firefox/firefox rPUx, # file_inherit owner /dev/tty[0-9]* rw, owner @{HOME}/.anyRemote/anyremote.stdout w, profile open { include include /{usr/,}bin/xdg-open mr, /{usr/,}bin/{,ba,da}sh rix, /{usr/,}bin/gawk rix, /{usr/,}bin/readlink rix, /{usr/,}bin/basename rix, owner @{HOME}/ r, owner @{run}/user/[0-9]*/ r, # Allowed apps to open /{usr/,}lib/firefox/firefox rPUx, # file_inherit owner @{HOME}/.xsession-errors w, } include if exists }