apparmor.d/apparmor.d/profiles-a-f/fusermount
2022-03-04 21:30:34 +00:00

53 lines
1.3 KiB
Text

# apparmor.d - Full set of apparmor profiles
# Copyright (C) 2020-2022 Mikhail Morfikov
# Copyright (C) 2021-2022 Alexandre Pujol <alexandre@pujol.io>
# SPDX-License-Identifier: GPL-2.0-only
abi <abi/3.0>,
include <tunables/global>
@{exec_path} = /{usr/,}bin/fusermount{,3}
profile fusermount @{exec_path} {
include <abstractions/base>
include <abstractions/nameservice-strict>
capability dac_read_search,
capability sys_admin,
@{exec_path} mr,
/etc/fuse.conf r,
/etc/machine-id r,
# Where to mount ISO files
owner @{HOME}/*/ rw,
owner @{HOME}/*/*/ rw,
owner @{user_cache_dirs}/**/ rw,
@{run}/user/@{uid}/doc/ r,
/var/tmp/flatpak-cache-*/*/ r,
# Be able to mount ISO images
mount fstype={fuse,fuse.*} -> @{HOME}/*/,
mount fstype={fuse,fuse.*} -> @{HOME}/*/*/,
mount fstype={fuse,fuse.*} -> @{HOME}/.cache/**/,
mount fstype={fuse,fuse.*} -> @{MOUNTS}/*/,
mount fstype={fuse,fuse.*} -> @{MOUNTS}/*/*/,
mount fstype={fuse,fuse.*} -> @{run}/user/@{uid}/*/,
mount fstype={fuse,fuse.*} -> /var/tmp/flatpak-cache-*/*/,
umount @{HOME}/*/,
umount @{HOME}/*/*/,
umount @{HOME}/.cache/**/,
umount @{MOUNTS}/*/,
umount @{MOUNTS}/*/*/,
umount /tmp/.mount_*/,
umount @{run}/user/@{uid}/*/,
umount /var/tmp/flatpak-cache-*/*/,
@{PROC}/@{pid}/mounts r,
/dev/fuse rw,
include if exists <local/fusermount>
}