apparmor.d/apparmor.d/profiles-g-l/jmtpfs
Mikhail Morfikov 3430e3df90
update apparmor profiles
Signed-off-by: Alexandre Pujol <alexandre@pujol.io>
2021-12-12 13:18:41 +00:00

63 lines
1.2 KiB
Text

# apparmor.d - Full set of apparmor profiles
# Copyright (C) 2021 Mikhail Morfikov
# SPDX-License-Identifier: GPL-2.0-only
abi <abi/3.0>,
include <tunables/global>
@{exec_path} = /{usr/,}bin/jmtpfs
profile jmtpfs @{exec_path} {
include <abstractions/base>
include <abstractions/devices-usb>
network netlink raw,
@{exec_path} mr,
/{usr/,}bin/fusermount{,3} rCx -> fusermount,
owner /tmp/tmp* rw,
owner /tmp/#[0-9]* rw,
# Mount points
owner @{HOME}/*/ r,
owner @{HOME}/*/*/ r,
owner @{HOME}/.cache/*/mtp{,-[0-9]*}/ rw,
mount fstype={fuse,fuse.jmtpfs} -> @{HOME}/*/,
mount fstype={fuse,fuse.jmtpfs} -> @{HOME}/*/*/,
mount fstype={fuse,fuse.jmtpfs} -> @{HOME}/.cache/*/*/,
/etc/magic r,
/dev/fuse rw,
profile fusermount {
include <abstractions/base>
include <abstractions/nameservice-strict>
# To mount anything:
capability sys_admin,
#
capability dac_read_search,
/{usr/,}bin/fusermount{,3} mr,
mount fstype={fuse,fuse.jmtpfs} -> @{HOME}/*/,
mount fstype={fuse,fuse.jmtpfs} -> @{HOME}/*/*/,
mount fstype={fuse,fuse.jmtpfs} -> @{HOME}/.cache/*/*/,
/etc/fuse.conf r,
/dev/fuse rw,
@{PROC}/@{pid}/mounts r,
}
include if exists <local/jmtpfs>
}