linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH 02/11] libnvdimm/security: change clear text nvdimm keys to encrypted keys
       [not found]   ` <1541957268.3734.53.camel@linux.ibm.com>
@ 2018-11-11 19:20     ` Dan Williams
  2018-11-11 20:09       ` Mimi Zohar
  0 siblings, 1 reply; 5+ messages in thread
From: Dan Williams @ 2018-11-11 19:20 UTC (permalink / raw)
  To: zohar
  Cc: Dave Jiang, Mimi Zohar, linux-nvdimm, Linux Kernel Mailing List,
	keyrings

[ add keyrings and lkml ]

On Sun, Nov 11, 2018 at 9:28 AM Mimi Zohar <zohar@linux.ibm.com> wrote:
>
> On Fri, 2018-11-09 at 15:13 -0700, Dave Jiang wrote:
> > In order to make nvdimm more secure, encrypted keys will be used instead of
> > clear text keys. A master key will be created to seal encrypted nvdimm
> > keys. The master key can be a trusted key generated from TPM 2.0 or a less
> > secure user key.
>
> Trusted keys also work for TPM 1.2.  Are you intentionally limiting
> the master key to TPM 2.0?

TPM 1.2 is supported from a software perspective, however the
intersection of hardware platforms deploying security enabled NVDIMMs
and TPM 1.2 might be a null set.

> Traditionally there is a single master key for the system, which would
> be sealed to a set of boot time PCR values.  After decrypting all of
> the encrypted keys, the master key would be removed from the keyring
> and a PCR extended.  Extending a PCR would prevent the master key from
> being unsealed again and used to decrypt encrypted keys, without
> rebooting the system.  Normally this would be done before pivoting
> root.
>
> If you're not referring to the system master key and are intentionally
> limiting usage to TPM 2.0, more details on the master key security
> requirements should be included.

Oh, interesting point. I think we had been assuming a local +
unsealed-at-runtime nvdimm master key rather than a system-wide master
key. Yes, we need to rethink this in terms of supporting a sealed
system-key. This would seem to limit security actions, outside of
unlock, to always requiring a reboot. I.e. the nominal case is that we
boot up and unlock the DIMMs, but any subsequent security operation
like erase, or change-passphrase would require rebooting into an
environment where the system-master key is unsealed. I do think
re-provisioning keys and erasing DIMM contents are sufficiently
exceptional events that a reboot requirement is tolerable.

Is there already existing tooling around this to be able to schedule
master-key related actions to be deferred to an initrd environment?

> Using trusted keys that are encrypted/decrypted using a user key
> should really be limited to testing environments.

Makes sense.

> >
> > In the process of this conversion, the kernel cached key will be removed
> > in order to simplify the verification process. The hardware will be used to
> > verify the decrypted user payload directly.
>
> Making this sort of change implies there is no concern in breaking
> existing userspace.  Either the code hasn't yet been upstreamed or
> there are not any users. If the code hasn't been upstreamed, it would
> make more sense to squash the git history:
>
> - making code review easier
> - making the git history bisect safe

Yes, the old scheme is not upstream. I'll do the squash once we've
finalized the key-management details.

Thanks for the help Mimi.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 02/11] libnvdimm/security: change clear text nvdimm keys to encrypted keys
  2018-11-11 19:20     ` [PATCH 02/11] libnvdimm/security: change clear text nvdimm keys to encrypted keys Dan Williams
@ 2018-11-11 20:09       ` Mimi Zohar
  2018-11-12 15:42         ` Dave Jiang
  0 siblings, 1 reply; 5+ messages in thread
From: Mimi Zohar @ 2018-11-11 20:09 UTC (permalink / raw)
  To: Dan Williams
  Cc: Dave Jiang, Mimi Zohar, linux-nvdimm, Linux Kernel Mailing List,
	keyrings

> > Traditionally there is a single master key for the system, which would
> > be sealed to a set of boot time PCR values.  After decrypting all of
> > the encrypted keys, the master key would be removed from the keyring
> > and a PCR extended.  Extending a PCR would prevent the master key from
> > being unsealed again and used to decrypt encrypted keys, without
> > rebooting the system.  Normally this would be done before pivoting
> > root.
> >
> > If you're not referring to the system master key and are intentionally
> > limiting usage to TPM 2.0, more details on the master key security
> > requirements should be included.
> 
> Oh, interesting point. I think we had been assuming a local +
> unsealed-at-runtime nvdimm master key rather than a system-wide master
> key. Yes, we need to rethink this in terms of supporting a sealed
> system-key. This would seem to limit security actions, outside of
> unlock, to always requiring a reboot. I.e. the nominal case is that we
> boot up and unlock the DIMMs, but any subsequent security operation
> like erase, or change-passphrase would require rebooting into an
> environment where the system-master key is unsealed. I do think
> re-provisioning keys and erasing DIMM contents are sufficiently
> exceptional events that a reboot requirement is tolerable.

> Is there already existing tooling around this to be able to schedule
> master-key related actions to be deferred to an initrd environment?

