apparmor.d/profiles/udiskie
2021-04-01 16:02:59 +01:00

80 lines
1.9 KiB
Text

# vim:syntax=apparmor
# ------------------------------------------------------------------
#
# Copyright (C) 2018-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/udiskie
profile udiskie @{exec_path} {
include <abstractions/base>
include <abstractions/X>
include <abstractions/fonts>
include <abstractions/fontconfig-cache-read>
include <abstractions/freedesktop.org>
include <abstractions/gtk>
include <abstractions/python>
include <abstractions/user-download-strict>
include <abstractions/thumbnails-cache-read>
include <abstractions/mesa>
include <abstractions/dri-enumerate>
include <abstractions/deny-dconf>
include <abstractions/deny-root-dir-access>
@{exec_path} r,
/{usr/,}bin/python3.[0-9] r,
/{usr/,}bin/ r,
/{usr/,}bin/xdg-open rCx -> open,
owner @{HOME}/.config/udiskie/ r,
owner @{HOME}/.config/udiskie/config.yml r,
owner @{PROC}/@{pid}/fd/ r,
owner @{PROC}/@{pid}/mounts r,
owner @{PROC}/@{pid}/mountinfo r,
/etc/fstab r,
/usr/share/glib-2.0/schemas/gschemas.compiled r,
# Allowed apps to open
/{usr/,}bin/spacefm rPx,
# Silencer
deny /{usr/,}lib/** w,
profile open {
include <abstractions/base>
include <abstractions/xdg-open>
/{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/,}bin/spacefm rPx,
# file_inherit
owner @{HOME}/.xsession-errors w,
}
include if exists <local/udiskie>
}