1svirt_selinux(8)             SELinux Policy svirt             svirt_selinux(8)
2
3
4

NAME

6       svirt_selinux - Security Enhanced Linux Policy for the svirt processes
7

DESCRIPTION

9       Security-Enhanced Linux secures the svirt processes via flexible manda‐
10       tory access control.
11
12       The svirt processes execute with the  svirt_t  SELinux  type.  You  can
13       check  if  you have these processes running by executing the ps command
14       with the -Z qualifier.
15
16       For example:
17
18       ps -eZ | grep svirt_t
19
20
21

ENTRYPOINTS

23       The svirt_t SELinux type can be entered via the qemu_exec_t file type.
24
25       The default entrypoint paths for the svirt_t domain are the following:
26
27       /usr/libexec/qemu.*,      /usr/bin/qemu-system-.*,       /usr/bin/qemu,
28       /usr/bin/qemu-kvm
29

PROCESS TYPES

31       SELinux defines process types (domains) for each process running on the
32       system
33
34       You can see the context of a process using the -Z option to ps
35
36       Policy governs the access confined processes have  to  files.   SELinux
37       svirt  policy is very flexible allowing users to setup their svirt pro‐
38       cesses in as secure a method as possible.
39
40       The following process types are defined for svirt:
41
42       svirt_t, svirt_tcg_t, svirt_qemu_net_t, svirt_socket_t, svirt_kvm_net_t
43
44       Note: semanage permissive -a svirt_t can be used to  make  the  process
45       type  svirt_t  permissive.  SELinux  does not deny access to permissive
46       process types, but the AVC (SELinux denials) messages are still  gener‐
47       ated.
48
49

MCS Constrained

51       The  SELinux  process  type svirt_t is an MCS (Multi Category Security)
52       constrained type.  Sometimes this separation is referred to  as  sVirt.
53       These  types  are  usually used for securing multi-tenant environments,
54       such as virtualization, containers or separation of users.   The  tools
55       used  to  launch  MCS  types,  pick  out a different MCS label for each
56       process group.
57
58       For example one process might be launched  with  svirt_t:s0:c1,c2,  and
59       another process launched with svirt_t:s0:c3,c4. The SELinux kernel only
60       allows these processes can only write to content with  a  matching  MCS
61       label,  or  a  MCS Label of s0. A process running with the MCS level of
62       s0:c1,c2 is not allowed to write to  content  with  the  MCS  label  of
63       s0:c3,c4
64
65

BOOLEANS

67       SELinux  policy  is customizable based on least access required.  svirt
68       policy is extremely flexible and has several booleans that allow you to
69       manipulate the policy and run svirt with the tightest access possible.
70
71
72
73       If  you  want  to deny any process from ptracing or debugging any other
74       processes, you  must  turn  on  the  deny_ptrace  boolean.  Enabled  by
75       default.
76
77       setsebool -P deny_ptrace 1
78
79
80
81       If  you  want  to  allow  any  process  to mmap any file on system with
82       attribute file_type, you must turn on the  domain_can_mmap_files  bool‐
83       ean. Enabled by default.
84
85       setsebool -P domain_can_mmap_files 1
86
87
88
89       If  you want to allow all domains write to kmsg_device, while kernel is
90       executed with systemd.log_target=kmsg parameter, you must turn  on  the
91       domain_can_write_kmsg boolean. Disabled by default.
92
93       setsebool -P domain_can_write_kmsg 1
94
95
96
97       If you want to allow all domains to use other domains file descriptors,
98       you must turn on the domain_fd_use boolean. Enabled by default.
99
100       setsebool -P domain_fd_use 1
101
102
103
104       If you want to allow all domains to have the kernel load  modules,  you
105       must  turn  on  the  domain_kernel_load_modules  boolean.  Disabled  by
106       default.
107
108       setsebool -P domain_kernel_load_modules 1
109
110
111
112       If you want to allow all domains to execute in fips_mode, you must turn
113       on the fips_mode boolean. Enabled by default.
114
115       setsebool -P fips_mode 1
116
117
118
119       If you want to enable reading of urandom for all domains, you must turn
120       on the global_ssp boolean. Disabled by default.
121
122       setsebool -P global_ssp 1
123
124
125
126       If you want to allow confined virtual  guests  to  use  serial/parallel
127       communication  ports,  you must turn on the virt_use_comm boolean. Dis‐
128       abled by default.
129
130       setsebool -P virt_use_comm 1
131
132
133
134       If you want to allow confined virtual guests to use  executable  memory
135       and  executable  stack,  you must turn on the virt_use_execmem boolean.
136       Disabled by default.
137
138       setsebool -P virt_use_execmem 1
139
140
141
142       If you want to allow confined virtual guests to read  fuse  files,  you
143       must turn on the virt_use_fusefs boolean. Disabled by default.
144
145       setsebool -P virt_use_fusefs 1
146
147
148
149       If  you want to allow confined virtual guests to use glusterd, you must
150       turn on the virt_use_glusterd boolean. Disabled by default.
151
152       setsebool -P virt_use_glusterd 1
153
154
155
156       If you want to allow confined virtual guests to manage nfs  files,  you
157       must turn on the virt_use_nfs boolean. Disabled by default.
158
159       setsebool -P virt_use_nfs 1
160
161
162
163       If  you  want  to  allow confined virtual guests to interact with rawip
164       sockets, you must turn  on  the  virt_use_rawip  boolean.  Disabled  by
165       default.
166
167       setsebool -P virt_use_rawip 1
168
169
170
171       If  you want to allow confined virtual guests to manage cifs files, you
172       must turn on the virt_use_samba boolean. Disabled by default.
173
174       setsebool -P virt_use_samba 1
175
176
177
178       If you want to allow confined virtual guests to interact with the  san‐
179       lock,  you  must  turn  on  the  virt_use_sanlock  boolean. Disabled by
180       default.
181
182       setsebool -P virt_use_sanlock 1
183
184
185
186       If you want to allow confined virtual guests to use  usb  devices,  you
187       must turn on the virt_use_usb boolean. Enabled by default.
188
189       setsebool -P virt_use_usb 1
190
191
192
193       If  you  want  to  allow  confined  virtual guests to interact with the
194       xserver, you must turn on the  virt_use_xserver  boolean.  Disabled  by
195       default.
196
197       setsebool -P virt_use_xserver 1
198
199
200

