1 | <?xml version="1.0" encoding="UTF-8"?>
|
---|
2 | <!--
|
---|
3 | Copyright (C) 2006-2023 Oracle and/or its affiliates.
|
---|
4 |
|
---|
5 | This file is part of VirtualBox base platform packages, as
|
---|
6 | available from https://www.virtualbox.org.
|
---|
7 |
|
---|
8 | This program is free software; you can redistribute it and/or
|
---|
9 | modify it under the terms of the GNU General Public License
|
---|
10 | as published by the Free Software Foundation, in version 3 of the
|
---|
11 | License.
|
---|
12 |
|
---|
13 | This program is distributed in the hope that it will be useful, but
|
---|
14 | WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
---|
16 | General Public License for more details.
|
---|
17 |
|
---|
18 | You should have received a copy of the GNU General Public License
|
---|
19 | along with this program; if not, see <https://www.gnu.org/licenses>.
|
---|
20 |
|
---|
21 | SPDX-License-Identifier: GPL-3.0-only
|
---|
22 | -->
|
---|
23 | <!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
|
---|
24 | "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"[
|
---|
25 | <!ENTITY % all.entities SYSTEM "all-entities.ent">
|
---|
26 | %all.entities;
|
---|
27 | ]>
|
---|
28 | <chapter id="Security">
|
---|
29 |
|
---|
30 | <title>Security Guide</title>
|
---|
31 |
|
---|
32 | <sect1 id="security-general">
|
---|
33 |
|
---|
34 | <title>General Security Principles</title>
|
---|
35 |
|
---|
36 | <para>
|
---|
37 | The following principles are fundamental to using any application
|
---|
38 | securely.
|
---|
39 | </para>
|
---|
40 |
|
---|
41 | <itemizedlist>
|
---|
42 |
|
---|
43 | <listitem>
|
---|
44 | <para>
|
---|
45 | <emphasis role="bold">Keep software up to date</emphasis>. One
|
---|
46 | of the principles of good security practise is to keep all
|
---|
47 | software versions and patches up to date. Activate the
|
---|
48 | &product-name; update notification to get notified when a new
|
---|
49 | &product-name; release is available. When updating
|
---|
50 | &product-name;, do not forget to update the Guest Additions.
|
---|
51 | Keep the host operating system as well as the guest operating
|
---|
52 | system up to date.
|
---|
53 | </para>
|
---|
54 | </listitem>
|
---|
55 |
|
---|
56 | <listitem>
|
---|
57 | <para>
|
---|
58 | <emphasis role="bold">Restrict network access to critical
|
---|
59 | services.</emphasis> Use proper means, for instance a
|
---|
60 | firewall, to protect your computer and your guests from
|
---|
61 | accesses from the outside. Choosing the proper networking mode
|
---|
62 | for VMs helps to separate host networking from the guest and
|
---|
63 | vice versa.
|
---|
64 | </para>
|
---|
65 | </listitem>
|
---|
66 |
|
---|
67 | <listitem>
|
---|
68 | <para>
|
---|
69 | <emphasis role="bold">Follow the principle of least
|
---|
70 | privilege.</emphasis> The principle of least privilege states
|
---|
71 | that users should be given the least amount of privilege
|
---|
72 | necessary to perform their jobs. Always execute &product-name;
|
---|
73 | as a regular user. We strongly discourage anyone from
|
---|
74 | executing &product-name; with system privileges.
|
---|
75 | </para>
|
---|
76 |
|
---|
77 | <para>
|
---|
78 | Choose restrictive permissions when creating configuration
|
---|
79 | files, for instance when creating /etc/default/virtualbox, see
|
---|
80 | <xref linkend="linux_install_opts"/>. Mode 0600 is preferred.
|
---|
81 | </para>
|
---|
82 | </listitem>
|
---|
83 |
|
---|
84 | <listitem>
|
---|
85 | <para>
|
---|
86 | <emphasis role="bold">Monitor system activity.</emphasis>
|
---|
87 | System security builds on three pillars: good security
|
---|
88 | protocols, proper system configuration and system monitoring.
|
---|
89 | Auditing and reviewing audit records address the third
|
---|
90 | requirement. Each component within a system has some degree of
|
---|
91 | monitoring capability. Follow audit advice in this document
|
---|
92 | and regularly monitor audit records.
|
---|
93 | </para>
|
---|
94 | </listitem>
|
---|
95 |
|
---|
96 | <listitem>
|
---|
97 | <para>
|
---|
98 | <emphasis role="bold">Keep up to date on latest security
|
---|
99 | information.</emphasis> Oracle continually improves its
|
---|
100 | software and documentation. Check this note yearly for
|
---|
101 | revisions.
|
---|
102 | </para>
|
---|
103 | </listitem>
|
---|
104 |
|
---|
105 | </itemizedlist>
|
---|
106 |
|
---|
107 | </sect1>
|
---|
108 |
|
---|
109 | <sect1 id="security-secure-install">
|
---|
110 |
|
---|
111 | <title>Secure Installation and Configuration</title>
|
---|
112 |
|
---|
113 | <sect2 id="security-secure-install-overview">
|
---|
114 |
|
---|
115 | <title>Installation Overview</title>
|
---|
116 |
|
---|
117 | <para>
|
---|
118 | The &product-name; base package should be downloaded only from a
|
---|
119 | trusted source, for instance the official website
|
---|
120 | <ulink url="http://www.virtualbox.org" />. The integrity of the
|
---|
121 | package should be verified with the provided SHA256 checksum
|
---|
122 | which can be found on the official website.
|
---|
123 | </para>
|
---|
124 |
|
---|
125 | <para>
|
---|
126 | General &product-name; installation instructions for the
|
---|
127 | supported hosts can be found in <xref linkend="installation"/>.
|
---|
128 | </para>
|
---|
129 |
|
---|
130 | <para>
|
---|
131 | On Windows hosts, the installer can be used to disable USB
|
---|
132 | support, support for bridged networking, support for host-only
|
---|
133 | networking and the Python language binding. See
|
---|
134 | <xref linkend="installation_windows"/>. All these features are
|
---|
135 | enabled by default but disabling some of them could be
|
---|
136 | appropriate if the corresponding functionality is not required
|
---|
137 | by any virtual machine. The Python language bindings are only
|
---|
138 | required if the &product-name; API is to be used by external
|
---|
139 | Python applications. In particular USB support and support for
|
---|
140 | the two networking modes require the installation of Windows
|
---|
141 | kernel drivers on the host. Therefore disabling those selected
|
---|
142 | features can not only be used to restrict the user to certain
|
---|
143 | functionality but also to minimize the surface provided to a
|
---|
144 | potential attacker.
|
---|
145 | </para>
|
---|
146 |
|
---|
147 | <para>
|
---|
148 | The general case is to install the complete &product-name;
|
---|
149 | package. The installation must be done with system privileges.
|
---|
150 | All &product-name; binaries should be executed as a regular user
|
---|
151 | and never as a privileged user.
|
---|
152 | </para>
|
---|
153 |
|
---|
154 | <para>
|
---|
155 | The &product-name; Extension Pack provides additional features
|
---|
156 | and must be downloaded and installed separately, see
|
---|
157 | <xref linkend="intro-installing"/>. As for the base package, the
|
---|
158 | SHA256 checksum of the extension pack should be verified. As the
|
---|
159 | installation requires system privileges, &product-name; will ask
|
---|
160 | for the system password during the installation of the extension
|
---|
161 | pack.
|
---|
162 | </para>
|
---|
163 |
|
---|
164 | </sect2>
|
---|
165 |
|
---|
166 | <sect2 id="security-secure-install-postinstall">
|
---|
167 |
|
---|
168 | <title>Post Installation Configuration</title>
|
---|
169 |
|
---|
170 | <para>
|
---|
171 | Normally there is no post installation configuration of
|
---|
172 | &product-name; components required. However, on Oracle Solaris
|
---|
173 | and Linux hosts it is necessary to configure the proper
|
---|
174 | permissions for users executing VMs and who should be able to
|
---|
175 | access certain host resources. For instance, Linux users must be
|
---|
176 | member of the <emphasis>vboxusers</emphasis> group to be able to
|
---|
177 | pass USB devices to a guest. If a serial host interface should
|
---|
178 | be accessed from a VM, the proper permissions must be granted to
|
---|
179 | the user to be able to access that device. The same applies to
|
---|
180 | other resources like raw partitions, DVD/CD drives, and sound
|
---|
181 | devices.
|
---|
182 | </para>
|
---|
183 |
|
---|
184 | </sect2>
|
---|
185 |
|
---|
186 | </sect1>
|
---|
187 |
|
---|
188 | <sect1 id="security-features">
|
---|
189 |
|
---|
190 | <title>Security Features</title>
|
---|
191 |
|
---|
192 | <para>
|
---|
193 | This section outlines the specific security mechanisms offered by
|
---|
194 | &product-name;.
|
---|
195 | </para>
|
---|
196 |
|
---|
197 | <sect2 id="security-model">
|
---|
198 |
|
---|
199 | <title>The Security Model</title>
|
---|
200 |
|
---|
201 | <para>
|
---|
202 | One property of virtual machine monitors (VMMs) like
|
---|
203 | &product-name; is to encapsulate a guest by executing it in a
|
---|
204 | protected environment, a virtual machine, running as a user
|
---|
205 | process on the host operating system. The guest cannot
|
---|
206 | communicate directly with the hardware or other computers but
|
---|
207 | only through the VMM. The VMM provides emulated physical
|
---|
208 | resources and devices to the guest which are accessed by the
|
---|
209 | guest operating system to perform the required tasks. The VM
|
---|
210 | settings control the resources provided to the guest, for
|
---|
211 | example the amount of guest memory or the number of guest
|
---|
212 | processors and the enabled features for that guest. For example
|
---|
213 | remote control, certain screen settings and others. See
|
---|
214 | <xref linkend="generalsettings"/>.
|
---|
215 | </para>
|
---|
216 |
|
---|
217 | </sect2>
|
---|
218 |
|
---|
219 | <sect2 id="secure-config-vms">
|
---|
220 |
|
---|
221 | <title>Secure Configuration of Virtual Machines</title>
|
---|
222 |
|
---|
223 | <para>
|
---|
224 | Several aspects of a virtual machine configuration are subject
|
---|
225 | to security considerations.
|
---|
226 | </para>
|
---|
227 |
|
---|
228 | <sect3 id="security-networking">
|
---|
229 |
|
---|
230 | <title>Networking</title>
|
---|
231 |
|
---|
232 | <para>
|
---|
233 | The default networking mode for VMs is NAT which means that
|
---|
234 | the VM acts like a computer behind a router, see
|
---|
235 | <xref linkend="network_nat"/>. The guest is part of a private
|
---|
236 | subnet belonging to this VM and the guest IP is not visible
|
---|
237 | from the outside. This networking mode works without any
|
---|
238 | additional setup and is sufficient for many purposes. Keep in
|
---|
239 | mind that NAT allows access to the host operating system's
|
---|
240 | loopback interface.
|
---|
241 | </para>
|
---|
242 |
|
---|
243 | <para>
|
---|
244 | If bridged networking is used, the VM acts like a computer
|
---|
245 | inside the same network as the host, see
|
---|
246 | <xref linkend="network_bridged"/>. In this case, the guest has
|
---|
247 | the same network access as the host and a firewall might be
|
---|
248 | necessary to protect other computers on the subnet from a
|
---|
249 | potential malicious guest as well as to protect the guest from
|
---|
250 | a direct access from other computers. In some cases it is
|
---|
251 | worth considering using a forwarding rule for a specific port
|
---|
252 | in NAT mode instead of using bridged networking.
|
---|
253 | </para>
|
---|
254 |
|
---|
255 | <para>
|
---|
256 | Some setups do not require a VM to be connected to the public
|
---|
257 | network at all. Internal networking, see
|
---|
258 | <xref linkend="network_internal"/>, or host-only networking,
|
---|
259 | see <xref linkend="network_hostonly"/>, are often sufficient
|
---|
260 | to connect VMs among each other or to connect VMs only with
|
---|
261 | the host but not with the public network.
|
---|
262 | </para>
|
---|
263 |
|
---|
264 | </sect3>
|
---|
265 |
|
---|
266 | <sect3 id="security-vrdp-auth">
|
---|
267 |
|
---|
268 | <title>VRDP Remote Desktop Authentication</title>
|
---|
269 |
|
---|
270 | <para>
|
---|
271 | When using the &product-name; Extension Pack provided by
|
---|
272 | Oracle for VRDP remote desktop support, you can optionally use
|
---|
273 | various methods to configure RDP authentication. The "null"
|
---|
274 | method is very insecure and should be avoided in a public
|
---|
275 | network. See <xref linkend="vbox-auth" />.
|
---|
276 | </para>
|
---|
277 |
|
---|
278 | </sect3>
|
---|
279 |
|
---|
280 | <sect3 id="security_clipboard">
|
---|
281 |
|
---|
282 | <title>Clipboard</title>
|
---|
283 |
|
---|
284 | <para>
|
---|
285 | The shared clipboard enables users to share data between the
|
---|
286 | host and the guest. Enabling the clipboard in Bidirectional
|
---|
287 | mode enables the guest to read and write the host clipboard.
|
---|
288 | The Host to Guest mode and the Guest to Host mode limit the
|
---|
289 | access to one direction. If the guest is able to access the
|
---|
290 | host clipboard it can also potentially access sensitive data
|
---|
291 | from the host which is shared over the clipboard.
|
---|
292 | </para>
|
---|
293 |
|
---|
294 | <para>
|
---|
295 | If the guest is able to read from and/or write to the host
|
---|
296 | clipboard then a remote user connecting to the guest over the
|
---|
297 | network will also gain this ability, which may not be
|
---|
298 | desirable. As a consequence, the shared clipboard is disabled
|
---|
299 | for new machines.
|
---|
300 | </para>
|
---|
301 |
|
---|
302 | </sect3>
|
---|
303 |
|
---|
304 | <sect3 id="security-shared-folders">
|
---|
305 |
|
---|
306 | <title>Shared Folders</title>
|
---|
307 |
|
---|
308 | <para>
|
---|
309 | If any host folder is shared with the guest then a remote user
|
---|
310 | connected to the guest over the network can access these files
|
---|
311 | too as the folder sharing mechanism cannot be selectively
|
---|
312 | disabled for remote users.
|
---|
313 | </para>
|
---|
314 |
|
---|
315 | </sect3>
|
---|
316 |
|
---|
317 | <sect3 id="security-3d-graphics">
|
---|
318 |
|
---|
319 | <title>3D Graphics Acceleration</title>
|
---|
320 |
|
---|
321 | <para>
|
---|
322 | Enabling 3D graphics using the Guest Additions exposes the
|
---|
323 | host to additional security risks. See
|
---|
324 | <xref
|
---|
325 | linkend="guestadd-3d" />.
|
---|
326 | </para>
|
---|
327 |
|
---|
328 | </sect3>
|
---|
329 |
|
---|
330 | <sect3 id="security-cd-dvd-passthrough">
|
---|
331 |
|
---|
332 | <title>CD/DVD Passthrough</title>
|
---|
333 |
|
---|
334 | <para>
|
---|
335 | Enabling CD/DVD passthrough enables the guest to perform
|
---|
336 | advanced operations on the CD/DVD drive, see
|
---|
337 | <xref linkend="storage-cds"/>. This could induce a security
|
---|
338 | risk as a guest could overwrite data on a CD/DVD medium.
|
---|
339 | </para>
|
---|
340 |
|
---|
341 | </sect3>
|
---|
342 |
|
---|
343 | <sect3 id="security-usb-passthrough">
|
---|
344 |
|
---|
345 | <title>USB Passthrough</title>
|
---|
346 |
|
---|
347 | <para>
|
---|
348 | Passing USB devices to the guest provides the guest full
|
---|
349 | access to these devices, see <xref linkend="settings-usb"/>.
|
---|
350 | For instance, in addition to reading and writing the content
|
---|
351 | of the partitions of an external USB disk the guest will be
|
---|
352 | also able to read and write the partition table and hardware
|
---|
353 | data of that disk.
|
---|
354 | </para>
|
---|
355 |
|
---|
356 | </sect3>
|
---|
357 |
|
---|
358 | </sect2>
|
---|
359 |
|
---|
360 | <sect2 id="auth-config-using">
|
---|
361 |
|
---|
362 | <title>Configuring and Using Authentication</title>
|
---|
363 |
|
---|
364 | <para>
|
---|
365 | The following components of &product-name; can use passwords for
|
---|
366 | authentication:
|
---|
367 | </para>
|
---|
368 |
|
---|
369 | <itemizedlist>
|
---|
370 |
|
---|
371 | <listitem>
|
---|
372 | <para>
|
---|
373 | When using remote iSCSI storage and the storage server
|
---|
374 | requires authentication, an initiator secret can optionally
|
---|
375 | be supplied with the <command>VBoxManage
|
---|
376 | storageattach</command> command. As long as no settings
|
---|
377 | password is provided, by using the command line option
|
---|
378 | <option>--settingspwfile</option>, then this secret is
|
---|
379 | stored <emphasis>unencrypted</emphasis> in the machine
|
---|
380 | configuration and is therefore potentially readable on the
|
---|
381 | host. See <xref linkend="storage-iscsi" /> and
|
---|
382 | <xref linkend="vboxmanage-storageattach" />.
|
---|
383 | </para>
|
---|
384 | </listitem>
|
---|
385 |
|
---|
386 | <listitem>
|
---|
387 | <para>
|
---|
388 | When using the &product-name; web service to control an
|
---|
389 | &product-name; host remotely, connections to the web service
|
---|
390 | are authenticated in various ways. This is described in
|
---|
391 | detail in the &product-name; Software Development Kit (SDK)
|
---|
392 | reference. See <xref linkend="VirtualBoxAPI" />.
|
---|
393 | </para>
|
---|
394 | </listitem>
|
---|
395 |
|
---|
396 | </itemizedlist>
|
---|
397 |
|
---|
398 | </sect2>
|
---|
399 |
|
---|
400 | <!--
|
---|
401 | <sect2 id="access-control-config-using">
|
---|
402 | <title>Configuring and Using Access Control</title>
|
---|
403 | </sect2>
|
---|
404 |
|
---|
405 | <sect2 id="security-audit-config-using">
|
---|
406 | <title>Configuring and Using Security Audit</title>
|
---|
407 | </sect2>
|
---|
408 |
|
---|
409 | <sect2 id="security-other-features-config-using">
|
---|
410 | <title>Configuring and Using Other Security Features</title>
|
---|
411 | </sect2>
|
---|
412 | -->
|
---|
413 |
|
---|
414 | <sect2 id="pot-insecure">
|
---|
415 |
|
---|
416 | <title>Potentially Insecure Operations</title>
|
---|
417 |
|
---|
418 | <para>
|
---|
419 | The following features of &product-name; can present security
|
---|
420 | problems:
|
---|
421 | </para>
|
---|
422 |
|
---|
423 | <itemizedlist>
|
---|
424 |
|
---|
425 | <listitem>
|
---|
426 | <para>
|
---|
427 | Enabling 3D graphics using the Guest Additions exposes the
|
---|
428 | host to additional security risks. See
|
---|
429 | <xref
|
---|
430 | linkend="guestadd-3d" />.
|
---|
431 | </para>
|
---|
432 | </listitem>
|
---|
433 |
|
---|
434 | <listitem>
|
---|
435 | <para>
|
---|
436 | When teleporting a machine, the data stream through which
|
---|
437 | the machine's memory contents are transferred from one host
|
---|
438 | to another is not encrypted. A third party with access to
|
---|
439 | the network through which the data is transferred could
|
---|
440 | therefore intercept that data. An SSH tunnel could be used
|
---|
441 | to secure the connection between the two hosts. But when
|
---|
442 | considering teleporting a VM over an untrusted network the
|
---|
443 | first question to answer is how both VMs can securely access
|
---|
444 | the same virtual disk image with a reasonable performance.
|
---|
445 | </para><para>
|
---|
446 | If the network is not sufficiently trusted, the password
|
---|
447 | should be changed for each teleportation as the a 3rd party
|
---|
448 | could snoop up the unecrypted password hash when it is
|
---|
449 | transferred between the target and source host machines.
|
---|
450 | </para>
|
---|
451 | </listitem>
|
---|
452 |
|
---|
453 | <listitem>
|
---|
454 | <para>
|
---|
455 | When Page Fusion, see <xref linkend="guestadd-pagefusion"/>,
|
---|
456 | is enabled, it is possible that a side-channel opens up that
|
---|
457 | enables a malicious guest to determine the address space of
|
---|
458 | another VM running on the same host layout. For example,
|
---|
459 | where DLLs are typically loaded. This information leak in
|
---|
460 | itself is harmless, however the malicious guest may use it
|
---|
461 | to optimize attack against that VM through unrelated attack
|
---|
462 | vectors. It is recommended to only enable Page Fusion if you
|
---|
463 | do not think this is a concern in your setup.
|
---|
464 | </para>
|
---|
465 | </listitem>
|
---|
466 |
|
---|
467 | <listitem>
|
---|
468 | <para>
|
---|
469 | When using the &product-name; web service to control an
|
---|
470 | &product-name; host remotely, connections to the web
|
---|
471 | service, over which the API calls are transferred using SOAP
|
---|
472 | XML, are not encrypted. They use plain HTTP by default. This
|
---|
473 | is a potential security risk. For details about the web
|
---|
474 | service, see <xref linkend="VirtualBoxAPI" />.
|
---|
475 | </para>
|
---|
476 |
|
---|
477 | <para>
|
---|
478 | The web services are not started by default. See
|
---|
479 | <xref linkend="vboxwebsrv-daemon"/> to find out how to start
|
---|
480 | this service and how to enable SSL/TLS support. It has to be
|
---|
481 | started as a regular user and only the VMs of that user can
|
---|
482 | be controlled. By default, the service binds to localhost
|
---|
483 | preventing any remote connection.
|
---|
484 | </para>
|
---|
485 | </listitem>
|
---|
486 |
|
---|
487 | <listitem>
|
---|
488 | <para>
|
---|
489 | Traffic sent over a UDP Tunnel network attachment is not
|
---|
490 | encrypted. You can either encrypt it on the host network
|
---|
491 | level, with IPsec, or use encrypted protocols in the guest
|
---|
492 | network, such as SSH. The security properties are similar to
|
---|
493 | bridged Ethernet.
|
---|
494 | </para>
|
---|
495 | </listitem>
|
---|
496 |
|
---|
497 | <listitem>
|
---|
498 | <para>
|
---|
499 | Because of shortcomings in older Windows versions, using
|
---|
500 | &product-name; on Windows versions older than Vista with
|
---|
501 | Service Pack 1 is not recommended.
|
---|
502 | </para>
|
---|
503 | </listitem>
|
---|
504 |
|
---|
505 | </itemizedlist>
|
---|
506 |
|
---|
507 | </sect2>
|
---|
508 |
|
---|
509 | <sect2 id="security-encryption">
|
---|
510 |
|
---|
511 | <title>Encryption</title>
|
---|
512 |
|
---|
513 | <para>
|
---|
514 | The following components of &product-name; use encryption to
|
---|
515 | protect sensitive data:
|
---|
516 | </para>
|
---|
517 |
|
---|
518 | <itemizedlist>
|
---|
519 |
|
---|
520 | <listitem>
|
---|
521 | <para>
|
---|
522 | When using the &product-name; Extension Pack provided by
|
---|
523 | Oracle for VRDP remote desktop support, RDP data can
|
---|
524 | optionally be encrypted. See <xref linkend="vrde-crypt" />.
|
---|
525 | Only the Enhanced RDP Security method (RDP5.2) with TLS
|
---|
526 | protocol provides a secure connection. Standard RDP Security
|
---|
527 | (RDP4 and RDP5.1) is vulnerable to a man-in-the-middle
|
---|
528 | attack.
|
---|
529 | </para>
|
---|
530 | </listitem>
|
---|
531 |
|
---|
532 | <listitem>
|
---|
533 | <para>
|
---|
534 | When using the &product-name; Extension Pack provided by
|
---|
535 | Oracle for disk encryption, the data stored in disk images
|
---|
536 | can optionally be encrypted. See
|
---|
537 | <xref linkend="diskencryption" />. This feature covers disk
|
---|
538 | image content only. All other data for a virtual machine is
|
---|
539 | stored unencrypted, including the VM's memory and device
|
---|
540 | state which is stored as part of a saved state, both when
|
---|
541 | created explicitly or part of a snapshot of a running VM.
|
---|
542 | </para>
|
---|
543 | </listitem>
|
---|
544 |
|
---|
545 | </itemizedlist>
|
---|
546 |
|
---|
547 | </sect2>
|
---|
548 |
|
---|
549 | </sect1>
|
---|
550 |
|
---|
551 | <!--
|
---|
552 | <sect1 id="security-devel">
|
---|
553 | <title>Security Considerations for Developers</title>
|
---|
554 | </sect1>
|
---|
555 | -->
|
---|
556 |
|
---|
557 | <sect1 id="security-recommendations">
|
---|
558 |
|
---|
559 | <title>Security Recommendations</title>
|
---|
560 |
|
---|
561 | <para>
|
---|
562 | This section contains security recommendations for specific
|
---|
563 | issues. By default VirtualBox will configure the VMs to run in a
|
---|
564 | secure manner, however this may not always be possible without
|
---|
565 | additional user actions such as host OS or firmware configuration
|
---|
566 | changes.
|
---|
567 | </para>
|
---|
568 |
|
---|
569 | <sect2 id="sec-rec-cve-2018-3646">
|
---|
570 |
|
---|
571 | <title>CVE-2018-3646</title>
|
---|
572 |
|
---|
573 | <para>
|
---|
574 | This security issue affect a range of Intel CPUs with nested
|
---|
575 | paging. AMD CPUs are expected not to be impacted (pending direct
|
---|
576 | confirmation by AMD). Also the issue does not affect VMs running
|
---|
577 | with hardware virtualization disabled or with nested paging
|
---|
578 | disabled.
|
---|
579 | </para>
|
---|
580 |
|
---|
581 | <para>
|
---|
582 | For more information about nested paging, see
|
---|
583 | <xref linkend="nestedpaging" />.
|
---|
584 | </para>
|
---|
585 |
|
---|
586 | <para>
|
---|
587 | The following mitigation options are available.
|
---|
588 | </para>
|
---|
589 |
|
---|
590 | <sect3>
|
---|
591 |
|
---|
592 | <title>Disable Nested Paging</title>
|
---|
593 |
|
---|
594 | <para>
|
---|
595 | By disabling nested paging (EPT), the VMM will construct page
|
---|
596 | tables shadowing the ones in the guest. It is no possible for
|
---|
597 | the guest to insert anything fishy into the page tables, since
|
---|
598 | the VMM carefully validates each entry before shadowing it.
|
---|
599 | </para>
|
---|
600 |
|
---|
601 | <para>
|
---|
602 | As a side effect of disabling nested paging, several CPU
|
---|
603 | features will not be made available to the guest. Among these
|
---|
604 | features are AVX, AVX2, XSAVE, AESNI, and POPCNT. Not all
|
---|
605 | guests may be able to cope with dropping these features after
|
---|
606 | installation. Also, for some guests, especially in SMP
|
---|
607 | configurations, there could be stability issues arising from
|
---|
608 | disabling nested paging. Finally, some workloads may
|
---|
609 | experience a performance degradation.
|
---|
610 | </para>
|
---|
611 |
|
---|
612 | </sect3>
|
---|
613 |
|
---|
614 | <sect3>
|
---|
615 |
|
---|
616 | <title>Flushing the Level 1 Data Cache</title>
|
---|
617 |
|
---|
618 | <para>
|
---|
619 | This aims at removing potentially sensitive data from the
|
---|
620 | level 1 data cache when running guest code. However, it is
|
---|
621 | made difficult by hyper-threading setups sharing the level 1
|
---|
622 | cache and thereby potentially letting the other thread in a
|
---|
623 | pair refill the cache with data the user does not want the
|
---|
624 | guest to see. In addition, flushing the level 1 data cache is
|
---|
625 | usually not without performance side effects.
|
---|
626 | </para>
|
---|
627 |
|
---|
628 | <para>
|
---|
629 | Up to date CPU microcode is a prerequisite for the cache
|
---|
630 | flushing mitigations. Some host OSes may install these
|
---|
631 | automatically, though it has traditionally been a task best
|
---|
632 | performed by the system firmware. So, please check with your
|
---|
633 | system / mainboard manufacturer for the latest firmware
|
---|
634 | update.
|
---|
635 | </para>
|
---|
636 |
|
---|
637 | <para>
|
---|
638 | We recommend disabling hyper threading on the host. This is
|
---|
639 | traditionally done from the firmware setup, but some OSes also
|
---|
640 | offers ways disable HT. In some cases it may be disabled by
|
---|
641 | default, but please verify as the effectiveness of the
|
---|
642 | mitigation depends on it.
|
---|
643 | </para>
|
---|
644 |
|
---|
645 | <para>
|
---|
646 | The default action taken by VirtualBox is to flush the level 1
|
---|
647 | data cache when a thread is scheduled to execute guest code,
|
---|
648 | rather than on each VM entry. This reduces the performance
|
---|
649 | impact, while making the assumption that the host OS will not
|
---|
650 | handle security sensitive data from interrupt handlers and
|
---|
651 | similar without taking precautions.
|
---|
652 | </para>
|
---|
653 |
|
---|
654 | <para>
|
---|
655 | A more aggressive flushing option is provided via the
|
---|
656 | <command>VBoxManage modifyvm</command>
|
---|
657 | <option>--l1d-flush-on-vm-entry</option> option. When enabled
|
---|
658 | the level 1 data cache will be flushed on every VM entry. The
|
---|
659 | performance impact is greater than with the default option,
|
---|
660 | though this of course depends on the workload. Workloads
|
---|
661 | producing a lot of VM exits (like networking, VGA access, and
|
---|
662 | similiar) will probably be most impacted.
|
---|
663 | </para>
|
---|
664 |
|
---|
665 | <para>
|
---|
666 | For users not concerned by this security issue, the default
|
---|
667 | mitigation can be disabled using the <command>VBoxManage
|
---|
668 | modifyvm name --l1d-flush-on-sched off</command> command.
|
---|
669 | </para>
|
---|
670 |
|
---|
671 | </sect3>
|
---|
672 |
|
---|
673 | </sect2>
|
---|
674 |
|
---|
675 | <sect2 id="sec-rec-cve-2018-12126-et-al">
|
---|
676 |
|
---|
677 | <title>CVE-2018-12126, CVE-2018-12127, CVE-2018-12130, CVE-2019-11091</title>
|
---|
678 |
|
---|
679 | <para>
|
---|
680 | These security issues affect a range of Intel CPUs starting with
|
---|
681 | Nehalem. The CVE-2018-12130 also affects some Atom Silvermont,
|
---|
682 | Atom Airmont, and Knights family CPUs, however the scope is so
|
---|
683 | limited that the host OS should deal with it and &product-name;
|
---|
684 | is therefore not affected. Leaks only happens when entering and
|
---|
685 | leaving C states.
|
---|
686 | </para>
|
---|
687 |
|
---|
688 | <para>
|
---|
689 | The following mitigation option is available.
|
---|
690 | </para>
|
---|
691 |
|
---|
692 | <sect3>
|
---|
693 |
|
---|
694 | <title>Buffer Overwriting and Disabling Hyper-Threading</title>
|
---|
695 |
|
---|
696 | <para>
|
---|
697 | First, up to date CPU microcode is a prerequisite for the
|
---|
698 | buffer overwriting (clearing) mitigations. Some host OSes may
|
---|
699 | install these automatically, though it has traditionally been
|
---|
700 | a task best performed by the system firmware. Please check
|
---|
701 | with your system or mainboard manufacturer for the latest
|
---|
702 | firmware update.
|
---|
703 | </para>
|
---|
704 |
|
---|
705 | <para>
|
---|
706 | This mitigation aims at removing potentially sensitive data
|
---|
707 | from the affected buffers before running guest code. Since
|
---|
708 | this means additional work each time the guest is scheduled,
|
---|
709 | there might be some performance side effects.
|
---|
710 | </para>
|
---|
711 |
|
---|
712 | <para>
|
---|
713 | We recommend disabling hyper-threading (HT) on hosts affected
|
---|
714 | by CVE-2018-12126 and CVE-2018-12127, because the affected
|
---|
715 | sets of buffers are normally shared between thread pairs and
|
---|
716 | therefore cause leaks between the threads. This is
|
---|
717 | traditionally done from the firmware setup, but some OSes also
|
---|
718 | offers ways disable HT. In some cases it may be disabled by
|
---|
719 | default, but please verify as the effectiveness of the
|
---|
720 | mitigation depends on it.
|
---|
721 | </para>
|
---|
722 |
|
---|
723 | <para>
|
---|
724 | The default action taken by &product-name; is to clear the
|
---|
725 | affected buffers when a thread is scheduled to execute guest
|
---|
726 | code, rather than on each VM entry. This reduces the
|
---|
727 | performance impact, while making the assumption that the host
|
---|
728 | OS will not handle security sensitive data from interrupt
|
---|
729 | handlers and similar without taking precautions.
|
---|
730 | </para>
|
---|
731 |
|
---|
732 | <para>
|
---|
733 | The <command>VBoxManage modifyvm</command> command provides a
|
---|
734 | more aggressive flushing option is provided by means of the
|
---|
735 | <option>--mds-clear-on-vm-entry</option> option. When enabled
|
---|
736 | the affected buffers will be cleared on every VM entry. The
|
---|
737 | performance impact is greater than with the default option,
|
---|
738 | though this of course depends on the workload. Workloads
|
---|
739 | producing a lot of VM exits (like networking, VGA access, and
|
---|
740 | similiar) will probably be most impacted.
|
---|
741 | </para>
|
---|
742 |
|
---|
743 | <para>
|
---|
744 | For users not concerned by this security issue, the default
|
---|
745 | mitigation can be disabled using the <command>VBoxManage
|
---|
746 | modifyvm name --mds-clear-on-sched off</command> command.
|
---|
747 | </para>
|
---|
748 |
|
---|
749 | </sect3>
|
---|
750 |
|
---|
751 | </sect2>
|
---|
752 |
|
---|
753 | </sect1>
|
---|
754 |
|
---|
755 | </chapter>
|
---|