From: "Daniel P. Berrangé" <berrange@redhat.com>
To: James Bottomley <jejb@linux.ibm.com>
Cc: "Jörg Rödel" <jroedel@suse.de>,
"Christophe de Dinechin Dupont de Dinechin" <cdupontd@redhat.com>,
linux-coco@lists.linux.dev, amd-sev-snp@lists.suse.com
Subject: Re: SVSM initiated early attestation / guest secrets injection
Date: Fri, 20 Jan 2023 12:51:03 +0000 [thread overview]
Message-ID: <Y8qON8v5DmB+u9u3@redhat.com> (raw)
In-Reply-To: <4086b1c3fc3f68b0dd0b0b9acf0c22256022efa1.camel@linux.ibm.com>
On Fri, Jan 20, 2023 at 07:39:30AM -0500, James Bottomley wrote:
> On Fri, 2023-01-20 at 08:57 +0000, Daniel P. Berrangé wrote:
> > On Fri, Jan 20, 2023 at 09:37:35AM +0100, Jörg Rödel wrote:
> > > On Thu, Jan 19, 2023 at 04:29:23PM -0500, James Bottomley wrote:
> > > > How can they stay there? Even if the SVSM is the point of first
> > > > contact to receive the secret, it must give the secret to higher
> > > > VMPLs
> > > > to try the mount, so the higher VMPLs have to destroy the secret
> > > > they
> > > > were given on failure.
> > >
> > > My thinking was that the SVSM will only hand out the secrets once
> > > the
> > > code in higher VMPLs has proven itself to be trusted. But it is
> > > possible
> > > for an attacker to create an image with the expected parts to get
> > > the
> > > measurements right and then use a fall-back mount if decryption
> > > fails to
> > > steal the secret.
> >
> > With a vTPM, and systemd-pcrphase.service, it is possible to seal
> > secrets to prevent such an attack, by including phase=initrd in
> > the sealing PCRs. IOW, nothing after the initrd can unseal the
> > secrets, even if a different filesystem mount was substituted.
> >
> > Secrets that are needed /after/ the root FS is mounted (eg SSH
> > host key, Apache HTTP certs) can be sealed with a PCR set that
> > covers the LUKS master key hash, so that they can only be acccessed
> > if the correct rootfs was unlocked.
>
> But that provides no additional security: the LUKS master hash is just
> a hash of an area on the disk which anyone controlling the device can
> see. I can duplicate this area and still substitute my own volume
> (which would still fail to decrypt when presented with the key), so the
> trusted mounting component sill has to correctly handle the failure
> case.
Yes, it would have to be a hash that is different from the
hash that's exposed in clear text in the LUKS header. For
example it could be hash(master_key || uuid).
> > In the vTPM case, the guest owner is deciding policy when they
> > seal secrets to the vTPM during guest provisioning initially.
> > If we try to support a scenario without a vTPM, then the guest
> > owner has to determine policy by using a carefully built initrd
> > that does not do any fallbacks, and they have to rely on having
> > a known firmware with a particular set to certs enrolled, which
> > has support implications for public clouds. Much less flexible.
> >
> > > But such mount fallbacks a generally a bad idea in a CVM.
> >
> > Yep, but hopefully not fatal, if the user picks a suitable set
> > of PCRs for sealing data.
>
> You can't rely only on PCRs for this because they don't contain enough
> information, you must code the correct policy into the trusted mount
> component as well.
Well it entirely depends on what info is being measured into the
PCRs. If what systemd measures into PCRs in the initrd is not
sufficient to allow safe sealing policies, we can request further
info.
With regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
next prev parent reply other threads:[~2023-01-20 12:51 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-12 14:39 SVSM initiated early attestation / guest secrets injection Daniel P. Berrangé
2023-01-13 17:22 ` Jörg Rödel
2023-01-13 18:02 ` James Bottomley
2023-01-14 16:57 ` Jörg Rödel
2023-01-19 14:05 ` Christophe de Dinechin Dupont de Dinechin
2023-01-19 14:10 ` James Bottomley
2023-01-19 21:18 ` Jörg Rödel
2023-01-19 21:29 ` James Bottomley
2023-01-20 8:37 ` Jörg Rödel
2023-01-20 8:57 ` Daniel P. Berrangé
2023-01-20 12:39 ` James Bottomley
2023-01-20 12:51 ` Daniel P. Berrangé [this message]
2023-01-20 17:10 ` James Bottomley
2023-01-20 12:32 ` James Bottomley
2023-01-13 18:28 ` Daniel P. Berrangé
2023-01-13 18:52 ` Dionna Amalie Glaze
2023-01-16 9:36 ` Daniel P. Berrangé
2023-01-14 17:08 ` Jörg Rödel
2023-01-14 18:22 ` James Bottomley
2023-01-16 16:55 ` Jörg Rödel
2023-01-16 16:59 ` James Bottomley
2023-01-17 16:47 ` Jörg Rödel
2023-01-16 17:13 ` Daniel P. Berrangé
2023-01-17 16:53 ` Jörg Rödel
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=Y8qON8v5DmB+u9u3@redhat.com \
--to=berrange@redhat.com \
--cc=amd-sev-snp@lists.suse.com \
--cc=cdupontd@redhat.com \
--cc=jejb@linux.ibm.com \
--cc=jroedel@suse.de \
--cc=linux-coco@lists.linux.dev \
/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).