linux-integrity.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mimi Zohar <zohar@linux.ibm.com>
To: Lakshmi Ramasubramanian <nramas@linux.microsoft.com>,
	linux-integrity@vger.kernel.org
Cc: James Morris <jamorris@linuxonhyperv.com>,
	David Howells <dhowells@redhat.com>,
	James Bottomley <James.Bottomley@HansenPartnership.com>
Subject: Re: IMA: Data included in the key measurement
Date: Fri, 22 Nov 2019 12:38:18 -0500	[thread overview]
Message-ID: <1574444298.4793.202.camel@linux.ibm.com> (raw)
In-Reply-To: <19242774-688e-58ff-40f8-e346d6ba4339@linux.microsoft.com>

[Cc'ing David Howells, James Bottomley]

On Thu, 2019-11-21 at 08:17 -0800, Lakshmi Ramasubramanian wrote:
> Hi Mimi,
> 
>  >>> everything needed for verifying a signature is included in
>  >>> the key measurement.
> 
> Regarding the requirement you had stated above, I would like some 
> clarification.
> 
> When I started this change to measure keys through IMA, the use case we 
> had in mind was enabling an attestation service, for instance, to verify 
> if the client has only known good (trusted) keys - for example, in 
> keyrings such as ".builtin_trusted_keys", ".ima", etc.
> 
> On the client IMA verifies the signature of system binaries using keys 
> in the IMA keyring. And, if the config namely 
> CONFIG_IMA_KEYRINGS_PERMIT_SIGNED_BY_BUILTIN_OR_SECONDARY is enabled, 
> only keys signed by a built-in trusted key can be added to the IMA keyring.
> 
> An attestation service can keep a list of public keys of "known good 
> (trusted)" keys for various keyrings, and verify against the measurement 
> data provided by the client.

Right, that's true, assuming the attestation server is aware of all
possible public keys, which was the original reason you provided for
measuring the keys on the builtin trusted keyring, not the IMA
keyring.

> 
> To achieve the above we decided to include only the public key in the 
> key measurement buffer.
> 
> I would like to know what benefit we'd get by including "everything 
> needed for verifying a signature in the key measurement"?
> 
>  From testing point of view, if we have the certificate (like the .DER 
> file), we can validate the key measurement data in the IMA log.
> 
> Do you see a need to include more data or the entire cert for the 
> product code?

Your code has come a long way, since you first started.  Please don't
go back to what you originally intended/wanted to do.  Measuring keys
just on the builtin trusted keyring, as you did, was a non starter.
 It would never have been accepted upstream by me and doubtfully by
David.  The current measuring of keys is more generic and properly
isolated to IMA.  This is what I would have expected from the very
beginning.  Only now are the patches at the point, where there is
something to even discuss.

Now that you understand what patches should look like in order to be upstreamed, please look outside of your use-case scenario and think about the bigger picture.  Remember changing the "key" measurement in the future would cause a userspace regression.  So we need to fully understand what is needed, *before* it is upstreamed.  Yes, changing what is measured might change the IMA hook placement.

James Bottomley already started the discussion in this thread...

Mimi


      parent reply	other threads:[~2019-11-22 17:39 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-21 16:17 IMA: Data included in the key measurement Lakshmi Ramasubramanian
2019-11-21 16:38 ` James Bottomley
2019-11-22  1:15   ` Lakshmi Ramasubramanian
2019-11-22 16:17     ` James Bottomley
2019-11-22 17:39       ` Lakshmi Ramasubramanian
2019-11-22 19:32         ` James Bottomley
2019-11-25 17:33       ` Lakshmi Ramasubramanian
2019-11-25 18:14         ` Mimi Zohar
2019-11-25 18:19           ` Lakshmi Ramasubramanian
2019-11-22 17:38 ` Mimi Zohar [this message]

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=1574444298.4793.202.camel@linux.ibm.com \
    --to=zohar@linux.ibm.com \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=dhowells@redhat.com \
    --cc=jamorris@linuxonhyperv.com \
    --cc=linux-integrity@vger.kernel.org \
    --cc=nramas@linux.microsoft.com \
    /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).