apparmor.d/profiles/virt-manager

120 lines
3.2 KiB
Text
Raw Normal View History

# vim:syntax=apparmor
# ------------------------------------------------------------------
#
2021-01-10 16:35:07 +01:00
# Copyright (C) 2020-2021 Mikhail Morfikov
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of version 2 of the GNU General Public
# License published by the Free Software Foundation.
#
# ------------------------------------------------------------------
2020-12-10 22:33:39 +01:00
abi <abi/3.0>,
2020-12-10 22:33:39 +01:00
include <tunables/global>
@{exec_path} = /{usr/,}bin/virt-manager
@{exec_path} += /usr/share/virt-manager/virt-manager
2020-12-10 22:33:39 +01:00
profile virt-manager @{exec_path} {
include <abstractions/base>
2021-01-10 16:35:07 +01:00
include <abstractions/X>
include <abstractions/vulkan>
2020-12-10 22:33:39 +01:00
include <abstractions/gtk>
include <abstractions/fonts>
include <abstractions/fontconfig-cache-read>
include <abstractions/freedesktop.org>
include <abstractions/nameservice-strict>
include <abstractions/ssl_certs>
include <abstractions/openssl>
include <abstractions/audio>
include <abstractions/mesa>
include <abstractions/dri-enumerate>
include <abstractions/thumbnails-cache-read>
include <abstractions/user-download-strict>
2021-01-10 16:35:07 +01:00
include <abstractions/python>
2021-02-13 15:00:16 +01:00
include <abstractions/devices-usb>
2020-12-10 22:33:39 +01:00
include <abstractions/deny-dconf>
network inet stream,
network inet6 stream,
network netlink raw,
@{exec_path} rix,
2020-12-09 10:30:52 +01:00
/{usr/,}bin/{,ba,da}sh rix,
/{usr/,}bin/python3.[0-9]* r,
/{usr/,}bin/ r,
/{usr/,}bin/getfacl rix,
/{usr/,}bin/setfacl rix,
/{usr/,}sbin/libvirtd rPx,
2020-09-18 20:05:47 +02:00
/{usr/,}lib/@{multiarch}/gstreamer[0-9]*.[0-9]*/gstreamer-[0-9]*.[0-9]*/gst-plugin-scanner rPUx,
/usr/share/virt-manager/{,**} r,
owner @{HOME}/ r,
owner @{HOME}/.cache/ rw,
owner @{HOME}/.cache/virt-manager/ rw,
owner @{HOME}/.cache/virt-manager/** rw,
2020-09-18 20:05:47 +02:00
owner @{HOME}/.cache/gstreamer-[0-9]*/ rw,
2021-03-13 09:47:36 +01:00
owner @{HOME}/.cache/gstreamer-[0-9]*/registry.*.bin{,.tmp*} rw,
2020-09-18 20:05:47 +02:00
# For disk images
/media/ r,
/media/*/ r,
@{HOME}/**.{iso,img,bin,mdf,nrg} r,
/media/*/**.{iso,img,bin,mdf,nrg} r,
@{HOME}/**.{ISO,IMG,BIN,MDF,NRG} r,
/media/*/**.{ISO,IMG,BIN,MDF,NRG} r,
# System VM images
#owner /var/lib/libvirt/images/ r,
# User VM images
#owner @{HOME}/.local/share/libvirt/ rw,
#owner @{HOME}/.local/share/libvirt/images/ rw,
#owner @{HOME}/.local/share/libvirt/images/* rw,
#owner /media/*/VM/ r,
/usr/share/glib-2.0/schemas/gschemas.compiled r,
/usr/share/osinfo/{,**} r,
/usr/share/gtksourceview-4/{,**} r,
/usr/share/misc/pci.ids r,
/var/lib/usbutils/usb.ids r,
owner @{PROC}/@{pid}/mountinfo r,
owner @{PROC}/@{pid}/mounts r,
owner @{PROC}/@{pid}/fd/ r,
2020-12-10 22:33:39 +01:00
@{PROC}/@{pid}/net/route r,
@{sys}/devices/pci[0-9]*/**/drm/ r,
/etc/fstab r,
2020-10-25 10:23:34 +01:00
@{run}/mount/utab r,
2020-10-25 10:23:34 +01:00
owner @{run}/user/[0-9]*/libvirt/libvirtd.lock rwk,
@{sys}/devices/system/node/ r,
@{sys}/devices/system/node/node[0-9]*/meminfo r,
/var/lib/dbus/machine-id r,
/etc/machine-id r,
# The orcexec.* file is JIT compiled code for various GStreamer elements.
# If one is blocked the next is used instead.
2020-10-25 10:23:34 +01:00
owner @{run}/user/[0-9]*/orcexec.* mrw,
#owner @{HOME}/orcexec.* mrw,
#owner /tmp/orcexec.* mrw,
# Silecne the noise
deny /usr/share/virt-manager/{,**} w,
2020-12-10 22:33:39 +01:00
include if exists <local/virt-manager>
}