# apparmor.d - Full set of apparmor profiles # Copyright (C) 2018-2021 Mikhail Morfikov # Copyright (C) 2021 Alexandre Pujol # SPDX-License-Identifier: GPL-2.0-only abi , include @{exec_path} = /{usr/,}bin/{low,}ntfs{,-3g} @{exec_path} += /{usr/,}{s,}bin/mount.{low,}ntfs{,-3g} profile ntfs-3g @{exec_path} { include include # When UserMapping is placed under /.NTFS-3G/UserMapping on the NTFS volume include capability dac_override, capability dac_read_search, capability mknod, capability setgid, capability setuid, capability sys_admin, @{exec_path} mr, @{PROC}/@{pids}/task/@{tid}/status r, owner @{PROC}/@{pid}/mounts r, @{PROC}/@{pids}/mountinfo r, @{PROC}/swaps r, /dev/fuse rw, # Mount points @{MOUNTS}/*/ r, @{MOUNTS}/*/*/ r, # Allow to mount ntfs disks only under the /media/, /run/media, and /mnt/ dirs mount fstype=fuseblk /dev/sd[a-z][0-9]* -> @{MOUNTS}/*/, mount fstype=fuseblk /dev/sd[a-z][0-9]* -> @{MOUNTS}/*/*/, mount fstype=fuseblk /dev/sd[a-z][0-9]* -> /mnt/, mount fstype=fuseblk /dev/sd[a-z][0-9]* -> /mnt/*/, mount fstype=fuseblk /dev/mmcblk[0-9]*p[0-9]* -> @{MOUNTS}/*/, mount fstype=fuseblk /dev/mmcblk[0-9]*p[0-9]* -> @{MOUNTS}/*/*/, # Allow to mount encrypted partition mount fstype=fuseblk /dev/dm-[0-9]* -> @{MOUNTS}/*/, mount fstype=fuseblk /dev/dm-[0-9]* -> @{MOUNTS}/*/*/, mount fstype=fuseblk /dev/dm-[0-9]* -> /mnt/, mount fstype=fuseblk /dev/dm-[0-9]* -> /mnt/*/, # kmod is used to load the fuse kernel module /{usr/,}bin/kmod rPx, include if exists }