apparmor.d/apparmor.d/profiles-a-f/btrfs

52 lines
1.3 KiB
Text

# apparmor.d - Full set of apparmor profiles
# Copyright (C) 2019-2021 Mikhail Morfikov
# SPDX-License-Identifier: GPL-2.0-only
abi <abi/3.0>,
include <tunables/global>
@{exec_path} = /{usr/,}bin/{btrfs,btrfsck}
profile btrfs @{exec_path} {
include <abstractions/base>
include <abstractions/disks-write>
include <abstractions/user-download-strict>
capability sys_admin,
capability fowner,
capability sys_rawio,
@{exec_path} mr,
@{run}/blkid/blkid.tab{,-*} rw,
@{run}/blkid/blkid.tab.old rwl -> @{run}/blkid/blkid.tab,
owner @{PROC}/@{pid}/mounts r,
@{PROC}/partitions r,
# For fsck of the btrfs filesystem directly from gparted
owner /tmp/gparted-*/ rw,
# For scrub
/var/lib/btrfs/ rw,
/var/lib/btrfs/scrub.progress.@{uuid} rw,
/var/lib/btrfs/scrub.status.@{uuid}{,_tmp} rwk,
# Saved metadata
@{MOUNTS}/ r,
@{MOUNTS}/ext2_saved/ rw,
@{MOUNTS}/ext2_saved/image rw,
@{MOUNTS}/*/ r,
@{MOUNTS}/*/ext2_saved/ rw,
@{MOUNTS}/*/ext2_saved/image rw,
# To be able to manage btrfs volumes
owner @{HOME}/**.{iso,img,bin,mdf,nrg} rwk,
owner @{MOUNTS}/**.{iso,img,bin,mdf,nrg} rwk,
owner @{HOME}/**.{ISO,IMG,BIN,MDF,NRG} rwk,
owner @{MOUNTS}/**.{ISO,IMG,BIN,MDF,NRG} rwk,
/dev/btrfs-control rw,
include if exists <local/btrfs>
}