Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1nhRXv-0003Po-Gt for mharc-grub-devel@gnu.org; Thu, 21 Apr 2022 03:48:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36338) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nhRXI-00037E-Qz for grub-devel@gnu.org; Thu, 21 Apr 2022 03:47:37 -0400 Received: from mail-pj1-x1036.google.com ([2607:f8b0:4864:20::1036]:45853) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nhRXE-00019A-9T for grub-devel@gnu.org; Thu, 21 Apr 2022 03:47:29 -0400 Received: by mail-pj1-x1036.google.com with SMTP id n33-20020a17090a5aa400b001d28f5ee3f9so4414133pji.4 for ; Thu, 21 Apr 2022 00:47:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=axtens.net; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=VR4TCeufY4kft0uBlUzt1gEiyCAmvRwsffiS1krC9Mc=; b=RVmRU/v86f39xaDHfrDqE3H8Nvlkr7bJZz0xm+SvPaRXzkb7W0YxftTHGdfhHAPoz4 /fIj9ZgtpZDviKDcq40mGgh/zA//CzJWNtrRuW7QEhIpndcuTtZOhogIWurNhTbJ8Zft zCbQL+Th6maHEIPVl3zquoyOdFyIUhAKOhIgc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=VR4TCeufY4kft0uBlUzt1gEiyCAmvRwsffiS1krC9Mc=; b=JL7EY+Vljwhk5Kixsot5AYbViUPUoI8OPZah4Ki3w1QQf9ogkxTaGEKZehwnTAUleK l7ws+EjuPXlzyW/P1fXO9DNRDyyiHZjDRt8E5jzIzd+awZp36lWxIKnIDpXUhxHQbQQJ VqBMx5slRD2xI/KGQtrPPEVICBgPr0GfVKXFIFRaw2pZN5aljtL9F8oocGWIgrahdX+v vFgvl8AEjuThVG3mXqFBK4sVjUdK2C8HrpPekF++dXuWjpgVOJgz6jTWjVEbcmbep0QT tqBckOp0NZzS/donFL81uS2hl4m5LLlZLuCYT4oPCTCfePcfVRmOcWHiqd3md+DIWGTY KJPQ== X-Gm-Message-State: AOAM530GaDy1BiwW0w3JPi0EU0o7KJHe/b4NMLa+TCbA1AAaMthkMHts rXyGiSfaTrGVo69AcYfteVARfKQZCsqdRA== X-Google-Smtp-Source: ABdhPJzrRyclToF7GFRDsWdImZAAMh93sds8MkUAD2yPqIbt5LarmY7tGEwn3+W4iGbIzUZliMlZ4A== X-Received: by 2002:a17:902:e84d:b0:158:cd1b:8168 with SMTP id t13-20020a170902e84d00b00158cd1b8168mr23923784plg.43.1650527246877; Thu, 21 Apr 2022 00:47:26 -0700 (PDT) Received: from localhost ([2001:4479:e000:e400:4260:be14:52a8:8c94]) by smtp.gmail.com with ESMTPSA id p6-20020a17090a2c4600b001cb78f1e301sm1716106pjm.1.2022.04.21.00.47.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Apr 2022 00:47:26 -0700 (PDT) From: Daniel Axtens To: grub-devel@gnu.org Cc: rashmica.g@gmail.com, alastair@d-silva.org, nayna@linux.ibm.com, sudhakar@linux.ibm.com, Daniel Axtens , Stefan Berger Subject: [PATCH v3 02/19] docs/grub: Document signing grub under UEFI Date: Thu, 21 Apr 2022 17:46:57 +1000 Message-Id: <20220421074714.1561049-3-dja@axtens.net> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220421074714.1561049-1-dja@axtens.net> References: <20220421074714.1561049-1-dja@axtens.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2607:f8b0:4864:20::1036; envelope-from=dja@axtens.net; helo=mail-pj1-x1036.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Apr 2022 07:47:38 -0000 Before adding information about how grub is signed with an appended signature scheme, it's worth adding some information about how it can currently be signed for UEFI. Signed-off-by: Daniel Axtens Reviewed-by: Stefan Berger --- docs/grub.texi | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/docs/grub.texi b/docs/grub.texi index 9835c878affc..fdf2884b814f 100644 --- a/docs/grub.texi +++ b/docs/grub.texi @@ -5859,6 +5859,7 @@ environment variables and commands are listed in the same order. * Secure Boot Advanced Targeting:: Embedded information for generation number based revocation * Measured Boot:: Measuring boot components * Lockdown:: Lockdown when booting on a secure setup +* Signing GRUB itself:: Ensuring the integrity of the GRUB core image @end menu @node Authentication and authorisation @@ -5937,7 +5938,7 @@ commands. GRUB's @file{core.img} can optionally provide enforcement that all files subsequently read from disk are covered by a valid digital signature. -This document does @strong{not} cover how to ensure that your +This section does @strong{not} cover how to ensure that your platform's firmware (e.g., Coreboot) validates @file{core.img}. If environment variable @code{check_signatures} @@ -6099,6 +6100,25 @@ be restricted and some operations/commands cannot be executed. The @samp{lockdown} variable is set to @samp{y} when the GRUB is locked down. Otherwise it does not exit. +@node Signing GRUB itself +@section Signing GRUB itself + +To ensure a complete secure-boot chain, there must be a way for the code that +loads GRUB to verify the integrity of the core image. + +This is ultimately platform-specific and individual platforms can define their +own mechanisms. However, there are general-purpose mechanisms that can be used +with GRUB. + +@section Signing GRUB for UEFI secure boot + +On UEFI platforms, @file{core.img} is a PE binary. Therefore, it can be signed +with a tool such as @command{pesign} or @command{sbsign}. Refer to the +suggestions in @pxref{UEFI secure boot and shim} to ensure that the final +image works under UEFI secure boot and can maintain the secure-boot chain. It +will also be necessary to enrol the public key used into a relevant firmware +key database. + @node Platform limitations @chapter Platform limitations -- 2.32.0