There's the original dracut support for loading a masterkey, which is
used by the EVM and ecryptfs dracut modules.  After the last usage,
the masterkey needs to be removed from the keyring.

Different people over the years have wanted to add support for
calculating the boot time expected PCRs values in order to reseal keys
(trusted key update), but I haven't looked to see if there are any
open source tools available.

Mimi


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 02/11] libnvdimm/security: change clear text nvdimm keys to encrypted keys
  2018-11-11 20:09       ` Mimi Zohar
@ 2018-11-12 15:42         ` Dave Jiang
  2018-11-12 18:49           ` Mimi Zohar
  0 siblings, 1 reply; 5+ messages in thread
From: Dave Jiang @ 2018-11-12 15:42 UTC (permalink / raw)
  To: Mimi Zohar, Dan Williams
  Cc: Mimi Zohar, linux-nvdimm, Linux Kernel Mailing List, keyrings


On 11/11/2018 1:09 PM, Mimi Zohar wrote:
>>> Traditionally there is a single master key for the system, which would
>>> be sealed to a set of boot time PCR values.  After decrypting all of
>>> the encrypted keys, the master key would be removed from the keyring
>>> and a PCR extended.  Extending a PCR would prevent the master key from
>>> being unsealed again and used to decrypt encrypted keys, without
>>> rebooting the system.  Normally this would be done before pivoting
>>> root.
>>>
>>> If you're not referring to the system master key and are intentionally
>>> limiting usage to TPM 2.0, more details on the master key security
>>> requirements should be included.
>> Oh, interesting point. I think we had been assuming a local +
>> unsealed-at-runtime nvdimm master key rather than a system-wide master
>> key. Yes, we need to rethink this in terms of supporting a sealed
>> system-key. This would seem to limit security actions, outside of
>> unlock, to always requiring a reboot. I.e. the nominal case is that we
>> boot up and unlock the DIMMs, but any subsequent security operation
>> like erase, or change-passphrase would require rebooting into an
>> environment where the system-master key is unsealed. I do think
>> re-provisioning keys and erasing DIMM contents are sufficiently
>> exceptional events that a reboot requirement is tolerable.
>> Is there already existing tooling around this to be able to schedule
>> master-key related actions to be deferred to an initrd environment?
> There's the original dracut support for loading a masterkey, which is
> used by the EVM and ecryptfs dracut modules.  After the last usage,
> the masterkey needs to be removed from the keyring.

How does one generate new encrypted keys with the system masterkey 
removed from the keyring?


>
> Different people over the years have wanted to add support for
> calculating the boot time expected PCRs values in order to reseal keys
> (trusted key update), but I haven't looked to see if there are any
> open source tools available.
>
> Mimi
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 02/11] libnvdimm/security: change clear text nvdimm keys to encrypted keys
  2018-11-12 15:42         ` Dave Jiang
@ 2018-11-12 18:49           ` Mimi Zohar
  2018-11-12 20:13             ` Dave Jiang
  0 siblings, 1 reply; 5+ messages in thread
From: Mimi Zohar @ 2018-11-12 18:49 UTC (permalink / raw)
  To: Dave Jiang, Dan Williams
  Cc: Mimi Zohar, linux-nvdimm, Linux Kernel Mailing List, keyrings

On Mon, 2018-11-12 at 08:42 -0700, Dave Jiang wrote:

> How does one generate new encrypted keys with the system masterkey 
> removed from the keyring?

I don't think you can.

Mimi


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 02/11] libnvdimm/security: change clear text nvdimm keys to encrypted keys
  2018-11-12 18:49           ` Mimi Zohar
@ 2018-11-12 20:13             ` Dave Jiang
  0 siblings, 0 replies; 5+ messages in thread
From: Dave Jiang @ 2018-11-12 20:13 UTC (permalink / raw)
  To: Mimi Zohar, Dan Williams
  Cc: Mimi Zohar, linux-nvdimm, Linux Kernel Mailing List, keyrings



On 11/12/18 11:49 AM, Mimi Zohar wrote:
> On Mon, 2018-11-12 at 08:42 -0700, Dave Jiang wrote:
> 
>> How does one generate new encrypted keys with the system masterkey 
>> removed from the keyring?
> 
> I don't think you can.

Are there any documentations available showing system master-key usages?
So far the docs (i.e. EVM setup) I've seen generates a trusted master
key and then create the encrypted keys from that. I'm missing the
understanding of how to generate encrypted keys from the system master
key initially during setup. Thanks!

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-11-12 20:13 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <154180093865.70506.6858789591063128903.stgit@djiang5-desk3.ch.intel.com>
     [not found] ` <154180163666.70506.8805433934495072699.stgit@djiang5-desk3.ch.intel.com>
     [not found]   ` <1541957268.3734.53.camel@linux.ibm.com>
2018-11-11 19:20     ` [PATCH 02/11] libnvdimm/security: change clear text nvdimm keys to encrypted keys Dan Williams
2018-11-11 20:09       ` Mimi Zohar
2018-11-12 15:42         ` Dave Jiang
2018-11-12 18:49           ` Mimi Zohar
2018-11-12 20:13             ` Dave Jiang

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).