VirtualBox

source: vbox/trunk/doc/manual/en_US/user_Security.xml@ 79060

Last change on this file since 79060 was 78632, checked in by vboxsync, 6 years ago

Forward ported 130474,130475,130477,130479. bugref:9453

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

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette