You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/guides/guest-UEFI-Secure-Boot.md
+77-10Lines changed: 77 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,20 +4,62 @@ How to configure UEFI Secure boot?
4
4
5
5
Enabling UEFI Secure Boot for guests ensures that XCP-ng VMs will only execute trusted binaries at boot. In practice, these are the binaries released by the operating system (OS) vendor for the OS running in the VM (Microsoft Windows, Debian, RHEL, Alpine, etc.).
6
6
7
+
## Upcoming changes in Secure Boot
8
+
9
+
The default Secure Boot keys in XCP-ng are changing.
10
+
11
+
Previously, XCP-ng only shipped with the PK included by default; Secure Boot variables had to be installed using `secureboot-certs`.
12
+
New versions of XCP-ng's `varstored` (from version 1.2.0-2.4 and newer) now come with a complete set of Secure Boot variables (PK/KEK/db/dbx) by default, meaning that guest Secure Boot will now work for new VMs without needing further pool configuration.
13
+
14
+
### What this change means for you
15
+
16
+
You will not be affected in most cases.
17
+
18
+
* Existing VMs will not be affected unless you use the [Propagate certificates](#propagate-pool-certificates-to-a-vm) feature in Xen Orchestra (which has always had the effect of resetting VM Secure Boot variables to that of the pool).
19
+
* If you followed our previous guides and used `secureboot-certs install` to install the default Secure Boot variables into your pool, these variables will not be changed.
20
+
21
+
Here are the changes:
22
+
23
+
* If you haven't used `secureboot-certs install` on your pool, your pool now supports guest Secure Boot by default.
24
+
25
+
* Our defaults now include the 2023 Microsoft KEK and db certificates, ensuring Windows compatibility beyond 2026 (which is when the previous 2011 certificates expire).
26
+
27
+
In particular, the 2023 Microsoft KEK certificate is needed for guest-initiated security updates to the db and dbx variables.
28
+
29
+
* If you have used `secureboot-certs install` on your pool before, install these certificates manually by running this command again.
30
+
31
+
* After updating the pool variables, you can add this certificate to existing VMs using the [Propagate certificates](#propagate-pool-certificates-to-a-vm) procedure.
32
+
33
+
:warning: This will change the Secure Boot vTPM measurements. If you depend on these measurements (e.g. BitLocker with TPM protector), you must follow the [Preparing for Secure Boot Variable Changes](#preparing-for-secure-boot-variable-changes) procedure.
34
+
35
+
***Newly created VMs** will change their behavior with Secure Boot enabled, running on pools where `secureboot-certs install` have not been executed.
36
+
Previously, these VMs would execute revoked UEFI binaries even with Secure Boot enabled (due to an empty dbx variable); however, going forward, revoked UEFI binaries (e.g. from an outdated media) will no longer boot on such VMs with Secure Boot enabled.
37
+
Note that this does not apply to VMs cloned from another already-installed VM or template.
38
+
39
+
To continue booting outdated media on these VMs, you can either:
40
+
41
+
* Disable Secure Boot;
42
+
* Or, if the VM has booted at least once, erase its dbx variable with the command `varstore-rm <vm uuid> d719b2cb-3d3a-4596-a3bc-dad00e67656f dbx`. Once your VM has completed installing, it should be able to manage its own Secure Boot variables (db/dbx) via its update mechanism.
43
+
7
44
## Requirements
8
45
9
46
* XCP-ng >= 8.2.1.
10
47
* UEFI Secure Boot Certificates installed on the pool (this is detailed below).
11
48
* A UEFI guest VM.
12
-
* For Windows, ensure the VM has at least 2 vCPUs.
13
49
14
50
:::warning
15
51
Until we can re-sign XCP-ng's PV drivers for Windows, you will need the PV drivers from XenServer before enabling Secure Boot for a Windows VM. See [Setup Secure Boot for Windows VMs](#setup-secure-boot-for-windows-vms).
16
52
:::
17
53
18
54
Note: it's not necessary that the XCP-ng host boots in UEFI mode for Secure Boot to be enabled on VMs.
19
55
20
-
## Quick Start
56
+
## 8.3 with varstored >= 1.2.0-2.4
57
+
58
+
Secure Boot is ready to use on new VMs without extra configuration. Simply activate Secure Boot on your VMs, and they will be provided with an appropriate set of default Secure Boot variables.
59
+
60
+
We will keep updating the default Secure Boot variables with future updates from Microsoft. If you don't want this behavior, you can lock in these variables by using the [Install the Default UEFI Certificates](#install-the-default-uefi-certificates) procedure.
61
+
62
+
## Quick Start (8.2.1 and 8.3 with varstored < 1.2.0-2.4)
21
63
22
64
We believe that reading this guide will provide you with useful knowledge about the way Guest Secure Boot is handled in XCP-ng, and let you avoid mistakes.
23
65
@@ -91,24 +133,46 @@ For custom certificates (advanced use), see [Install Custom UEFI Certificates](#
91
133
92
134
### Install the Default UEFI Certificates
93
135
136
+
:::info
137
+
This procedure is not necessary if you're using varstored 1.2.0-2.4 and newer. However, you can use the procedure anyway to lock in the default variables per pool and avoid further default changes.
138
+
:::
139
+
94
140
`secureboot-certs` supports installing a default set of certificates across the pool.
95
141
96
142
Except the `PK` key which is already provided by XCP-ng, all certificates are downloaded from official sources (`microsoft.com` and `uefi.org`).
| PK | Provided by XCP-ng, already present on disk. |`default`|
103
-
| KEK |[Microsoft Corporation UEFI KEK CA 2011](https://www.microsoft.com/pkiops/certs/MicCorKEKCA2011_2011-06-24.crt)|`default`|
151
+
| KEK |[Microsoft Corporation KEK CA 2011](https://www.microsoft.com/pkiops/certs/MicCorKEKCA2011_2011-06-24.crt)|`default`|
104
152
| db |[Microsoft Corporation UEFI CA 2011](https://www.microsoft.com/pkiops/certs/MicCorUEFCA2011_2011-06-27.crt) and [Microsoft Windows Production PCA 2011](https://www.microsoft.com/pkiops/certs/MicWinProPCA2011_2011-10-19.crt)|`default`|
| KEK | Microsoft Corporation KEK CA 2011 and Microsoft Corporation KEK 2K CA 2023 |`default`|
165
+
| db | Microsoft Windows Production PCA 2011, Windows UEFI CA 2023, Microsoft Corporation UEFI CA 2011, Microsoft UEFI CA 2023 and Microsoft Option ROM UEFI CA 2023 |`default`|
166
+
| dbx | Image hashes provided by microsoft/secureboot_objects (can specify `latest` to download latest dbx instead) |`default`|
167
+
168
+
To install these variables from the command line interface:
108
169
109
170
```
110
-
# Download and install PK/KEK/db/dbx certificates
171
+
# Download and install PK/KEK/db/dbx certificates (varstored < 1.2.0-2.4)
# Enroll a custom PK along with the default KEK/db/dbx
230
+
secureboot-certs install PK.cer
167
231
```
168
232
169
-
The same procedure may be used to install custom KEK, db, or dbx certs.
233
+
The same procedure may be used to install custom KEK, db, or dbx variables.
170
234
171
235
To use multiple certificates in one variable (that is, have multiple certificates stored as a single KEK, db, or dbx), the certs must be packaged together into a .auth file, see [Use two or more certificates for a Secure Boot variable](#use-two-or-more-certificates-for-a-secure-boot-variable). Note that multiple certificates in the PK is not supported. If an auth file with multiple certs is loaded as the PK, only the first one found will be used.
172
236
173
237
Note that the virtual firmware, as is allowed by the specification, does not mandate that these default certificates be signed by their parent (i.e., the KEK doesn't need to be signed by PK) if they're installed via `secureboot-certs`. This verification *does* occur, however, when trying to enroll new certificates from inside the guest after boot. This is designed to give the host administrator full control over the certificates from the control domain.
174
238
175
-
If necessary for your use case you may omit the `dbx` entirely. Note that this basically **renders secure boot useless** from a security perspective, as any binary signed with a revoked certificate will still pass Secure Boot checks! This may be done by using the following command:
239
+
You can also omit the dbx variable entirely.
240
+
This is the most compatible option for old installation media that may not include the newest Secure Boot fixes.
241
+
Once installed, the guest can still update the dbx variable on its own to revoke vulnerable bootloaders as long as the default KEK is included.
242
+
Omitting the dbx variable can be done using the following command:
176
243
177
244
```
178
-
# Download and install PK/KEK/db certificates, omit the dbx
245
+
# Install default PK/KEK/db variables, omit the dbx
0 commit comments