apparmor.d/profiles/gtk-youtube-viewer
2021-04-01 16:02:59 +01:00

129 lines
3.2 KiB
Text

# 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 <abi/3.0>,
include <tunables/global>
@{exec_path} = /{usr/,}bin/gtk{,2,3}-youtube-viewer
profile gtk-youtube-viewer @{exec_path} {
include <abstractions/base>
include <abstractions/fonts>
include <abstractions/fontconfig-cache-read>
include <abstractions/freedesktop.org>
include <abstractions/gtk>
include <abstractions/nameservice-strict>
include <abstractions/perl>
include <abstractions/openssl>
include <abstractions/ssl_certs>
include <abstractions/deny-root-dir-access>
network inet dgram,
network inet6 dgram,
network inet stream,
network inet6 stream,
network netlink raw,
@{exec_path} r,
/{usr/,}bin/perl r,
/{usr/,}bin/{,ba,da}sh rix,
/{usr/,}bin/xterm rCx -> xterm,
/{usr/,}bin/rxvt rCx -> xterm,
/{usr/,}bin/urxvt rCx -> xterm,
# Players
/{usr/,}bin/mpv rPx,
/{usr/,}bin/vlc rPx,
/{usr/,}bin/smplayer rPx,
/{usr/,}lib/firefox/firefox rPx,
/{usr/,}bin/xdg-open rCx -> open,
/{usr/,}lib/@{multiarch}/glib-[0-9]*/gio-launch-desktop rCx -> open,
owner @{HOME}/.config/youtube-viewer/{,*} rw,
owner @{HOME}/.cache/ rw,
owner @{HOME}/.cache/youtube-viewer/ rw,
owner @{PROC}/@{pid}/fd/ r,
owner @{PROC}/@{pid}/mounts r,
profile xterm {
include <abstractions/base>
include <abstractions/consoles>
include <abstractions/fonts>
include <abstractions/fontconfig-cache-read>
include <abstractions/freedesktop.org>
include <abstractions/nameservice-strict>
include <abstractions/perl>
include <abstractions/wutmp>
signal (send) set=(hup, winch) peer=youtube-viewer,
signal (send) set=(hup, winch) peer=youtube-viewer//wget,
/{usr/,}bin/xterm mr,
/{usr/,}bin/rxvt mr,
/{usr/,}bin/urxvt mr,
/{usr/,}bin/zsh rix,
/{usr/,}bin/{,ba,da}sh rix,
/{usr/,}bin/youtube-viewer rPx,
owner @{PROC}/@{pid}/loginuid r,
/etc/shells r,
/etc/zsh/* r,
/etc/X11/app-defaults/* r,
/usr/include/X11/bitmaps/vlines2 r,
owner @{HOME}/.urxvt/** r,
owner @{HOME}/.Xauthority r,
owner @{HOME}/.ICEauthority r,
# file_inherit
owner @{HOME}/.xsession-errors w,
}
profile open {
include <abstractions/base>
include <abstractions/xdg-open>
/{usr/,}bin/xdg-open mr,
/{usr/,}lib/@{multiarch}/glib-[0-9]*/gio-launch-desktop 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 <local/gtk-youtube-viewer>
}