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 cifs_t
105
106
107 dosfs_t
108
109
110 fusefs_t
111
112 /var/run/user/[^/]*/gvfs
113
114 glusterd_var_run_t
115
116 /var/run/gluster(/.*)?
117 /var/run/glusterd.*
118 /var/run/glusterd.*
119 /var/run/glusterd(/.*)?
120
121 nfs_t
122
123
124 qemu_var_run_t
125
126 /var/lib/libvirt/qemu(/.*)?
127 /var/run/libvirt/qemu(/.*)?
128
129 svirt_home_t
130
131 /home/[^/]+/.libvirt/qemu(/.*)?
132 /home/[^/]+/.cache/libvirt/qemu(/.*)?
133 /home/[^/]+/.config/libvirt/qemu(/.*)?
134 /home/[^/]+/.local/share/libvirt/boot(/.*)?
135 /home/[^/]+/.local/share/libvirt/images(/.*)?
136 /home/[^/]+/.local/share/gnome-boxes/images(/.*)?
137
138 svirt_image_t
139
140
141 svirt_tmp_t
142
143
144 svirt_tmpfs_t
145
146
147 usbfs_t
148
149
150 virt_cache_t
151
152 /var/cache/oz(/.*)?
153 /var/cache/libvirt(/.*)?
154
155
157 SELinux requires files to have an extended attribute to define the file
158 type.
159
160 You can see the context of a file using the -Z option to ls
161
162 Policy governs the access confined processes have to these files.
163 SELinux svirt policy is very flexible allowing users to setup their
164 svirt processes in as secure a method as possible.
165
166 STANDARD FILE CONTEXT
167
168 SELinux defines the file context types for the svirt, if you wanted to
169 store files with these types in a diffent paths, you need to execute
170 the semanage command to sepecify alternate labeling and then use
171 restorecon to put the labels on disk.
172
173 semanage fcontext -a -t svirt_home_t '/srv/mysvirt_content(/.*)?'
174 restorecon -R -v /srv/mysvirt_content
175
176 Note: SELinux often uses regular expressions to specify labels that
177 match multiple files.
178
179 The following file types are defined for svirt:
180
181
182
183 svirt_home_t
184
185 - Set files with the svirt_home_t type, if you want to store svirt
186 files in the users home directory.
187
188
189 Paths:
190 /home/[^/]+/.libvirt/qemu(/.*)?, /home/[^/]+/.cache/lib‐
191 virt/qemu(/.*)?, /home/[^/]+/.config/libvirt/qemu(/.*)?,
192 /home/[^/]+/.local/share/libvirt/boot(/.*)?,
193 /home/[^/]+/.local/share/libvirt/images(/.*)?,
194 /home/[^/]+/.local/share/gnome-boxes/images(/.*)?
195
196
197 svirt_image_t
198
199 - Set files with the svirt_image_t type, if you want to treat the files
200 as svirt image data.
201
202
203
204 svirt_tmp_t
205
206 - Set files with the svirt_tmp_t type, if you want to store svirt tem‐
207 porary files in the /tmp directories.
208
209
210
211 svirt_tmpfs_t
212
213 - Set files with the svirt_tmpfs_t type, if you want to store svirt
214 files on a tmpfs file system.
215
216
217
218 Note: File context can be temporarily modified with the chcon command.
219 If you want to permanently change the file context you need to use the
220 semanage fcontext command. This will modify the SELinux labeling data‐
221 base. You will need to use restorecon to apply the labels.
222
223
225 semanage fcontext can also be used to manipulate default file context
226 mappings.
227
228 semanage permissive can also be used to manipulate whether or not a
229 process type is permissive.
230
231 semanage module can also be used to enable/disable/install/remove pol‐
232 icy modules.
233
234 semanage boolean can also be used to manipulate the booleans
235
236
237 system-config-selinux is a GUI tool available to customize SELinux pol‐
238 icy settings.
239
240
242 This manual page was auto-generated using sepolicy manpage .
243
244
246 selinux(8), svirt(8), semanage(8), restorecon(8), chcon(1), sepol‐
247 icy(8), setsebool(8), svirt_kvm_net_selinux(8),
248 svirt_kvm_net_selinux(8), svirt_qemu_net_selinux(8),
249 svirt_qemu_net_selinux(8), svirt_socket_selinux(8),
250 svirt_socket_selinux(8), svirt_tcg_selinux(8), svirt_tcg_selinux(8)
251
252
253
254svirt 19-10-08 svirt_selinux(8)