Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp248601pxb; Thu, 2 Sep 2021 03:21:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyFP23V3cS6AvTHSRS+QqWJWleMom3F9RivqUgx4+dFs+UJzUyQlLXJcy2AUt3S6yl99sC6 X-Received: by 2002:a92:d0cc:: with SMTP id y12mr1719470ila.38.1630578071940; Thu, 02 Sep 2021 03:21:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630578071; cv=none; d=google.com; s=arc-20160816; b=roG4UyoYLLZ99u8MKIGYiuHNZT60GXFYq7c+b0BCdqk+Z4W7tdXkkDJLaTXaIaGnPE qgjXyOBQ6BuJo4slHp3HoajBThY5hi6rmxsDlmFnicKoMNbv50hsxkxe6MlfOBNCHodi AbDCm76DDYCr77rk8mL2iKEibEL2bV2HT/4bRa7z8RlK25mbvIJr/5JuizZ6Of7eZ5YI kpfcAJyzdIn6j/avcqT4d+MTPYTkG2/yMORITy6cUAiZP32YPiKbCbzptUaA179NuWpO X7M9cwMPsg0RWq6zXLjo/+fob2MR8dbhZszrQ470YoDvV7rG6MuHAUj5/mVFNLQMbqdz un6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id :dkim-signature; bh=qJKX3OAaHlW+MwDMgKwO9dzOxTJmQcQS8OEW09vAzkM=; b=HfYZUKXH2FzE//y14vXoCsPoXVZMaO0K6lNGZ8A9MFKU8ueDIbRyC6PU5940Ayf2hQ 5YzWdEkdAfDWpzR4tk7xOSOezYFCJO04afL1OAVF0cvBGCWn+vYcJH55lfgO71NUmuM+ kuX5qt0lW/KQv66dhODDkdwKCoxrpuABLuRF0QT5ZUSmpkIXCy3PxqcEcWMZvqAl56EW QpNmVH8XxCVPH1RA4NQKY7vnDWK9s5BSJTNCu6+KqISxy8l0OmXbporZ0ZWzo5GZwNqu QeS3bPhz1PuwR5DLirL3C+i7uBfos+DBsyXYhXk2kHB9arwiuFWp7YcT94J7YsBIZIqs UuRg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=PzeYjjT5; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k5si1825277jaa.25.2021.09.02.03.20.49; Thu, 02 Sep 2021 03:21:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=PzeYjjT5; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242593AbhIBKUa (ORCPT + 99 others); Thu, 2 Sep 2021 06:20:30 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:45402 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233716AbhIBKU2 (ORCPT ); Thu, 2 Sep 2021 06:20:28 -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 182AGMps189559; Thu, 2 Sep 2021 06:18:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=message-id : subject : from : to : cc : date : in-reply-to : references : content-type : mime-version : content-transfer-encoding; s=pp1; bh=qJKX3OAaHlW+MwDMgKwO9dzOxTJmQcQS8OEW09vAzkM=; b=PzeYjjT5UE7SOybxQLPHr4kSgVYAZOax1uzgwtLaK5AqUbQkLG/fFmnAbfJjOXhf75N3 ofFyy+Q7xqd4Rt+quJFO/xWpGREMieN9g486/kyN5bMmcZSAPf3qPpRVmb2WiRZRWLPB a5/AdTZhoWhzLHwhEkWqj4HW0nYZNtRcwGEOUuWhpis46/f93pahS2NDZri4wdYVYdTr vaaUCl//50ZYDE17nQEo6drbmof0H1mAif2VEl5Y/EIe2HngAF3P9HCejTA5nbmdBgQf BdD6Bqb9C5zYvllHR2r1a1aahjCJ5bfP7P87Ne/DTqCMAvlrgwnVIv9TcDoyiNVIejdN zQ== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 3atvqcg1h1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 02 Sep 2021 06:18:47 -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 182AIksm008444; Thu, 2 Sep 2021 06:18:47 -0400 Received: from ppma01fra.de.ibm.com (46.49.7a9f.ip4.static.sl-reverse.com [159.122.73.70]) by mx0a-001b2d01.pphosted.com with ESMTP id 3atvqcg1gc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 02 Sep 2021 06:18:46 -0400 Received: from pps.filterd (ppma01fra.de.ibm.com [127.0.0.1]) by ppma01fra.de.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 182ABj4c007335; Thu, 2 Sep 2021 10:18:44 GMT Received: from b06cxnps3074.portsmouth.uk.ibm.com (d06relay09.portsmouth.uk.ibm.com [9.149.109.194]) by ppma01fra.de.ibm.com with ESMTP id 3atdxsg8be-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 02 Sep 2021 10:18:44 +0000 Received: from b06wcsmtp001.portsmouth.uk.ibm.com (b06wcsmtp001.portsmouth.uk.ibm.com [9.149.105.160]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 182AIfOW38994286 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 2 Sep 2021 10:18:41 GMT Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 6D38EA405B; Thu, 2 Sep 2021 10:18:41 +0000 (GMT) Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 7B972A4054; Thu, 2 Sep 2021 10:18:35 +0000 (GMT) Received: from sig-9-65-193-241.ibm.com (unknown [9.65.193.241]) by b06wcsmtp001.portsmouth.uk.ibm.com (Postfix) with ESMTP; Thu, 2 Sep 2021 10:18:35 +0000 (GMT) Message-ID: Subject: Re: [PATCH v4 00/12] Enroll kernel keys thru MOK From: Mimi Zohar To: Eric Snowberg , Nayna Cc: James Bottomley , Jarkko Sakkinen , David Howells , keyrings@vger.kernel.org, linux-integrity , David Woodhouse , Herbert Xu , "David S . Miller" , James Morris , "Serge E . Hallyn" , keescook@chromium.org, gregkh@linuxfoundation.org, torvalds@linux-foundation.org, scott.branden@broadcom.com, weiyongjun1@huawei.com, nayna@linux.ibm.com, ebiggers@google.com, ardb@kernel.org, Lakshmi Ramasubramanian , lszubowi@redhat.com, linux-kernel@vger.kernel.org, linux-crypto@vger.kernel.org, linux-security-module@vger.kernel.org, pjones@redhat.com, "konrad.wilk@oracle.com" , Patrick Uiterwijk Date: Thu, 02 Sep 2021 06:18:34 -0400 In-Reply-To: References: <20210819002109.534600-1-eric.snowberg@oracle.com> <91B1FE51-C6FC-4ADF-B05A-B1E59E20132E@oracle.com> <9526a4e0be9579a9e52064dd590a78c6496ee025.camel@linux.ibm.com> <9067ff7142d097698b827f3c1630a751898a76bf.camel@kernel.org> <10bc1017-2b45-43f3-ad91-d09310b24c2c@linux.vnet.ibm.com> <89a37802-1423-6b1c-c0ef-6f84e544ac33@linux.vnet.ibm.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5 (3.28.5-16.el8) Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-GUID: cQVsDurILdUYFQFQw8xB44aL22GCET1q X-Proofpoint-ORIG-GUID: zJvOY9nZGAuZDU2Qq7Ca6IuyxegSX9Hs X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391,18.0.790 definitions=2021-09-02_03:2021-09-01,2021-09-02 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 mlxlogscore=999 spamscore=0 adultscore=0 clxscore=1015 malwarescore=0 priorityscore=1501 phishscore=0 impostorscore=0 lowpriorityscore=0 suspectscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2108310000 definitions=main-2109020063 Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Tue, 2021-08-31 at 19:51 -0600, Eric Snowberg wrote: > > On Aug 31, 2021, at 6:52 PM, Nayna wrote: > > On 8/30/21 1:39 PM, Eric Snowberg wrote: > >>> On Aug 27, 2021, at 2:44 PM, Nayna wrote: > >>> On 8/25/21 6:27 PM, James Bottomley wrote: > >>>> Remember, a CA cert is a self signed cert with the CA:TRUE basic > >>>> constraint. Pretty much no secure boot key satisfies this (secure boot > >>>> chose deliberately NOT to use CA certificates, so they're all some type > >>>> of intermediate or leaf), so the design seems to be only to pick out > >>>> the CA certificates you put in the MOK keyring. Adding the _ca suffix > >>>> may deflect some of the "why aren't all my MOK certificates in the > >>>> keyring" emails ... > >>> > >>> My understanding is the .system_ca keyring should not be restricted only > >>> to self-signed CAs (Root CA). Any cert that can qualify as Root or > >>> Intermediate CA with Basic Constraints CA:TRUE should be allowed. In > >>> fact, the intermediate CA certificates closest to the leaf nodes would be > >>> best. > >> With an intermediate containing CA:TRUE, the intermediate cert would not > >> be self signed. Just for my clarification, does this mean I should remove > >> the check that validates if it is self signed and instead somehow check if > >> the CA flag is set? Wouldn’t this potentially allow improperly signed certs > >> into this new keyring? > >> > > In this model, we are relying on the admin to ensure the authenticity of the certificate(s) being loaded onto the new keyring. It is similar to trusting the admin to enable the variable and add keys to MOK. Following are the checks that must pass before adding it to .system_ca keyring. > > > > 1. Check against revocation_list. > > 2. Check Basic Constraints: CA=TRUE. > > 3. Check keyUsage = keyCertSign. > > Originally I thought the request to only load CA certs into this new keyring > was so root of trust could be validated for the entire chain. If a portion > of the model now relies on the admin to ensure authenticity, and the complete > chain is not needed, why not have the admin also check for #2 and #3? Meaning, > when the Kconfig option is enabled and the new MokListTrustedRT UEFI is set, > whatever the admin has placed in the MOKList goes into this new keyring. The root of trust for the new "machine" keyring, at least in the UEFI use case, is registering keys in the MOK db, which requires physical presence. So we're trusting the MOK db, which means we're really trusting both the admin and UEFI to do the right things. There is no harm in verifying the CA assumption when loading the certs onto the "machine" keyring. From an IMA perspective, all that is needed to sign an IMA custom policy and local code is the ability to load a single self-signed CA certificate. So the self-signed CA restriction is fine. Obviously other use cases are being discussed here. If the other use cases want to relax the self-signed CA restriction to allow intermediary CA's, it should be explicitly called out in a separate patch, with its own patch description, providing the motivation. thanks, Mimi