From a8a1f3b29aff05bed0f1540af042667d59597b8c Mon Sep 17 00:00:00 2001 From: Alexandre Pujol Date: Tue, 29 Jun 2021 20:03:06 +0100 Subject: [PATCH] Add virtlogd profile. --- apparmor.d/groups/virt/virtlogd | 35 +++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 apparmor.d/groups/virt/virtlogd diff --git a/apparmor.d/groups/virt/virtlogd b/apparmor.d/groups/virt/virtlogd new file mode 100644 index 00000000..af917ee0 --- /dev/null +++ b/apparmor.d/groups/virt/virtlogd @@ -0,0 +1,35 @@ +# apparmor.d - Full set of apparmor profiles +# Copyright (C) 2021 Alexandre Pujol +# SPDX-License-Identifier: GPL-2.0-only + +abi , + +include + +@{exec_path} = /{usr/,}bin/virtlogd +profile virtlogd @{exec_path} { + include + include + include + + ptrace (read) peer=libvirtd, + ptrace (read) peer=unconfined, + + @{exec_path} mr, + + /etc/libvirt/virtlogd.conf r, + + /var/log/libvirt/qemu/*.log rw, + + @{run}/virtlogd.pid rwk, + + @{sys}/devices/system/node/ r, + @{sys}/devices/system/node/node[0-9]*/meminfo r, + + owner @{PROC}/@{pid}/stat r, + @{PROC}/1/environ r, + @{PROC}/cmdline r, + @{PROC}/sys/kernel/osrelease r, + + include if exists +} \ No newline at end of file