# vim:syntax=apparmor # ------------------------------------------------------------------ # # Copyright (C) 2017-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 # Audio extensions # a52, aac, ac3, mka, flac, mp1, mp2, mp3, mpc, oga, oma, wav, wv, wm, wma, @{amarok_ext} = [aA]{52,[aA][cC],[cC]3} @{amarok_ext} += [mM][kK][aA] @{amarok_ext} += [fF][lL][aA][cC] @{amarok_ext} += [mM][pP][123cC] @{amarok_ext} += [oO][gGmM][aA] @{amarok_ext} += [wW]{,[aA]}[vV] @{amarok_ext} += [wW][mM]{,[aA]} # Image extensions # bmp, jpg, jpeg, png, gif @{amarok_ext} += [bB][mM][pP] @{amarok_ext} += [jJ][pP]{,[eE]}[gG] @{amarok_ext} += [pP][nN][gG] @{amarok_ext} += [gG][iI][fF] # Playlist extensions # m3u, m3u8, pls @{amarok_ext} += [mM]3[uU]{,8} @{amarok_ext} += [pP][lL][sS] @{exec_path} = /{usr/,}bin/amarok profile amarok @{exec_path} { include include include include include include include include include include include include include include include include include ptrace (trace) peer=@{profile_name}, # Signals to kdeinit4 (unconfined) signal (send) peer=unconfined, @{exec_path} mr, /{usr/,}bin/{,ba,da}sh rix, /{usr/,}bin/amarokcollectionscanner rix, /{usr/,}bin/kde4-config rix, /{usr/,}lib/kde4/libexec/lnusertemp rix, /{usr/,}lib/kde4/libexec/drkonqi rix, /{usr/,}bin/kglobalaccel rPUx, /{usr/,}bin/kbuildsycoca4 rPUx, /{usr/,}bin/kdeinit4 rPUx, /{usr/,}bin/knotify4 rPUx, /{usr/,}bin/ffmpeg rPUx, /{usr/,}bin/lsb_release rPx -> child-lsb_release, # Which media files Amarok should be able to open / r, /home/ r, owner @{HOME}/ r, owner @{HOME}/**/ r, /media/ r, owner /media/**/ r, owner /{home,media}/**.@{amarok_ext} rw, # Amarok home files owner @{HOME}/.kde{,4}/share/apps/amarok/ rw, owner @{HOME}/.kde{,4}/share/apps/amarok/** rwk, owner @{HOME}/.kde{,4}/share/apps/knewstuff3/amarok.knsregistry rw, owner @{HOME}/.kde{,4}/share/config/amarokrc* rw, owner @{HOME}/.kde{,4}/share/config/amarok_homerc* rw, owner @{HOME}/.kde{,4}/share/config/amarok-appletsrcm* rw, owner @{HOME}/.kde{,4}/share/config/amarok-appletsrc* rw, owner @{HOME}/.kde{,4}/share/config/kcookiejarrc r, owner @{HOME}/.kde{,4}/share/config/kio_httprc r, owner @{HOME}/.kde{,4}/share/config/kioslaverc r, owner @{HOME}/.kde{,4}/share/config/ktimezonedrc r, # Phonon /{usr/,}lib/@{multiarch}/qt4/plugins/phonon_backend/phonon_vlc.so mr, # VLC backend /{usr/,}lib/@{multiarch}/vlc/plugins/plugins.dat.* r, /usr/share/vlc/** r, # Cache for art images owner @{HOME}/.kde{,4}/ rw, owner @{HOME}/.kde{,4}/share/ rw, owner @{HOME}/.kde{,4}/share/apps/ rw, owner @{HOME}/.kde{,4}/share/apps/amarok/ rw, owner @{HOME}/.kde{,4}/share/apps/amarok/albumcovers/ rw, owner @{HOME}/.kde{,4}/share/apps/amarok/albumcovers/cache/ rw, owner @{HOME}/.kde{,4}/share/apps/amarok/albumcovers/cache/[0-9]*@[0-9a-f]* rw, owner @{HOME}/.kde{,4}/share/apps/amarok/albumcovers/cache/[0-9]*@nocover.png rw, owner @{HOME}/.kde{,4}/share/apps/amarok/albumcovers/cache rw, owner @{HOME}/.local/share/user-places.xbel rw, owner @{HOME}/.config/Trolltech.conf rwk, deny /etc/rpc r, deny /etc/gnome-vfs-2.0/modules/default-modules.conf r, deny owner @{PROC}/@{pid}/cmdline r, deny owner @{PROC}/@{pid}/loginuid r, owner @{PROC}/@{pid}/mountinfo r, owner @{PROC}/@{pid}/mounts r, /etc/fstab r, # TMP owner /tmp/#sql_*.{MAI,MAD} rw, owner /tmp/qipc_{systemsem,sharedmemory}_AmarokScannerMemory[a-f0-9]* rw, owner /tmp/qt_temp.* rw, owner /tmp/xauth-[0-9]*-_[0-9] r, owner /tmp/kde-*/ rw, /usr/share/icons/*/index.theme rk, @{run}/user/[0-9]*/ksocket-*/amarok*.slave-socket rw, # What's this for? deny /etc/mysql/** r, /var/lib/dbus/machine-id r, /etc/machine-id r, # file_inherit deny /usr/share/anyremote/** r, owner @{HOME}/.anyRemote/anyremote.stdout w, # Udev silencer deny @{sys}/bus/ r, deny @{sys}/class/ r, deny @{sys}/devices/ r, deny @{sys}/devices/virtual/net/**/{uevent,type} r, deny @{sys}/devices/virtual/sound/seq/uevent r, deny @{sys}/devices/system/node/ r, deny @{run}/udev/data/* r, # To generate the crash log info in Amarok /{usr/,}bin/gdb rCx -> gdb, profile gdb { include include /{usr/,}bin/gdb mr, /usr/share/glib-2.0/gdb/{,**} r, @{PROC}/@{pids}/fd/ r, owner @{PROC}/@{pids}/task/ r, owner @{PROC}/@{pids}/task/@{tid}/stat r, owner @{PROC}/@{pids}/task/@{tid}/maps r, owner @{PROC}/@{pids}/mem r, /{usr/,}bin/iconv rix, /usr/share/gdb/python/ r, /usr/share/gdb/python/{,**} r, ptrace (trace), /{usr/,}bin/* r, /usr/share/gdb/auto-load/usr/lib/x86_64-linux-gnu/*.py r, /usr/share/gdb/auto-load/lib/x86_64-linux-gnu/*.py r, /usr/share/gcc-[0-9]*/python/{,**} r, # Silencer deny /usr/share/** w, } include if exists }