diff --git a/apparmor.d/groups/systemd/systemd-makefs b/apparmor.d/groups/systemd/systemd-makefs new file mode 100644 index 00000000..5fe9812d --- /dev/null +++ b/apparmor.d/groups/systemd/systemd-makefs @@ -0,0 +1,18 @@ +# 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-makefs +profile systemd-makefs @{exec_path} { + include + + @{exec_path} mr, + + /{usr/,}{s,}bin/mkswap rPx, + + include if exists +} \ No newline at end of file diff --git a/apparmor.d/groups/systemd/zram-generator b/apparmor.d/groups/systemd/zram-generator new file mode 100644 index 00000000..b8043e25 --- /dev/null +++ b/apparmor.d/groups/systemd/zram-generator @@ -0,0 +1,26 @@ +# 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/system-generators/zram-generator +profile zram-generator @{exec_path} { + include + include + + @{exec_path} mr, + + /{usr/,}lib/systemd-makefs rPx, + /{usr/,}bin/systemd-detect-virt rPx, + + @{sys}/devices/virtual/block/zram[0-9]*/{disksize,reset} rw, + + owner @{run}/systemd/generator/systemd-zram-setup@zram[0-9]*.service.d/{,*.conf} rw, + owner @{run}/systemd/generator/dev-zram[0-9]*.swap rw, + owner @{run}/systemd/generator/swap.target.wants/{,dev-zram[0-9]*.swap} rw, + + include if exists +} \ No newline at end of file