From ba0706a2d2217c879f3b132895fd19d2a7c3a47c Mon Sep 17 00:00:00 2001 From: Alexandre Pujol Date: Thu, 7 Oct 2021 15:01:40 +0100 Subject: [PATCH] Add systemd-user-runtime-dir. --- .../groups/systemd/systemd-user-runtime-dir | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 apparmor.d/groups/systemd/systemd-user-runtime-dir diff --git a/apparmor.d/groups/systemd/systemd-user-runtime-dir b/apparmor.d/groups/systemd/systemd-user-runtime-dir new file mode 100644 index 000000000..3be09dd3d --- /dev/null +++ b/apparmor.d/groups/systemd/systemd-user-runtime-dir @@ -0,0 +1,34 @@ +# apparmor.d - Full set of apparmor profiles +# Copyright (C) 2021 Alexandre Pujol +# SPDX-License-Identifier: GPL-2.0-only + +abi , + +include + +@{exec_path} = /{usr/,}lib/systemd/systemd-user-runtime-dir +profile systemd-user-runtime-dir @{exec_path} { + include + include + + capability dac_override, + capability dac_read_search, + capability fowner, + capability net_admin, + capability sys_admin, + + ptrace (read) peer=unconfined, + + mount fstype=tmpfs options=(rw,nosuid,nodev) -> @{run}/user/@{uid}/, + umount @{run}/user/@{uid}/, + + @{exec_path} mr, + + @{run}/user/@{uid}/{,**} rw, + + @{PROC}/1/environ r, + @{PROC}/cmdline r, + @{PROC}/sys/kernel/osrelease r, + + include if exists +} \ No newline at end of file