Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1m2vIq-000330-5H for mharc-grub-devel@gnu.org; Mon, 12 Jul 2021 08:44:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43226) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m2vIi-0002z4-T5 for grub-devel@gnu.org; Mon, 12 Jul 2021 08:44:49 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:57280) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m2vIh-0006rJ-9S for grub-devel@gnu.org; Mon, 12 Jul 2021 08:44:44 -0400 Received: from pps.filterd (m0098404.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 16CCZDMl175990; Mon, 12 Jul 2021 08:44:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=subject : to : cc : references : from : message-id : date : mime-version : in-reply-to : content-type : content-transfer-encoding; s=pp1; bh=L2CV5UgjShQPvMqpOprvfRkrVMzOqL2Dqh+VgP5bvO4=; b=KRgbYb/yORCeh+krttSodoxI7YBcQxi+661Ss2ZXcvNszEwJlmzGdtFe+YBrgA6VIgha 2XAPHK1ArWRXDWQvROu3j0ELOdUAne6qxg7NMe+hG/U0dkpofV5rUW1Re8qjYirBLVXj VIgYmCXQNptUWC6XjEjI5EtN8dFF5ddyhKs9opzULoNdSlfN1k+1sGAAtgTHXvdJR9PZ 9cqriiZ/ulTHIABr7xfCn3rr4wyo9sZI2wbWip8cv2jM7Cvram3QFZHvo0hH4jCVnMYz qggzYB6wqMZNjbSaWEHUP/zagjCoavycifbMUNO3TnUycp2zGGbGlVMtDgLFQObdJ5T0 yA== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 39rn57sm05-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 12 Jul 2021 08:44:41 -0400 Received: from m0098404.ppops.net (m0098404.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.43/8.16.0.43) with SMTP id 16CCZO3P177002; Mon, 12 Jul 2021 08:44:40 -0400 Received: from ppma03dal.us.ibm.com (b.bd.3ea9.ip4.static.sl-reverse.com [169.62.189.11]) by mx0a-001b2d01.pphosted.com with ESMTP id 39rn57skyr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 12 Jul 2021 08:44:40 -0400 Received: from pps.filterd (ppma03dal.us.ibm.com [127.0.0.1]) by ppma03dal.us.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 16CChfiO007946; Mon, 12 Jul 2021 12:44:39 GMT Received: from b01cxnp23034.gho.pok.ibm.com (b01cxnp23034.gho.pok.ibm.com [9.57.198.29]) by ppma03dal.us.ibm.com with ESMTP id 39rkgswf4a-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 12 Jul 2021 12:44:39 +0000 Received: from b01ledav004.gho.pok.ibm.com (b01ledav004.gho.pok.ibm.com [9.57.199.109]) by b01cxnp23034.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 16CCicHa37749026 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 12 Jul 2021 12:44:39 GMT Received: from b01ledav004.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D25B511206D; Mon, 12 Jul 2021 12:44:38 +0000 (GMT) Received: from b01ledav004.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C58AA11207A; Mon, 12 Jul 2021 12:44:38 +0000 (GMT) Received: from [9.47.158.152] (unknown [9.47.158.152]) by b01ledav004.gho.pok.ibm.com (Postfix) with ESMTP; Mon, 12 Jul 2021 12:44:38 +0000 (GMT) Subject: Re: [PATCH v2 05/22] docs/grub: Document signing grub under UEFI To: The development of GNU GRUB , Daniel Axtens Cc: rashmica.g@gmail.com, alastair@d-silva.org, nayna@linux.ibm.com References: <20210630084031.2663622-1-dja@axtens.net> <20210630084031.2663622-6-dja@axtens.net> From: Stefan Berger Message-ID: Date: Mon, 12 Jul 2021 08:44:38 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <20210630084031.2663622-6-dja@axtens.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-TM-AS-GCONF: 00 X-Proofpoint-GUID: HB-nw92KRVBJm8IwPQqcjCvIk759uqJA X-Proofpoint-ORIG-GUID: A1uCRkEO1Ysn6-OMCnss6Tzp2LNjNGuF X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391, 18.0.790 definitions=2021-07-12_07:2021-07-12, 2021-07-12 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 phishscore=0 mlxlogscore=999 bulkscore=0 malwarescore=0 clxscore=1015 spamscore=0 mlxscore=0 priorityscore=1501 adultscore=0 suspectscore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2107120099 Received-SPF: pass client-ip=148.163.156.1; envelope-from=stefanb@linux.ibm.com; helo=mx0a-001b2d01.pphosted.com X-Spam_score_int: -34 X-Spam_score: -3.5 X-Spam_bar: --- X-Spam_report: (-3.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, NICE_REPLY_A=-1.479, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Jul 2021 12:44:49 -0000 On 6/30/21 4:40 AM, Daniel Axtens wrote: > 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 f8b4b3b21a7f..2ffc3b417312 100644 > --- a/docs/grub.texi > +++ b/docs/grub.texi > @@ -5795,6 +5795,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 > @@ -5873,7 +5874,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} > @@ -6035,6 +6036,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 >