apparmor.d/profiles/strawberry

158 lines
4.1 KiB
Plaintext
Raw Normal View History

# vim:syntax=apparmor
# ------------------------------------------------------------------
#
2021-01-10 16:35:07 +01:00
# 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.
#
# ------------------------------------------------------------------
2020-12-10 22:33:39 +01:00
abi <abi/3.0>,
2020-12-10 22:33:39 +01:00
include <tunables/global>
2021-03-21 17:04:10 +01:00
@{MEDIA_LIB} = /media/*/mp3/
@{exec_path} = /{usr/,}bin/strawberry
profile strawberry @{exec_path} {
2020-12-10 22:33:39 +01:00
include <abstractions/base>
include <abstractions/consoles>
include <abstractions/X>
include <abstractions/gtk>
include <abstractions/freedesktop.org>
include <abstractions/fonts>
include <abstractions/fontconfig-cache-read>
include <abstractions/dri-enumerate>
include <abstractions/mesa>
include <abstractions/audio>
include <abstractions/qt5-compose-cache-write>
include <abstractions/qt5-settings-write>
include <abstractions/nameservice-strict>
include <abstractions/openssl>
include <abstractions/ssl_certs>
2021-03-14 18:57:00 +01:00
include <abstractions/devices-usb>
2020-12-10 22:33:39 +01:00
include <abstractions/deny-root-dir-access>
signal (send) set=(term, kill) peer=strawberry-tagreader,
signal (receive) set=(term, kill) peer=anyremote//*,
2020-12-10 22:33:39 +01:00
network inet dgram,
network inet6 dgram,
network inet stream,
network inet6 stream,
2020-12-24 13:55:12 +01:00
network netlink dgram,
network netlink raw,
2020-12-10 22:33:39 +01:00
@{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,
2021-03-21 17:04:10 +01:00
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,
2021-03-13 09:47:36 +01:00
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,
2020-10-25 10:23:34 +01:00
@{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.
2020-10-25 10:23:34 +01:00
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 {
2020-12-10 22:33:39 +01:00
include <abstractions/base>
include <abstractions/xdg-open>
/{usr/,}bin/xdg-open mr,
2021-02-13 15:00:16 +01:00
/{usr/,}bin/{,ba,da}sh rix,
/{usr/,}bin/gawk rix,
/{usr/,}bin/readlink rix,
/{usr/,}bin/basename rix,
2020-12-09 10:30:52 +01:00
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,
}
2020-12-10 22:33:39 +01:00
include if exists <local/strawberry>
}