From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1kddLl-0001Lv-U4 for mharc-grub-devel@gnu.org; Fri, 13 Nov 2020 12:59:05 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:39540) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kddLk-0001Lh-Eq for grub-devel@gnu.org; Fri, 13 Nov 2020 12:59:04 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:42004) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kddLi-0001FS-FQ for grub-devel@gnu.org; Fri, 13 Nov 2020 12:59:04 -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 0ADHrcdV086743; Fri, 13 Nov 2020 12:58:59 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=message-id : subject : from : reply-to : to : cc : date : in-reply-to : references : content-type : mime-version : content-transfer-encoding; s=pp1; bh=+PwaDeXZDJNa1No02dRHqiuiVG54WDq6lQQ3iSNwfnI=; b=EsdPSBEV1nKrzgpHb4z7gSgBHKg+5xMWO/RYBskNNQvrn1gsPxb1J1NbczrvFsl+eHFq AG9EbS3s+KuRc7eKMVWhWvhtJruD52ndHN80BSD8BkrOCPe0WIIyvjFGGPtSRWc9KcR9 tqSDLlD8E6lpiXXFhpdH1Xyq43O4yqvUSW8CcAte09euXvTIJCmko7f20tDM6Nvowtvg hSKLCIzXMOgrL/xsSSdh5SgW13omeY0QpE3PIFYqUgaItNhcXzMRkSoX6Pq8RX3StVDC SCkTdYWujRaqZzw6FbCX4ACRq1tENNNtEZiYEyOOVt1E6YF0tlXoyxmfDOf2xeCkNkCH cA== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 34sxt4rav2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 13 Nov 2020 12:58:59 -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 0ADHtr1R092642; Fri, 13 Nov 2020 12:58:58 -0500 Received: from ppma01dal.us.ibm.com (83.d6.3fa9.ip4.static.sl-reverse.com [169.63.214.131]) by mx0a-001b2d01.pphosted.com with ESMTP id 34sxt4raus-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 13 Nov 2020 12:58:58 -0500 Received: from pps.filterd (ppma01dal.us.ibm.com [127.0.0.1]) by ppma01dal.us.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 0ADHwEa4032582; Fri, 13 Nov 2020 17:58:58 GMT Received: from b03cxnp07029.gho.boulder.ibm.com (b03cxnp07029.gho.boulder.ibm.com [9.17.130.16]) by ppma01dal.us.ibm.com with ESMTP id 34nk7b9h4s-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 13 Nov 2020 17:58:57 +0000 Received: from b03ledav004.gho.boulder.ibm.com (b03ledav004.gho.boulder.ibm.com [9.17.130.235]) by b03cxnp07029.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 0ADHwsXb12255976 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 13 Nov 2020 17:58:54 GMT Received: from b03ledav004.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 6213778067; Fri, 13 Nov 2020 17:58:54 +0000 (GMT) Received: from b03ledav004.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id BB7737805F; Fri, 13 Nov 2020 17:58:51 +0000 (GMT) Received: from jarvis.int.hansenpartnership.com (unknown [9.85.145.64]) by b03ledav004.gho.boulder.ibm.com (Postfix) with ESMTP; Fri, 13 Nov 2020 17:58:51 +0000 (GMT) Message-ID: <16aa7a05356dc710ca18b5e954617cc9d4acd286.camel@linux.ibm.com> Subject: Re: [PATCH 0/3] Add ability to use SEV provisioned secrets for disk decryption From: James Bottomley Reply-To: jejb@linux.ibm.com To: "Dr. David Alan Gilbert" Cc: grub-devel@gnu.org, 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, frankeh@us.ibm.com Date: Fri, 13 Nov 2020 09:58:50 -0800 In-Reply-To: <20201113175015.GS3251@work-vm> References: <20201113012206.24246-1-jejb@linux.ibm.com> <20201113175015.GS3251@work-vm> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.34.4 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.312, 18.0.737 definitions=2020-11-13_10:2020-11-13, 2020-11-13 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 bulkscore=0 spamscore=0 malwarescore=0 priorityscore=1501 adultscore=0 impostorscore=0 mlxlogscore=999 clxscore=1015 suspectscore=0 mlxscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2011130111 Received-SPF: pass client-ip=148.163.158.5; envelope-from=jejb@linux.ibm.com; helo=mx0b-001b2d01.pphosted.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/11/13 12:59:01 X-ACL-Warn: Detected OS = Linux 3.x [generic] X-Spam_score_int: -19 X-Spam_score: -2.0 X-Spam_bar: -- X-Spam_report: (-2.0 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, 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: Fri, 13 Nov 2020 17:59:04 -0000 On Fri, 2020-11-13 at 17:50 +0000, Dr. David Alan Gilbert wrote: > * James Bottomley (jejb@linux.ibm.com) wrote: > > To achieve encrypted disk images in the AMD SEV encrypted virtual > > machine, we need to add the ability for grub to retrieve the disk > > passphrase from the SEV launch secret. To do this, we've modified > > OVMF to set aside an area for the injected secret and pass up a > > configuration table for it: > > > > https://edk2.groups.io/g/devel/topic/78198617#67339 > > > > 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' option to cryptodisk to allow it to > > use a saved password 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: > > > > sevsecret > > cryptomount -s > > source (crypto0)/boot/grub.cfg > > I was thinking what happens if the evil admin adds an extra disc; I > guess the argument here is that: > a) Since you specify (crypto0) it can only be a decrypted disc > b) And since only the guest owner can supply the keys, it can only > be there disc image that can be decrypted. > > Right? Right, cryptomount will mount as (cryptoN) only those devices which can actually be decrypted by the key. Since the initial grub.cfg is built into the grub that executes from the firmware volume only someone who knows the decryption key can substitute the booted volume. If you substitute an unencrypted volume, the grub.cfg script I constructed simply errors out (because it can't find any encrypted volumes) and reboots. The script is more complicated than the simple illustration above, but it's in this patch: https://edk2.groups.io/g/devel/message/67341?p=,,,20,0,0,0::Created,,PATCH+2%2F4,20,2,0,78198619 James