1svirt_selinux(8) SELinux Policy svirt svirt_selinux(8)
2
3
4
6 svirt_selinux - Security Enhanced Linux Policy for the svirt processes
7
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
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
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
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
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 allow all domains to execute in fips_mode, you must turn
74 on the fips_mode boolean. Enabled by default.
75
76 setsebool -P fips_mode 1
77
78
79
80 If you want to allow confined virtual guests to use executable memory
81 and executable stack, you must turn on the virt_use_execmem boolean.
82 Disabled by default.
83
84 setsebool -P virt_use_execmem 1
85
86
87
88 If you want to allow confined virtual guests to interact with rawip
89 sockets, you must turn on the virt_use_rawip boolean. Disabled by
90 default.
91
92 setsebool -P virt_use_rawip 1
93
94
95
97 The SELinux process type svirt_t can manage files labeled with the fol‐
98 lowing file types. The paths listed are the default paths for these
99 file types. Note the processes UID still need to have DAC permissions.
100
101 anon_inodefs_t
102
103
104 cephfs_t
105
106
107 cifs_t
108
109
110 dosfs_t
111
112
113 ecryptfs_t
114
115 /home/[^/]+/.Private(/.*)?
116 /home/[^/]+/.ecryptfs(/.*)?
117
118 fusefs_t
119
120 /var/run/user/[^/]*/gvfs
121
122 glusterd_var_run_t
123
124 /var/run/gluster(/.*)?
125 /var/run/glusterd.*
126 /var/run/glusterd.*
127 /var/run/glusterd(/.*)?
128
129 nfs_t
130
131
132 qemu_var_run_t
133
134 /var/lib/libvirt/qemu(/.*)?
135 /var/run/libvirt/qemu(/.*)?
136
137 svirt_home_t
138
139 /home/[^/]+/.libvirt/qemu(/.*)?
140 /home/[^/]+/.cache/libvirt/qemu(/.*)?
141 /home/[^/]+/.config/libvirt/qemu(/.*)?
142 /home/[^/]+/.local/share/libvirt/boot(/.*)?
143 /home/[^/]+/.local/share/libvirt/images(/.*)?
144 /home/[^/]+/.local/share/gnome-boxes/images(/.*)?
145
146 svirt_image_t
147
148
149 svirt_tmp_t
150
151
152 svirt_tmpfs_t
153
154
155 usbfs_t
156
157
158 virt_cache_t
159
160 /var/cache/oz(/.*)?
161 /var/cache/libvirt(/.*)?
162
163
165 SELinux requires files to have an extended attribute to define the file
166 type.
167
168 You can see the context of a file using the -Z option to ls
169
170 Policy governs the access confined processes have to these files.
171 SELinux svirt policy is very flexible allowing users to setup their
172 svirt processes in as secure a method as possible.
173
174 STANDARD FILE CONTEXT
175
176 SELinux defines the file context types for the svirt, if you wanted to
177 store files with these types in a diffent paths, you need to execute
178 the semanage command to sepecify alternate labeling and then use
179 restorecon to put the labels on disk.
180
181 semanage fcontext -a -t svirt_home_t '/srv/mysvirt_content(/.*)?'
182 restorecon -R -v /srv/mysvirt_content
183
184 Note: SELinux often uses regular expressions to specify labels that
185 match multiple files.
186
187 The following file types are defined for svirt:
188
189
190
191 svirt_home_t
192
193 - Set files with the svirt_home_t type, if you want to store svirt
194 files in the users home directory.
195
196
197 Paths:
198 /home/[^/]+/.libvirt/qemu(/.*)?, /home/[^/]+/.cache/lib‐
199 virt/qemu(/.*)?, /home/[^/]+/.config/libvirt/qemu(/.*)?,
200 /home/[^/]+/.local/share/libvirt/boot(/.*)?,
201 /home/[^/]+/.local/share/libvirt/images(/.*)?,
202 /home/[^/]+/.local/share/gnome-boxes/images(/.*)?
203
204
205 svirt_image_t
206
207 - Set files with the svirt_image_t type, if you want to treat the files
208 as svirt image data.
209
210
211
212 svirt_tmp_t
213
214 - Set files with the svirt_tmp_t type, if you want to store svirt tem‐
215 porary files in the /tmp directories.
216
217
218
219 svirt_tmpfs_t
220
221 - Set files with the svirt_tmpfs_t type, if you want to store svirt
222 files on a tmpfs file system.
223
224
225
226 Note: File context can be temporarily modified with the chcon command.
227 If you want to permanently change the file context you need to use the
228 semanage fcontext command. This will modify the SELinux labeling data‐
229 base. You will need to use restorecon to apply the labels.
230
231
233 semanage fcontext can also be used to manipulate default file context
234 mappings.
235
236 semanage permissive can also be used to manipulate whether or not a
237 process type is permissive.
238
239 semanage module can also be used to enable/disable/install/remove pol‐
240 icy modules.
241
242 semanage boolean can also be used to manipulate the booleans
243
244
245 system-config-selinux is a GUI tool available to customize SELinux pol‐
246 icy settings.
247
248
250 This manual page was auto-generated using sepolicy manpage .
251
252
254 selinux(8), svirt(8), semanage(8), restorecon(8), chcon(1), sepol‐
255 icy(8), setsebool(8), svirt_kvm_net_selinux(8),
256 svirt_kvm_net_selinux(8), svirt_qemu_net_selinux(8),
257 svirt_qemu_net_selinux(8), svirt_socket_selinux(8),
258 svirt_socket_selinux(8), svirt_tcg_selinux(8), svirt_tcg_selinux(8)
259
260
261
262svirt 19-12-02 svirt_selinux(8)