usr.sbin.libvirtd 1.6 KB
Newer Older
J
Jamie Strandboge 已提交
1
# Last Modified: Mon Apr  5 15:03:58 2010
2 3 4 5 6
#include <tunables/global>
@{LIBVIRT}="libvirt"

/usr/sbin/libvirtd {
  #include <abstractions/base>
F
Felix Geyer 已提交
7
  #include <abstractions/dbus>
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24

  capability kill,
  capability net_admin,
  capability net_raw,
  capability setgid,
  capability sys_admin,
  capability sys_module,
  capability sys_ptrace,
  capability sys_nice,
  capability sys_chroot,
  capability setuid,
  capability dac_override,
  capability dac_read_search,
  capability fowner,
  capability chown,
  capability setpcap,
  capability mknod,
J
Jamie Strandboge 已提交
25
  capability fsetid,
F
Felix Geyer 已提交
26
  capability audit_write,
27

28 29 30
  # Needed for vfio
  capability sys_resource,

31
  network inet stream,
J
Jamie Strandboge 已提交
32 33 34
  network inet dgram,
  network inet6 stream,
  network inet6 dgram,
F
Felix Geyer 已提交
35
  network packet dgram,
36 37 38

  # Very lenient profile for libvirtd since we want to first focus on confining
  # the guests. Guests will have a very restricted profile.
F
Felix Geyer 已提交
39
  / r,
40 41
  /** rwmkl,

F
Felix Geyer 已提交
42 43 44 45 46 47
  /bin/* PUx,
  /sbin/* PUx,
  /usr/bin/* PUx,
  /usr/sbin/* PUx,
  /lib/udev/scsi_id PUx,
  /usr/lib/xen-common/bin/xen-toolstack PUx,
48 49 50 51 52 53 54 55

  # force the use of virt-aa-helper
  audit deny /sbin/apparmor_parser rwxl,
  audit deny /etc/apparmor.d/libvirt/** wxl,
  audit deny /sys/kernel/security/apparmor/features rwxl,
  audit deny /sys/kernel/security/apparmor/matching rwxl,
  audit deny /sys/kernel/security/apparmor/.* rwxl,
  /sys/kernel/security/apparmor/profiles r,
J
Jamie Strandboge 已提交
56
  /usr/lib/libvirt/* PUxr,
F
Felix Geyer 已提交
57 58
  /etc/libvirt/hooks/** rmix,
  /etc/xen/scripts/** rmix,
59 60 61 62 63

  # allow changing to our UUID-based named profiles
  change_profile -> @{LIBVIRT}-[0-9a-f]*-[0-9a-f]*-[0-9a-f]*-[0-9a-f]*-[0-9a-f]*,

}