MANAGED FILES

202       The SELinux process type svirt_t can manage files labeled with the fol‐
203       lowing file types.  The paths listed are the default  paths  for  these
204       file types.  Note the processes UID still need to have DAC permissions.
205
206       anon_inodefs_t
207
208
209       cifs_t
210
211
212       dosfs_t
213
214
215       fusefs_t
216
217            /var/run/user/[^/]*/gvfs
218
219       glusterd_var_run_t
220
221            /var/run/gluster(/.*)?
222            /var/run/glusterd.*
223            /var/run/glusterd.*
224            /var/run/glusterd(/.*)?
225
226       nfs_t
227
228
229       qemu_var_run_t
230
231            /var/lib/libvirt/qemu(/.*)?
232            /var/run/libvirt/qemu(/.*)?
233
234       svirt_home_t
235
236            /home/[^/]+/.libvirt/qemu(/.*)?
237            /home/[^/]+/.cache/libvirt/qemu(/.*)?
238            /home/[^/]+/.config/libvirt/qemu(/.*)?
239            /home/[^/]+/.local/share/libvirt/boot(/.*)?
240            /home/[^/]+/.local/share/libvirt/images(/.*)?
241            /home/[^/]+/.local/share/gnome-boxes/images(/.*)?
242
243       svirt_image_t
244
245
246       svirt_tmp_t
247
248
249       svirt_tmpfs_t
250
251
252       usbfs_t
253
254
255       virt_cache_t
256
257            /var/cache/oz(/.*)?
258            /var/cache/libvirt(/.*)?
259
260

FILE CONTEXTS

262       SELinux requires files to have an extended attribute to define the file
263       type.
264
265       You can see the context of a file using the -Z option to ls
266
267       Policy governs the access  confined  processes  have  to  these  files.
268       SELinux  svirt  policy  is  very flexible allowing users to setup their
269       svirt processes in as secure a method as possible.
270
271       STANDARD FILE CONTEXT
272
273       SELinux defines the file context types for the svirt, if you wanted  to
274       store  files  with  these types in a diffent paths, you need to execute
275       the semanage command  to  sepecify  alternate  labeling  and  then  use
276       restorecon to put the labels on disk.
277
278       semanage fcontext -a -t svirt_tmpfs_t '/srv/mysvirt_content(/.*)?'
279       restorecon -R -v /srv/mysvirt_content
280
281       Note:  SELinux  often  uses  regular expressions to specify labels that
282       match multiple files.
283
284       The following file types are defined for svirt:
285
286
287
288       svirt_home_t
289
290       - Set files with the svirt_home_t type, if  you  want  to  store  svirt
291       files in the users home directory.
292
293
294       Paths:
295            /home/[^/]+/.libvirt/qemu(/.*)?,           /home/[^/]+/.cache/lib‐
296            virt/qemu(/.*)?,           /home/[^/]+/.config/libvirt/qemu(/.*)?,
297            /home/[^/]+/.local/share/libvirt/boot(/.*)?,
298            /home/[^/]+/.local/share/libvirt/images(/.*)?,
299            /home/[^/]+/.local/share/gnome-boxes/images(/.*)?
300
301
302       svirt_image_t
303
304       - Set files with the svirt_image_t type, if you want to treat the files
305       as svirt image data.
306
307
308
309       svirt_tmp_t
310
311       - Set files with the svirt_tmp_t type, if you want to store svirt  tem‐
312       porary files in the /tmp directories.
313
314
315
316       svirt_tmpfs_t
317
318       -  Set  files  with  the svirt_tmpfs_t type, if you want to store svirt
319       files on a tmpfs file system.
320
321
322
323       Note: File context can be temporarily modified with the chcon  command.
324       If  you want to permanently change the file context you need to use the
325       semanage fcontext command.  This will modify the SELinux labeling data‐
326       base.  You will need to use restorecon to apply the labels.
327
328

COMMANDS

330       semanage  fcontext  can also be used to manipulate default file context
331       mappings.
332
333       semanage permissive can also be used to manipulate  whether  or  not  a
334       process type is permissive.
335
336       semanage  module can also be used to enable/disable/install/remove pol‐
337       icy modules.
338
339       semanage boolean can also be used to manipulate the booleans
340
341
342       system-config-selinux is a GUI tool available to customize SELinux pol‐
343       icy settings.
344
345

AUTHOR

347       This manual page was auto-generated using sepolicy manpage .
348
349

SEE ALSO

351       selinux(8), svirt(8), semanage(8), restorecon(8), chcon(1), sepolicy(8)
352       ,  setsebool(8),  svirt_kvm_net_selinux(8),   svirt_kvm_net_selinux(8),
353       svirt_qemu_net_selinux(8),                   svirt_qemu_net_selinux(8),
354       svirt_socket_selinux(8), svirt_socket_selinux(8), svirt_tcg_selinux(8),
355       svirt_tcg_selinux(8)
356
357
358
359svirt                              19-04-25                   svirt_selinux(8)
Impressum