-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enhancement: fail boot if users expect SecureBoot and there's an issue with certificates #16
Comments
The goal for OVMF + varstored as implemented in XenServer is to provide a standards-compliant implementation of UEFI. This means that a VM owner is free to set their own variables, PK, KEK, etc. and also means that a VM may go from User mode to Setup mode at any time with consqeuent clearing of the The semantics when setting a VM's Having said that, I think it would be acceptable to add an optional flag to varstored such that it would generate a new XAPI notification and/or abort if On a side note, you can't reliably tell whether Secure Boot is enabled from within the guest OS since if Secure Boot is not enabled, the attacker can replace the OS kernel with one which always reports that Secure Boot is enabled. This doesn't apply to the guest firmware which cannot be controlled by the attacker in the threat models that Secure Boot protects against. |
Oh. Is there a reliable way to tell whether Secure Boot is enabled, in the current state of varstored and XAPI? I remember having looked at the EFI variables in the NVRAM but IIRC they were not always up to date when seen from the host. |
I would be interested in displaying a reliable Secure Boot status in Xen Orchestra. Is there a way? If not, what would be required to let XAPI get and then offer this piece of information? |
Hello Ross, With regard of "optional flag" to abort guest boot, I actually made a reference to a XenStore variable. In my opinion, this is more in line with how Varstored should figure these kinds of things out. What do you think would be an acceptable solution to this problem? |
So, regarding all this, there was a misconception on my side regarding how In short: the security problem I was trying to get solved doesn't exist. There is a difference between setup mode (no PK) and user mode with no certs but PK. IIRC, in early versions of A UEFI VM with only PK in its certs can be commonly found. It's sufficient that is was booted on XCP-ng 8.2 without users having run Closing this enhancement request. |
Reopening. I missed a key point: when your pool doesn't have any certificates other than PK, there is code in varstored to prevent Consequence: any newly created VM ends up in setup mode, and users wrongly believe that Secure Boot is enforced . We had proof of this in a youtube video from a skilled youtuber who knows XCP-ng very well, tests beta releases, etc. So there is a security issue here in XCP-ng's case where we don't distribute Microsoft's certs due to their license having restrictions which are incompatible with Free Software. |
A difference between uefistored and varstored was a change we made on purpose to avoid giving users a false sense of security.
If varstored is told to enforce SecureBoot, it will silently decide not to enforce it if there's any issue with the certificates in the VM's NVRAM. Missing certificates, broken chain of trust...
Example as seen in daemon.log. Nothing tells that secure boot was actually disabled at the last minute:
It may be consistent with the UEFI specifications, and may make sense for hardware. But in the context of a hypervisor, for users who probably don't understand how exactly the certificates are handled and how all this works, this is confusing: they ask for SecureBoot and the VM boots, so the logical assumption is: nothing went wrong and SecureBoot is enforced. The only way to be sure that it's true is by checking from within the VM.
In uefistored, without a proper means to give feedback to XAPI, we simply made uefistored kill itself with an error log, after sending a VM_SECURE_BOOT_FAILED message to XAPI. It's not perfect, but at least a VM with missing or broken certificates would not boot if users asked for SecureBoot and we can't give it to them. It's not exactly a SecureBoot failure, but it was close enough for us to reuse the VM_SECURE_BOOT_FAILED. We could also have created a different error but it would have been hard to contribute to XAPI at the time.
Could we improve this in varstored and/or XAPI?
We can certainly contribute the changes if we agree on a design.
The text was updated successfully, but these errors were encountered: