# 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 # Video/audio extensions: # a52, aac, ac3, mka, flac, mp1, mp2, mp3, mpc, oga, oma, wav, wv, wm, wma, 3g2, 3gp, 3gp2, 3gpp, # asf, avi, divx, m1v, m2v, m4v, mkv, mov, mp4, mpa, mpe, mpg, mpeg, mpeg1, mpeg2, mpeg4, ogg, ogm, # ogx, ogv, rm, rmvb, webm, wmv, wtv, mp2t @{vlc_ext} = [aA]{52,[aA][cC],[cC]3} @{vlc_ext} += [mM][kK][aA] @{vlc_ext} += [fF][lL][aA][cC] @{vlc_ext} += [mM][pP][123cC] @{vlc_ext} += [oO][gGmM][aA] @{vlc_ext} += [wW]{,[aA]}[vV] @{vlc_ext} += [wW][mM]{,[aA]} @{vlc_ext} += 3[gG]{[2pP],[pP][2pP]} @{vlc_ext} += [aA][sS][fF] @{vlc_ext} += [aA][vV][iI] @{vlc_ext} += [dD][iI][vV][xX] @{vlc_ext} += [mM][124][vV] @{vlc_ext} += [mM][kKoO][vV] @{vlc_ext} += [mM][pP][4aAeEgG] @{vlc_ext} += [mM][pP][eE][gG]{,[124]} @{vlc_ext} += [oO][gG][gGmMxXvV] @{vlc_ext} += [rR][mM]{,[vV][bB]} @{vlc_ext} += [wW][eE][bB][mM] @{vlc_ext} += [wW][mMtT][vV] @{vlc_ext} += [mM][pP]2[tT] # Image extensions # bmp, jpg, jpeg, png, gif @{vlc_ext} += [bB][mM][pP] @{vlc_ext} += [jJ][pP]{,[eE]}[gG] @{vlc_ext} += [pP][nN][gG] @{vlc_ext} += [gG][iI][fF] # Subtitle extensions: # srt, txt, sub @{vlc_ext} += [sS][rR][tT] @{vlc_ext} += [tT][xX][tT] @{vlc_ext} += [sS][uU][bB] # Playlist extensions: # m3u, m3u8, pls @{vlc_ext} += [mM]3[uU]{,8} @{vlc_ext} += [pP][lL][sS] @{exec_path} = /{usr/,}bin/{c,}vlc profile vlc @{exec_path} { include include include include include include include include include include include include include include include include include include include signal (receive) set=(term, kill) peer=anyremote//*, network inet dgram, network inet6 dgram, network inet stream, network inet6 stream, network netlink raw, @{exec_path} mrix, # Which media files VLC should be able to open / r, /home/ r, owner @{HOME}/ r, owner @{HOME}/**/ r, /media/ r, owner /media/**/ r, owner /{home,media}/**.@{vlc_ext} rw, /var/lib/dbus/machine-id r, /etc/machine-id r, # VLC files /usr/share/vlc/{,**} r, # VLC config files owner @{HOME}/ r, owner @{HOME}/.config/vlc/ rw, owner @{HOME}/.config/vlc/* rwkl -> @{HOME}/.config/vlc/#[0-9]*[0-9], owner @{HOME}/.local/share/vlc/{,*} rw, owner @{HOME}/.cache/ rw, owner @{HOME}/.cache/vlc/{,**} rw, owner @{HOME}/.cache/#[0-9]*[0-9] rw, # To configure Qt5 settings (theme, font, icons, etc.) under DE/WM without Qt integration owner @{HOME}/.config/qt5ct/{,**} r, /usr/share/qt5ct/** r, /dev/shm/#[0-9]*[0-9] rw, deny owner @{PROC}/@{pid}/cmdline r, owner @{PROC}/@{pid}/mountinfo r, owner @{PROC}/@{pid}/mounts r, @{PROC}/@{pid}/net/if_inet6 r, deny @{PROC}/sys/kernel/random/boot_id r, # Udev enumeration @{sys}/bus/ r, @{sys}/bus/**/devices/ r, @{sys}/devices/**/uevent r, @{sys}/class/ r, @{sys}/class/**/ r, @{run}/udev/data/b254:[0-9]* r, # for /dev/zram* @{run}/udev/data/b253:[0-9]* r, # for /dev/dm* @{run}/udev/data/b8:[0-9]* r, # for /dev/sd* @{run}/udev/data/b7:[0-9]* r, # for /dev/loop* /etc/fstab r, /usr/share/hwdata/pnp.ids r, # Be able to turn off the screensaver while playing movies /{usr/,}bin/xdg-screensaver rCx -> xdg-screensaver, # Silencer deny /{usr/,}lib/@{multiarch}/vlc/{,**} w, # file_inherit owner /dev/tty[0-9]* rw, owner @{HOME}/.anyRemote/anyremote.stdout w, profile xdg-screensaver { include include /{usr/,}bin/xdg-screensaver mr, /{usr/,}bin/{,ba,da}sh rix, /{usr/,}bin/mv rix, /{usr/,}bin/{,e}grep rix, /{usr/,}bin/sed rix, /{usr/,}bin/which rix, /{usr/,}bin/xset rix, /{usr/,}bin/xautolock rix, /{usr/,}bin/dbus-send rix, owner @{HOME}/.Xauthority r, # file_inherit /dev/dri/card[0-9]* rw, network inet stream, network inet6 stream, } include if exists }