]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
apparmor: add mediation rules for unconfined guests
authorChristian Ehrhardt <christian.ehrhardt@canonical.com>
Mon, 13 Aug 2018 14:06:04 +0000 (16:06 +0200)
committerChristian Ehrhardt <christian.ehrhardt@canonical.com>
Thu, 16 Aug 2018 10:58:56 +0000 (12:58 +0200)
If a guest runs unconfined <seclabel type='none'>, but libvirtd is
confined then the peer for signal can only be detected as
'unconfined'. That triggers issues like:
   apparmor="DENIED" operation="signal"
   profile="/usr/sbin/libvirtd" pid=22395 comm="libvirtd"
   requested_mask="send" denied_mask="send" signal=term peer="unconfined"

To fix this add unconfined as an allowed peer for those operations.

I discussed with the apparmor folks, right now there is no better
separation to be made in this case. But there might be further down the
road with "policy namespaces with scope and view control + stacking"

This is more a use-case addition than a fix to the following two changes:
3b1d19e6 AppArmor: add rules needed with additional mediation features
b482925c apparmor: support ptrace checks

Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
Acked-by: Jamie Strandboge <jamie@canonical.com>
Acked-by: intrigeri <intrigeri+libvirt@boum.org>
examples/apparmor/usr.sbin.libvirtd

index dd37866c2a4f47aaf3e2e3bbb2eb7c3777640d16..3ff43c32a2be1081c6f2e8cea6ea0281be116ca2 100644 (file)
@@ -74,6 +74,9 @@
   # unconfined also required if guests run without security module
   unix (send, receive) type=stream addr=none peer=(label=unconfined),
 
+  # required if guests run unconfined seclabel type='none' but libvirtd is confined
+  signal (read, send) peer=unconfined,
+
   # Very lenient profile for libvirtd since we want to first focus on confining
   # the guests. Guests will have a very restricted profile.
   / r,