libvirt-qemu 4.3 KB
Newer Older
1
# Last Modified: Wed Sep 3 21:52:03 2014
2 3 4 5 6 7 8 9 10 11

  #include <abstractions/base>
  #include <abstractions/consoles>
  #include <abstractions/nameservice>

  # required for reading disk images
  capability dac_override,
  capability dac_read_search,
  capability chown,

F
Felix Geyer 已提交
12 13 14 15
  # needed to drop privileges
  capability setgid,
  capability setuid,

16 17 18 19 20 21 22
  network inet stream,
  network inet6 stream,

  /dev/net/tun rw,
  /dev/kvm rw,
  /dev/ptmx rw,
  /dev/kqemu rw,
J
Jamie Strandboge 已提交
23
  @{PROC}/*/status r,
24 25 26
  # Per man(5) proc, the kernel enforces that a thread may
  # only modify its comm value or those in its thread group.
  owner @{PROC}/@{pid}/task/@{tid}/comm rw,
27
  @{PROC}/sys/kernel/cap_last_cap r,
28

J
Jamie Strandboge 已提交
29 30
  # For hostdev access. The actual devices will be added dynamically
  /sys/bus/usb/devices/ r,
F
Felix Geyer 已提交
31
  /sys/devices/**/usb[0-9]*/** r,
32

J
Jamie Strandboge 已提交
33 34 35 36 37
  # WARNING: this gives the guest direct access to host hardware and specific
  # portions of shared memory. This is required for sound using ALSA with kvm,
  # but may constitute a security risk. If your environment does not require
  # the use of sound in your VMs, feel free to comment out or prepend 'deny' to
  # the rules for files in /dev.
38 39 40
  /{dev,run}/shm r,
  /{dev,run}/shmpulse-shm* r,
  /{dev,run}/shmpulse-shm* rwk,
J
Jamie Strandboge 已提交
41 42
  /dev/snd/* rw,
  capability ipc_lock,
F
Felix Geyer 已提交
43 44
  # spice
  owner /{dev,run}/shm/spice.* rw,
J
Jamie Strandboge 已提交
45 46 47 48
  # 'kill' is not required for sound and is a security risk. Do not enable
  # unless you absolutely need it.
  deny capability kill,

J
Jamie Strandboge 已提交
49 50 51
  # Uncomment the following if you need access to /dev/fb*
  #/dev/fb* rw,

J
Jamie Strandboge 已提交
52 53 54 55 56 57 58 59 60 61 62
  /etc/pulse/client.conf r,
  @{HOME}/.pulse-cookie rwk,
  owner /root/.pulse-cookie rwk,
  owner /root/.pulse/ rw,
  owner /root/.pulse/* rw,
  /usr/share/alsa/** r,
  owner /tmp/pulse-*/ rw,
  owner /tmp/pulse-*/* rw,
  /var/lib/dbus/machine-id r,

  # access to firmware's etc
63 64
  /usr/share/kvm/** r,
  /usr/share/qemu/** r,
65
  /usr/share/qemu-kvm/** r,
66 67 68 69 70
  /usr/share/bochs/** r,
  /usr/share/openbios/** r,
  /usr/share/openhackware/** r,
  /usr/share/proll/** r,
  /usr/share/vgabios/** r,
J
Jamie Strandboge 已提交
71
  /usr/share/seabios/** r,
F
Felix Geyer 已提交
72
  /usr/share/ovmf/** r,
J
Jamie Strandboge 已提交
73 74 75

  # access PKI infrastructure
  /etc/pki/libvirt-vnc/** r,
76 77 78 79

  # the various binaries
  /usr/bin/kvm rmix,
  /usr/bin/qemu rmix,
80
  /usr/bin/qemu-kvm rmix,
81 82
  /usr/bin/qemu-system-aarch64 rmix,
  /usr/bin/qemu-system-alpha rmix,
83 84 85
  /usr/bin/qemu-system-arm rmix,
  /usr/bin/qemu-system-cris rmix,
  /usr/bin/qemu-system-i386 rmix,
86
  /usr/bin/qemu-system-lm32 rmix,
87
  /usr/bin/qemu-system-m68k rmix,
88 89
  /usr/bin/qemu-system-microblaze rmix,
  /usr/bin/qemu-system-microblazeel rmix,
90 91 92 93
  /usr/bin/qemu-system-mips rmix,
  /usr/bin/qemu-system-mips64 rmix,
  /usr/bin/qemu-system-mips64el rmix,
  /usr/bin/qemu-system-mipsel rmix,
94 95
  /usr/bin/qemu-system-moxie rmix,
  /usr/bin/qemu-system-or32 rmix,
96 97 98
  /usr/bin/qemu-system-ppc rmix,
  /usr/bin/qemu-system-ppc64 rmix,
  /usr/bin/qemu-system-ppcemb rmix,
99
  /usr/bin/qemu-system-s390x rmix,
100 101 102 103
  /usr/bin/qemu-system-sh4 rmix,
  /usr/bin/qemu-system-sh4eb rmix,
  /usr/bin/qemu-system-sparc rmix,
  /usr/bin/qemu-system-sparc64 rmix,
104 105
  /usr/bin/qemu-system-tricore rmix,
  /usr/bin/qemu-system-unicore32 rmix,
106
  /usr/bin/qemu-system-x86_64 rmix,
107 108 109
  /usr/bin/qemu-system-xtensa rmix,
  /usr/bin/qemu-system-xtensaeb rmix,
  /usr/bin/qemu-aarch64 rmix,
110 111 112 113 114 115
  /usr/bin/qemu-alpha rmix,
  /usr/bin/qemu-arm rmix,
  /usr/bin/qemu-armeb rmix,
  /usr/bin/qemu-cris rmix,
  /usr/bin/qemu-i386 rmix,
  /usr/bin/qemu-m68k rmix,
116 117
  /usr/bin/qemu-microblaze rmix,
  /usr/bin/qemu-microblazeel rmix,
118
  /usr/bin/qemu-mips rmix,
119 120
  /usr/bin/qemu-mips64 rmix,
  /usr/bin/qemu-mips64el rmix,
121
  /usr/bin/qemu-mipsel rmix,
122 123 124 125
  /usr/bin/qemu-mipsn32 rmix,
  /usr/bin/qemu-mipsn32el rmix,
  /usr/bin/qemu-nbd rmix,
  /usr/bin/qemu-or32 rmix,
126 127 128
  /usr/bin/qemu-ppc rmix,
  /usr/bin/qemu-ppc64 rmix,
  /usr/bin/qemu-ppc64abi32 rmix,
129 130
  /usr/bin/qemu-ppc64le rmix,
  /usr/bin/qemu-s390x rmix,
131 132 133 134 135
  /usr/bin/qemu-sh4 rmix,
  /usr/bin/qemu-sh4eb rmix,
  /usr/bin/qemu-sparc rmix,
  /usr/bin/qemu-sparc32plus rmix,
  /usr/bin/qemu-sparc64 rmix,
136
  /usr/bin/qemu-unicore32 rmix,
137
  /usr/bin/qemu-x86_64 rmix,
138
  /usr/{lib,lib64}/qemu/block-curl.so mr,
139
  /usr/{lib,lib64}/qemu/block-rbd.so mr,
J
Jamie Strandboge 已提交
140 141

  # for save and resume
I
intrigeri 已提交
142 143 144
  /{usr/,}bin/dash rmix,
  /{usr/,}bin/dd rmix,
  /{usr/,}bin/cat rmix,
145

146
  # for restore
I
intrigeri 已提交
147
  /{usr/,}bin/bash rmix,
148

F
Felix Geyer 已提交
149 150 151 152 153
  # for usb access
  /dev/bus/usb/ r,
  /etc/udev/udev.conf r,
  /sys/bus/ r,
  /sys/class/ r,