From: Mimi Zohar <zohar@linux.ibm.com>
To: Eric Snowberg <eric.snowberg@oracle.com>,
Coiby Xu <coxu@redhat.com>, Jarkko Sakkinen <jarkko@kernel.org>
Cc: David Howells <dhowells@redhat.com>,
David Woodhouse <dwmw2@infradead.org>,
"herbert@gondor.apana.org.au" <herbert@gondor.apana.org.au>,
"davem@davemloft.net" <davem@davemloft.net>,
"dmitry.kasatkin@gmail.com" <dmitry.kasatkin@gmail.com>,
"paul@paul-moore.com" <paul@paul-moore.com>,
"jmorris@namei.org" <jmorris@namei.org>,
"serge@hallyn.com" <serge@hallyn.com>,
"pvorel@suse.cz" <pvorel@suse.cz>,
"noodles@fb.com" <noodles@fb.com>,
"tiwai@suse.de" <tiwai@suse.de>, "bp@suse.de" <bp@suse.de>,
Kanth Ghatraju <kanth.ghatraju@oracle.com>,
Konrad Wilk <konrad.wilk@oracle.com>,
Elaine Palmer <erpalmer@linux.vnet.ibm.com>,
"keyrings@vger.kernel.org" <keyrings@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-crypto@vger.kernel.org" <linux-crypto@vger.kernel.org>,
"linux-integrity@vger.kernel.org"
<linux-integrity@vger.kernel.org>,
"linux-security-module@vger.kernel.org"
<linux-security-module@vger.kernel.org>
Subject: Re: [PATCH v2 00/10] Add CA enforcement keyring restrictions
Date: Mon, 12 Dec 2022 16:44:22 -0500 [thread overview]
Message-ID: <d9060f9765e59b5fd46c9f7c6a8682a29e712120.camel@linux.ibm.com> (raw)
In-Reply-To: <5AF81A9E-C4E7-4BEB-86E1-4D2DB613FBF1@oracle.com>
Hi Eric, Coiby,
On Fri, 2022-12-09 at 15:44 +0000, Eric Snowberg wrote:
> > On Dec 9, 2022, at 3:26 AM, Coiby Xu <coxu@redhat.com> wrote:
> >
> > Thanks for your work! The patch set looks good to me except for the
> > requirement of an intermediate CA certificate should be vouched for by a
> > root CA certificate before it can vouch for other certificates. What if
> > users only want to enroll an intermediate CA certificate into the MOK?
>
> This question would need to be answered by the maintainers. The intermediate
> requirement was based on my understanding of previous discussions requiring
> there be a way to validate root of trust all the way back to the root CA.
That definitely did not come from me. My requirement all along has
been to support a single self-signed CA certificate for the end
user/customer use case, so that they could create and load their own
public key, signed by that CA, onto the trusted IMA/EVM keyrings.
>
> > If this requirement could be dropped, the code could be simplified and
> > some issues could be resolved automatically,
>
> Agreed. I will make sure the issue below is resolved one way or the other,
> once we have an agreement on the requirements.
I totally agree with Coiby that there is no need for intermediate CA
certificates be vouched for by a root CA certificate. In fact the
closer the CA certificate is to the leaf code signing certificate, the
better. As much as possible we want to limit the CA keys being loaded
onto the machine keyring to those that are absolutely required.
thanks,
Mimi
>
> > 1. "[PATCH v2 03/10] KEYS: X.509: Parse Basic
> > a root_ca filed to a certificate to indicate the subject of the
> > certificate is a CA. The name root_ca implies it's also a root CA. But
> > according to [1], both an intermediate and root CA will have
> > root_ca=True. For example, the intermediate certificate of
> > https://www.kernel.org/ has "Certificate Authority=Yes" in the basic
> > constraints. Btw, a root CA certificate by definition is self-signed,
> > so the following code in "[PATCH v2 05/10] KEYS: Introduce a CA
> > endorsed flag" looks a bit strange to me,
> > if (cert->kcs_set && cert->self_signed && cert->root_ca)
> > prep->payload_flags |= KEY_ALLOC_PECA;
> >
> > 2. Since an intermediate CA certificate also has root_ca=True,
> > "[PATCH v2 07/10] KEYS: X.509: Flag Intermediate CA certs as
> > endorsed" won't work as intended i.e. this following else branch
> > will never be reached,
> > else if (!cert->self_signed && !cert->root_ca)
> > prep->payload_flags |= KEY_MAYBE_PECA;
> >
> > 3. I see nowhere public_key->key_is_ca is set to true for an intermediate
> > CA certificate after it gains the KEY_ALLOC_PECA flag. So it will fail
> > restrict_link_by_ca even if the KEY_MAYBE_PECA flag is added.
> >
> > [1] https://www.rfc-editor.org/rfc/rfc5280#section-4.2.1.9
>
> Thanks for reviewing the series.
>
next prev parent reply other threads:[~2022-12-12 21:44 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-07 17:12 [PATCH v2 00/10] Add CA enforcement keyring restrictions Eric Snowberg
2022-12-07 17:12 ` [PATCH v2 01/10] KEYS: Create static version of public_key_verify_signature Eric Snowberg
2022-12-07 17:52 ` Petr Vorel
2022-12-07 17:12 ` [PATCH v2 02/10] KEYS: Add missing function documentation Eric Snowberg
2022-12-08 5:22 ` Petr Vorel
2022-12-07 17:12 ` [PATCH v2 03/10] KEYS: X.509: Parse Basic Constraints for CA Eric Snowberg
2022-12-07 17:12 ` [PATCH v2 04/10] KEYS: X.509: Parse Key Usage Eric Snowberg
2022-12-07 17:12 ` [PATCH v2 05/10] KEYS: Introduce a CA endorsed flag Eric Snowberg
2022-12-07 17:12 ` [PATCH v2 06/10] KEYS: Introduce keyring restriction that validates ca trust Eric Snowberg
2022-12-07 17:12 ` [PATCH v2 07/10] KEYS: X.509: Flag Intermediate CA certs as endorsed Eric Snowberg
2022-12-07 17:12 ` [PATCH v2 08/10] integrity: Use root of trust signature restriction Eric Snowberg
2022-12-07 17:12 ` [PATCH v2 09/10] KEYS: CA link restriction Eric Snowberg
2022-12-07 17:12 ` [PATCH v2 10/10] integrity: restrict INTEGRITY_KEYRING_MACHINE to restrict_link_by_ca Eric Snowberg
2022-12-09 10:26 ` [PATCH v2 00/10] Add CA enforcement keyring restrictions Coiby Xu
2022-12-09 15:44 ` Eric Snowberg
2022-12-12 21:44 ` Mimi Zohar [this message]
2022-12-13 2:41 ` Eric Snowberg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=d9060f9765e59b5fd46c9f7c6a8682a29e712120.camel@linux.ibm.com \
--to=zohar@linux.ibm.com \
--cc=bp@suse.de \
--cc=coxu@redhat.com \
--cc=davem@davemloft.net \
--cc=dhowells@redhat.com \
--cc=dmitry.kasatkin@gmail.com \
--cc=dwmw2@infradead.org \
--cc=eric.snowberg@oracle.com \
--cc=erpalmer@linux.vnet.ibm.com \
--cc=herbert@gondor.apana.org.au \
--cc=jarkko@kernel.org \
--cc=jmorris@namei.org \
--cc=kanth.ghatraju@oracle.com \
--cc=keyrings@vger.kernel.org \
--cc=konrad.wilk@oracle.com \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-integrity@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-security-module@vger.kernel.org \
--cc=noodles@fb.com \
--cc=paul@paul-moore.com \
--cc=pvorel@suse.cz \
--cc=serge@hallyn.com \
--cc=tiwai@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).