mirror of
https://github.com/roddhjav/apparmor.d.git
synced 2025-01-31 07:17:22 +01:00
127 lines
2.7 KiB
Text
127 lines
2.7 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/borg
|
|
profile borg @{exec_path} {
|
|
include <abstractions/base>
|
|
include <abstractions/python>
|
|
|
|
capability dac_read_search,
|
|
capability fowner,
|
|
capability sys_admin,
|
|
|
|
network inet dgram,
|
|
network inet6 dgram,
|
|
network netlink raw,
|
|
|
|
@{exec_path} r,
|
|
|
|
/{usr/,}bin/ r,
|
|
/{usr/,}bin/python3.[0-9]* r,
|
|
|
|
/{usr/,}bin/uname rix,
|
|
/{usr/,}bin/cat rix,
|
|
/{usr/,}{s,}bin/ldconfig rix,
|
|
/{usr/,}bin/{,@{multiarch}-}ld.bfd rix,
|
|
|
|
/{usr/,}bin/pass rPUx,
|
|
/{usr/,}bin/ssh rPx,
|
|
/{usr/,}bin/ccache rCx -> ccache,
|
|
/{usr/,}bin/fusermount{,3} rCx -> fusermount,
|
|
|
|
mount fstype=fuse -> @{MOUNTS}/*/,
|
|
mount fstype=fuse -> @{MOUNTS}/*/*/,
|
|
umount @{MOUNTS}/*/,
|
|
umount @{MOUNTS}/*/*/,
|
|
|
|
/dev/fuse rw,
|
|
|
|
owner @{PROC}/@{pid}/fd/ r,
|
|
@{PROC}/sys/kernel/random/boot_id r,
|
|
|
|
@{run}/systemd/userdb/ r,
|
|
@{run}/resolvconf/resolv.conf r,
|
|
|
|
owner @{user_cache_dirs}/ rw,
|
|
owner @{user_cache_dirs}/borg/ rw,
|
|
owner @{user_cache_dirs}/borg/** rw,
|
|
|
|
owner @{user_config_dirs}/borg/ rw,
|
|
owner @{user_config_dirs}/borg/** rw,
|
|
|
|
# If /tmp/ isn't accessible, then /var/tmp/ is used.
|
|
owner /tmp/* rw,
|
|
owner /tmp/tmp*/ rw,
|
|
owner /tmp/tmp*/idx rw,
|
|
owner /tmp/tmp*/file rw,
|
|
owner /tmp/borg-cache-*/ rw,
|
|
owner /tmp/borg-cache-*/* rw,
|
|
owner /var/tmp/* rw,
|
|
owner /var/tmp/tmp*/ rw,
|
|
owner /var/tmp/tmp*/idx rw,
|
|
owner /var/tmp/tmp*/file rw,
|
|
|
|
# Dirs that can be backed up
|
|
/ r,
|
|
/etc/{,**} r,
|
|
/home/{,**} r,
|
|
@{MOUNTS}/{,**} r,
|
|
/root/{,**} r,
|
|
/srv/{,**} r,
|
|
/var/{,**} r,
|
|
|
|
# The backup dirs
|
|
owner @{MOUNTS}/ r,
|
|
owner @{MOUNTS}/** rwkl -> @{MOUNTS}/**,
|
|
|
|
# borg serve on server's side
|
|
owner /home/borg/*/ rw,
|
|
owner /home/borg/*/{,**} rw,
|
|
|
|
# For exporting the key
|
|
owner /**/key w,
|
|
|
|
|
|
profile ccache {
|
|
include <abstractions/base>
|
|
|
|
/{usr/,}bin/ccache mr,
|
|
|
|
/{usr/,}lib/llvm-[0-9]*/bin/clang rix,
|
|
/{usr/,}bin/{,@{multiarch}-}gcc-[0-9]* rix,
|
|
/{usr/,}bin/{,@{multiarch}-}g++-[0-9]* rix,
|
|
|
|
/media/ccache/*/** rw,
|
|
|
|
/etc/debian_version r,
|
|
|
|
}
|
|
|
|
profile fusermount {
|
|
include <abstractions/base>
|
|
include <abstractions/nameservice-strict>
|
|
|
|
# To mount anything:
|
|
capability sys_admin,
|
|
|
|
/{usr/,}bin/fusermount{,3} mr,
|
|
|
|
/etc/fuse.conf r,
|
|
|
|
umount @{MOUNTS}/*/,
|
|
umount @{MOUNTS}/*/*/,
|
|
|
|
@{PROC}/@{pids}/mounts r,
|
|
|
|
/dev/fuse rw,
|
|
}
|
|
|
|
include if exists <usr/borg.d>
|
|
include if exists <local/borg>
|
|
}
|