mirror of
https://github.com/roddhjav/apparmor.d.git
synced 2024-11-14 23:43:56 +01:00
feat(systemd): add systemd-home{d,work}
This commit is contained in:
parent
da5a3fc6a2
commit
c2076a213b
84
apparmor.d/groups/systemd/systemd-homed
Normal file
84
apparmor.d/groups/systemd/systemd-homed
Normal file
@ -0,0 +1,84 @@
|
||||
# apparmor.d - Full set of apparmor profiles
|
||||
# Copyright (C) 2022 Alexandre Pujol <alexandre@pujol.io>
|
||||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
|
||||
abi <abi/3.0>,
|
||||
|
||||
include <tunables/global>
|
||||
|
||||
@{exec_path} = /{usr/,}lib/systemd/systemd-homed
|
||||
profile systemd-homed @{exec_path} flags=(attach_disconnected) {
|
||||
include <abstractions/base>
|
||||
include <abstractions/dbus-strict>
|
||||
include <abstractions/disks-write>
|
||||
include <abstractions/nameservice-strict>
|
||||
include <abstractions/openssl>
|
||||
include <abstractions/systemd-common>
|
||||
|
||||
capability chown,
|
||||
capability dac_override,
|
||||
capability dac_read_search,
|
||||
capability fowner,
|
||||
capability fsetid,
|
||||
capability setfcap,
|
||||
capability setgid,
|
||||
capability setpcap,
|
||||
capability setuid,
|
||||
capability sys_admin,
|
||||
capability sys_resource,
|
||||
|
||||
network inet dgram,
|
||||
network inet6 dgram,
|
||||
network inet raw,
|
||||
network inet6 raw,
|
||||
network netlink raw,
|
||||
|
||||
mount options=(rw, rslave) -> @{run}/,
|
||||
mount /dev/dm-[0-9]* -> @{run}/systemd/user-home-mount/,
|
||||
|
||||
dbus bind bus=system name=org.freedesktop.home1,
|
||||
|
||||
@{exec_path} mr,
|
||||
|
||||
/{usr/,}lib/systemd/systemd-homework rPx,
|
||||
/{usr/,}{s,}bin/mkfs.btrfs rPx,
|
||||
/{usr/,}{s,}bin/mkfs.fat rPx,
|
||||
/{usr/,}{s,}bin/mke2fs rPx,
|
||||
|
||||
/etc/machine-id r,
|
||||
/etc/systemd/homed.conf r,
|
||||
/etc/skel/{,**} r,
|
||||
|
||||
/var/lib/systemd/home/{,**} rw,
|
||||
|
||||
/ r,
|
||||
@{HOMEDIRS}/ r,
|
||||
@{HOMEDIRS}/* rw,
|
||||
@{HOMEDIRS}/*.homedir/ rw,
|
||||
|
||||
@{run}/ r,
|
||||
@{run}/cryptsetup/{,*} rwk,
|
||||
@{run}/systemd/home/{,**} rw,
|
||||
@{run}/systemd/userdb/io.systemd.home r,
|
||||
@{run}/systemd/user-home-mount/{,**} rw,
|
||||
|
||||
@{sys}/bus/ r,
|
||||
@{sys}/fs/ r,
|
||||
@{sys}/class/ r,
|
||||
@{sys}/kernel/uevent_seqnum r,
|
||||
@{sys}/devices/**/read_ahead_kb r,
|
||||
|
||||
@{PROC}/devices r,
|
||||
@{PROC}/sysvipc/{shm,sem,msg} r,
|
||||
owner @{PROC}/@{pid}/gid_map w,
|
||||
owner @{PROC}/@{pid}/mountinfo r,
|
||||
owner @{PROC}/@{pid}/uid_map w,
|
||||
|
||||
/dev/loop-control rwk,
|
||||
/dev/loop[0-9]* rw,
|
||||
/dev/mapper/control rw,
|
||||
/dev/mqueue/ r,
|
||||
/dev/shm/ r,
|
||||
|
||||
include if exists <local/systemd-homed>
|
||||
}
|
22
apparmor.d/groups/systemd/systemd-homework
Normal file
22
apparmor.d/groups/systemd/systemd-homework
Normal file
@ -0,0 +1,22 @@
|
||||
# apparmor.d - Full set of apparmor profiles
|
||||
# Copyright (C) 2022 Alexandre Pujol <alexandre@pujol.io>
|
||||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
|
||||
abi <abi/3.0>,
|
||||
|
||||
include <tunables/global>
|
||||
|
||||
@{exec_path} = /{usr/,}lib/systemd/systemd-homework
|
||||
profile systemd-homework @{exec_path} {
|
||||
include <abstractions/base>
|
||||
include <abstractions/nameservice-strict>
|
||||
include <abstractions/systemd-common>
|
||||
|
||||
@{exec_path} mr,
|
||||
|
||||
/etc/machine-id r,
|
||||
|
||||
@{run}/systemd/userdb/ r,
|
||||
|
||||
include if exists <local/systemd-homework>
|
||||
}
|
@ -213,6 +213,8 @@ systemd-coredump attach_disconnected,complain
|
||||
systemd-dissect complain
|
||||
systemd-environment-d-generator complain
|
||||
systemd-escape complain
|
||||
systemd-homed attach_disconnected,complain
|
||||
systemd-homework complain
|
||||
systemd-hostnamed attach_disconnected,complain
|
||||
systemd-hwdb attach_disconnected,complain
|
||||
systemd-id128 complain
|
||||
|
Loading…
Reference in New Issue
Block a user