2010-04-07 00:56:07 +04:00
# Last Modified: Mon Apr 5 15:10:27 2010
2009-10-08 18:42:05 +04:00
#include <tunables/global>
2014-12-15 17:14:48 +03:00
profile virt-aa-helper /usr/{lib,lib64}/libvirt/virt-aa-helper {
2009-10-08 18:42:05 +04:00
#include <abstractions/base>
# needed for searching directories
capability dac_override,
capability dac_read_search,
# needed for when disk is on a network filesystem
network inet,
2017-11-03 11:46:59 +03:00
network inet6,
2009-10-08 18:42:05 +04:00
deny @{PROC}/[0-9]*/mounts r,
2014-01-27 01:47:35 +04:00
@{PROC}/[0-9]*/net/psched r,
owner @{PROC}/[0-9]*/status r,
2009-10-08 18:42:05 +04:00
@{PROC}/filesystems r,
2017-05-18 11:53:42 +03:00
/etc/libnl-3/classid r,
2010-04-07 00:56:07 +04:00
# for hostdev
/sys/devices/ r,
/sys/devices/** r,
2017-12-20 13:56:43 +03:00
/sys/bus/usb/devices/ r,
2017-05-18 11:53:43 +03:00
deny /dev/sd* r,
deny /dev/vd* r,
deny /dev/dm-* r,
deny /dev/drbd[0-9]* r,
deny /dev/dasd* r,
deny /dev/nvme* r,
deny /dev/zd[0-9]* r,
deny /dev/mapper/ r,
deny /dev/mapper/* r,
2010-04-07 00:56:07 +04:00
2014-12-15 17:14:48 +03:00
/usr/{lib,lib64}/libvirt/virt-aa-helper mr,
2016-12-03 21:32:48 +03:00
/{usr/,}sbin/apparmor_parser Ux,
2009-10-08 18:42:05 +04:00
/etc/apparmor.d/libvirt/* r,
/etc/apparmor.d/libvirt/libvirt-[0-9a-f]*-[0-9a-f]*-[0-9a-f]*-[0-9a-f]*-[0-9a-f]* rw,
2010-04-07 00:56:07 +04:00
# for backingstore -- allow access to non-hidden files in @{HOME} as well
# as storage pools
audit deny @{HOME}/.* mrwkl,
audit deny @{HOME}/.*/ rw,
audit deny @{HOME}/.*/** mrwkl,
audit deny @{HOME}/bin/ rw,
audit deny @{HOME}/bin/** mrwkl,
@{HOME}/ r,
@{HOME}/** r,
/var/lib/libvirt/images/ r,
/var/lib/libvirt/images/** r,
2014-01-27 01:47:35 +04:00
/{media,mnt,opt,srv}/** r,
2017-12-11 13:09:31 +03:00
# For virt-sandbox
2018-01-02 11:54:46 +03:00
/{,var/}run/libvirt/**/[sv]d[a-z] r,
2014-01-27 01:47:35 +04:00
/**.img r,
2017-12-11 13:09:31 +03:00
/**.raw r,
2014-01-27 01:47:35 +04:00
/**.qcow{,2} r,
/**.qed r,
/**.vmdk r,
/**.[iI][sS][oO] r,
/**/disk{,.*} r,
2017-12-11 13:09:31 +03:00
#include <local/usr.lib.libvirt.virt-aa-helper>
2009-10-08 18:42:05 +04:00
}