Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1kv1sd-00083z-H2 for mharc-grub-devel@gnu.org; Thu, 31 Dec 2020 12:36:55 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:49962) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kv1sa-000834-65 for grub-devel@gnu.org; Thu, 31 Dec 2020 12:36:52 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:17450) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kv1sX-0005wh-EL for grub-devel@gnu.org; Thu, 31 Dec 2020 12:36:51 -0500 Received: from pps.filterd (m0098417.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 0BVHWxiR089649; Thu, 31 Dec 2020 12:36:45 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding; s=pp1; bh=oqGyhyDS9TB5Legyuz7D7dUJOnw2C7wma2ROhB2hGqk=; b=JJZqOZV3vkU2Ddr2tYuxvG8f6BAUXBydcu7iILRFE/K9vUroko3oRL0o6vO8Jl1QTzjR JI82pbMEVmOfrM6BYapI5RiGIO0QYmtMSBgo8f94fAUNjr4hwkkkm1DFmnXDiqyUD9qV Q9YjSbwCxfwqBmyW7KYC/XY4Zq9a+JsqHJ+3yJ/7DHz1CoUdAI+xMaTsrRZdJsdSVUtX z/FmBuAbPkeILtcVDpShF1Zf/A0u77uBSEBfaXuW2PhId7Sqho1ShOg57uk3UXjftzOR J3W4ebaZz9Jg9fgsgdc/HIqqTG6nzrZMPQwxepaNVpER3RmxVrk+7hEda1oAAiA7d5ja 3A== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 35sjxmr991-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 31 Dec 2020 12:36:45 -0500 Received: from m0098417.ppops.net (m0098417.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id 0BVHXsIV093029; Thu, 31 Dec 2020 12:36:45 -0500 Received: from ppma02wdc.us.ibm.com (aa.5b.37a9.ip4.static.sl-reverse.com [169.55.91.170]) by mx0a-001b2d01.pphosted.com with ESMTP id 35sjxmr98x-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 31 Dec 2020 12:36:45 -0500 Received: from pps.filterd (ppma02wdc.us.ibm.com [127.0.0.1]) by ppma02wdc.us.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 0BVHai48000533; Thu, 31 Dec 2020 17:36:44 GMT Received: from b03cxnp08025.gho.boulder.ibm.com (b03cxnp08025.gho.boulder.ibm.com [9.17.130.17]) by ppma02wdc.us.ibm.com with ESMTP id 35nvt9ku9m-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 31 Dec 2020 17:36:44 +0000 Received: from b03ledav002.gho.boulder.ibm.com (b03ledav002.gho.boulder.ibm.com [9.17.130.233]) by b03cxnp08025.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 0BVHafTr22282738 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 31 Dec 2020 17:36:41 GMT Received: from b03ledav002.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5036413604F; Thu, 31 Dec 2020 17:36:41 +0000 (GMT) Received: from b03ledav002.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 3EE5C136051; Thu, 31 Dec 2020 17:36:38 +0000 (GMT) Received: from jarvis.int.hansenpartnership.com (unknown [9.85.135.109]) by b03ledav002.gho.boulder.ibm.com (Postfix) with ESMTP; Thu, 31 Dec 2020 17:36:37 +0000 (GMT) From: James Bottomley To: grub-devel@gnu.org Cc: dovmurik@linux.vnet.ibm.com, Dov.Murik1@il.ibm.com, ashish.kalra@amd.com, brijesh.singh@amd.com, tobin@ibm.com, david.kaplan@amd.com, jon.grimm@amd.com, thomas.lendacky@amd.com, jejb@linux.ibm.com, frankeh@us.ibm.com, "Dr . David Alan Gilbert" Subject: [PATCH v3 0/3] use confidential computing provisioned secrets for disk decryption Date: Thu, 31 Dec 2020 09:36:15 -0800 Message-Id: <20201231173618.20751-1-jejb@linux.ibm.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.343, 18.0.737 definitions=2020-12-31_09:2020-12-31, 2020-12-31 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 phishscore=0 mlxlogscore=881 suspectscore=0 adultscore=0 spamscore=0 clxscore=1011 impostorscore=0 mlxscore=0 lowpriorityscore=0 bulkscore=0 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2012310107 Received-SPF: pass client-ip=148.163.158.5; envelope-from=jejb@linux.ibm.com; helo=mx0b-001b2d01.pphosted.com X-Spam_score_int: -26 X-Spam_score: -2.7 X-Spam_bar: -- X-Spam_report: (-2.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-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: Thu, 31 Dec 2020 17:36:52 -0000 v3: make password getter specify prompt requirement. Update for TDX: Make name more generic and expand size of secret area https://github.com/tianocore/edk2/commit/96201ae7bf97c3a2c0ef386110bb93d25e9af1ba https://github.com/tianocore/edk2/commit/caf8b3872ae2ac961c9fdf4d1d2c5d072c207299 Redo the cryptodisk secret handler to make it completely generic and pluggable using a list of named secret providers. Also allow an optional additional argument for secret providers that may have more than one secret. v2: update geli.c to use conditional prompt and add callback for variable message printing and secret destruction To achieve encrypted disk images in the AMD SEV and other confidential computing encrypted virtual machines, we need to add the ability for grub to retrieve the disk passphrase from an OVMF provisioned configuration table. https://github.com/tianocore/edk2/commit/01726b6d23d4c8a870dbd5b96c0b9e3caf38ef3c The patches in this series modify grub to look for the disk passphrase in the secret configuration table and use it to decrypt any disks in the system if they are found. This is so an encrypted image with a properly injected password will boot without any user intervention. The three patches firstly modify the cryptodisk consumers to allow arbitrary password getters instead of the current console based one. The next patch adds a '-s module [id]' option to cryptodisk to allow it to use plugin provided passwords and the final one adds a sevsecret command to check for the secrets configuration table and provision the disk passphrase from it if an entry is found. With all this in place, the sequence to boot an encrypted volume without user intervention is: cryptomount -s efisecret source (crypto0)/boot/grub.cfg Assuming there's a standard Linux root partition. James --- James Bottomley (3): cryptodisk: make the password getter and additional argument to recover_key cryptodisk: add OS provided secret support efi: Add API for retrieving the EFI secret for cryptodisk grub-core/Makefile.core.def | 8 ++ grub-core/disk/cryptodisk.c | 77 ++++++++++++++++- grub-core/disk/efi/efisecret.c | 129 +++++++++++++++++++++++++++++ grub-core/disk/geli.c | 12 +-- grub-core/disk/luks.c | 12 +-- grub-core/disk/luks2.c | 12 +-- grub-core/lib/crypto.c | 4 + grub-core/osdep/unix/password.c | 4 + grub-core/osdep/windows/password.c | 4 + include/grub/cryptodisk.h | 20 ++++- include/grub/efi/api.h | 15 ++++ 11 files changed, 277 insertions(+), 20 deletions(-) create mode 100644 grub-core/disk/efi/efisecret.c -- 2.26.2