[libvirt PATCH v2 0/2] kbase: Improve secureboot page

Changes from [v1]: * document configuration where Secure Boot support is completely absent, not just inactive; * explain in more detail how the various firmware features interact with one another. [v1] https://listman.redhat.com/archives/libvir-list/2022-August/233449.html Andrea Bolognani (2): kbase: Always explicitly enable secure-boot firmware feature kbase: Document how to disable Secure Boot entirely docs/kbase/secureboot.rst | 34 +++++++++++++++++++++++++++++++--- 1 file changed, 31 insertions(+), 3 deletions(-) -- 2.37.1

It should be enough to enable or disable the enrolled-keys feature to control whether Secure Boot is enforced, but there's a slight complication: many distro packages for edk2 include, in addition to general purpose firmware images, builds that are targeting the Confidential Computing use case. For those, the firmware descriptor will not advertise the enrolled-keys feature, which will technically make them suitable for satisfying a configuration such as <os firmware='efi'> <firmware> <feature state='off' name='enrolled-keys'/> </firmware> </os> In practice, users will expect the general purpose build to be used in this case. Explicitly asking for the secure-boot feature to be enabled achieves that result at the cost of some slight additional verbosity. Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- docs/kbase/secureboot.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/kbase/secureboot.rst b/docs/kbase/secureboot.rst index 8f151c1f2a..5fa59ad5e2 100644 --- a/docs/kbase/secureboot.rst +++ b/docs/kbase/secureboot.rst @@ -14,6 +14,7 @@ ask for Secure Boot to be enabled with <os firmware='efi'> <firmware> + <feature enabled='yes' name='secure-boot'/> <feature enabled='yes' name='enrolled-keys'/> </firmware> </os> @@ -24,6 +25,7 @@ and for it to be disabled with <os firmware='efi'> <firmware> + <feature enabled='yes' name='secure-boot'/> <feature enabled='no' name='enrolled-keys'/> </firmware> </os> @@ -44,6 +46,7 @@ snippet: <os firmware='efi'> <loader secure='yes'/> <firmware> + <feature enabled='yes' name='secure-boot'/> <feature enabled='yes' name='enrolled-keys'/> </firmware> </os> -- 2.37.1

On Thu, Aug 04, 2022 at 12:16:41PM +0200, Andrea Bolognani wrote:
It should be enough to enable or disable the enrolled-keys feature to control whether Secure Boot is enforced, but there's a slight complication: many distro packages for edk2 include, in addition to general purpose firmware images, builds that are targeting the Confidential Computing use case.
For those, the firmware descriptor will not advertise the enrolled-keys feature, which will technically make them suitable for satisfying a configuration such as
<os firmware='efi'> <firmware> <feature state='off' name='enrolled-keys'/> </firmware> </os>
In practice, users will expect the general purpose build to be used in this case. Explicitly asking for the secure-boot feature to be enabled achieves that result at the cost of some slight additional verbosity.
Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- docs/kbase/secureboot.rst | 3 +++ 1 file changed, 3 insertions(+)
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> With regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|

In most cases, disabling the secure-boot or the enrolled-keys firmware feature will achieve the same result: allowing an unsigned operating system to run. Right now we're only documenting the latter configuration. Add the former as well, and explain the difference between the two. Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- docs/kbase/secureboot.rst | 31 ++++++++++++++++++++++++++++--- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/docs/kbase/secureboot.rst b/docs/kbase/secureboot.rst index 5fa59ad5e2..4340454a7b 100644 --- a/docs/kbase/secureboot.rst +++ b/docs/kbase/secureboot.rst @@ -19,7 +19,17 @@ ask for Secure Boot to be enabled with </firmware> </os> -and for it to be disabled with +and for it to be disabled with either + +:: + + <os firmware='efi'> + <firmware> + <feature enabled='no' name='secure-boot'/> + </firmware> + </os> + +or :: @@ -30,8 +40,10 @@ and for it to be disabled with </firmware> </os> -These configuration will cause unsigned guest operating systems to -be rejected and allowed respectively. +The first configuration will cause unsigned guest operating systems +to be rejected, while the remaining two will allow running them. See +below for a more detailed explanation of how each knob affects the +firmware selection process. Older libvirt versions @@ -103,3 +115,16 @@ The opposite configuration, where the feature is explicitly disabled, will result in no keys being present in the NVRAM file. Unable to verify signatures, the firmware will allow even unsigned operating systems to run. + +If running unsigned code is desired, it's also possible to ask for +the ``secure-boot`` feature to be disabled, which will cause libvirt +to pick a build of EDKII that doesn't have Secure Boot support at +all. + +The main difference between using a build of EDKII that has Secure +Boot support but without keys enrolled and one that doesn't have +Secure Boot support at all is that, with the former, you could enroll +your own keys and securely run an operating system that you've built +and signed yourself. If you are only planning to run existing, +off-the-shelf operating system images, then the two configurations +are functionally equivalent. -- 2.37.1

On Thu, Aug 04, 2022 at 12:16:42PM +0200, Andrea Bolognani wrote:
In most cases, disabling the secure-boot or the enrolled-keys firmware feature will achieve the same result: allowing an unsigned operating system to run.
Right now we're only documenting the latter configuration. Add the former as well, and explain the difference between the two.
Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- docs/kbase/secureboot.rst | 31 ++++++++++++++++++++++++++++--- 1 file changed, 28 insertions(+), 3 deletions(-)
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> With regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
participants (2)
-
Andrea Bolognani
-
Daniel P. Berrangé