VirtualBox

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

最後變更 在這個檔案從96301是 96301,由 vboxsync 提交於 3 年 前

doc: comment fixes

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

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