46968b6
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
46968b6
From: Daniel Axtens <dja@axtens.net>
46968b6
Date: Sat, 15 Aug 2020 02:00:57 +1000
46968b6
Subject: [PATCH] docs/grub: Document signing grub under UEFI
46968b6
46968b6
Before adding information about how grub is signed with an appended
46968b6
signature scheme, it's worth adding some information about how it
46968b6
can currently be signed for UEFI.
46968b6
46968b6
Signed-off-by: Daniel Axtens <dja@axtens.net>
46968b6
---
46968b6
 docs/grub.texi | 22 +++++++++++++++++++++-
46968b6
 1 file changed, 21 insertions(+), 1 deletion(-)
46968b6
46968b6
diff --git a/docs/grub.texi b/docs/grub.texi
e622855
index 4870faaa00..365d1d6931 100644
46968b6
--- a/docs/grub.texi
46968b6
+++ b/docs/grub.texi
13985b0
@@ -5817,6 +5817,7 @@ environment variables and commands are listed in the same order.
46968b6
 * Secure Boot Advanced Targeting::   Embedded information for generation number based revocation
46968b6
 * Measured Boot::                    Measuring boot components
46968b6
 * Lockdown::                         Lockdown when booting on a secure setup
46968b6
+* Signing GRUB itself::              Ensuring the integrity of the GRUB core image
46968b6
 @end menu
46968b6
 
46968b6
 @node Authentication and authorisation
13985b0
@@ -5895,7 +5896,7 @@ commands.
46968b6
 
46968b6
 GRUB's @file{core.img} can optionally provide enforcement that all files
46968b6
 subsequently read from disk are covered by a valid digital signature.
46968b6
-This document does @strong{not} cover how to ensure that your
46968b6
+This section does @strong{not} cover how to ensure that your
46968b6
 platform's firmware (e.g., Coreboot) validates @file{core.img}.
46968b6
 
46968b6
 If environment variable @code{check_signatures}
13985b0
@@ -6067,6 +6068,25 @@ be restricted and some operations/commands cannot be executed.
46968b6
 The @samp{lockdown} variable is set to @samp{y} when the GRUB is locked down.
46968b6
 Otherwise it does not exit.
46968b6
 
46968b6
+@node Signing GRUB itself
46968b6
+@section Signing GRUB itself
46968b6
+
46968b6
+To ensure a complete secure-boot chain, there must be a way for the code that
46968b6
+loads GRUB to verify the integrity of the core image.
46968b6
+
46968b6
+This is ultimately platform-specific and individual platforms can define their
46968b6
+own mechanisms. However, there are general-purpose mechanisms that can be used
46968b6
+with GRUB.
46968b6
+
46968b6
+@section Signing GRUB for UEFI secure boot
46968b6
+
46968b6
+On UEFI platforms, @file{core.img} is a PE binary. Therefore, it can be signed
46968b6
+with a tool such as @command{pesign} or @command{sbsign}. Refer to the
46968b6
+suggestions in @pxref{UEFI secure boot and shim} to ensure that the final
46968b6
+image works under UEFI secure boot and can maintain the secure-boot chain. It
46968b6
+will also be necessary to enrol the public key used into a relevant firmware
46968b6
+key database.
46968b6
+
46968b6
 @node Platform limitations
46968b6
 @chapter Platform limitations
46968b6