* Daniel P. Berrangé (berra...@redhat.com) wrote:
On Wed, Nov 24, 2021 at 11:34:16AM -0500, Tyler Fanelli wrote:
Hi,
We recently discussed a way for remote SEV guest attestation
through QEMU.
My initial approach was to get data needed for attestation
through different
QMP commands (all of which are already available, so no changes
required
there), deriving hashes and certificate data; and collecting all
of this
into a new QMP struct (SevLaunchStart, which would include the
VM's policy,
secret, and GPA) which would need to be upstreamed into QEMU.
Once this is
provided, QEMU would then need to have support for attestation
before a VM
is started. Upon speaking to Dave about this proposal, he
mentioned that
this may not be the best approach, as some situations would
render the
attestation unavailable, such as the instance where a VM is
running in a
cloud, and a guest owner would like to perform attestation via
QMP (a likely
scenario), yet a cloud provider cannot simply let anyone pass
arbitrary QMP
commands, as this could be an issue.
As a general point, QMP is a low level QEMU implementation detail,
which is generally expected to be consumed exclusively on the host
by a privileged mgmt layer, which will in turn expose its own higher
level APIs to users or other apps. I would not expect to see QMP
exposed to anything outside of the privileged host layer.
We also use the QAPI protocol for QEMU guest agent commmunication,
however, that is a distinct service from QMP on the host. It shares
most infra with QMP but has a completely diffent command set. On the
host it is not consumed inside QEMU, but instead consumed by a
mgmt app like libvirt.
So I ask, does anyone involved in QEMU's SEV implementation have
any input
on a quality way to perform guest attestation? If so, I'd be
interested.
I think what's missing is some clearer illustrations of how this
feature is expected to be consumed in some real world application
and the use cases we're trying to solve.
I'd like to understand how it should fit in with common libvirt
applications across the different virtualization management
scenarios - eg virsh (command line), virt-manger (local desktop
GUI), cockpit (single host web mgmt), OpenStack (cloud mgmt), etc.
And of course any non-traditional virt use cases that might be
relevant such as Kata.
That's still not that clear; I know Alice and Sergio have some ideas
(cc'd).
There's also some standardisation efforts (e.g.
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.potaroo.net%2Fietf%2Fhtml%2Fids-wg-rats.html&data=04%7C01%7Cbrijesh.singh%40amd.com%7C3c94b09f0cd5450460a808d9b01be1f8%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637734456065941078%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=E%2FeaI6JNF2ckosTeAbFRaCZUJOZ3zG0GNfKP8082INQ%3D&reserved=0
and
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.ietf.org%2Farchive%2Fid%2Fdraft-ietf-rats-architecture-00.html&data=04%7C01%7Cbrijesh.singh%40amd.com%7C3c94b09f0cd5450460a808d9b01be1f8%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637734456065951077%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=WEkMIZZp3O5Gyay5jZT8KSUH9fyarNfXy5O0Z%2FpHdnQ%3D&reserved=0
) - that I can't claim to fully understand.
However, there are some themes that are emerging:
a) One use is to only allow a VM to access some private data
once we
prove it's the VM we expect running in a secure/confidential system
b) (a) normally involves requesting some proof from the VM and
then
providing it some confidential data/a key if it's OK
c) RATs splits the problem up:
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.ietf.org%2Farchive%2Fid%2Fdraft-ietf-rats-architecture-00.html%23name-architectural-overview&data=04%7C01%7Cbrijesh.singh%40amd.com%7C3c94b09f0cd5450460a808d9b01be1f8%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637734456065951077%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=%2FwNFMGAfojFZyGIj79D5%2BW%2BRPPuwumJiqIrf5UVrkPU%3D&reserved=0
I don't fully understand the split yet, but in principal
there are
at least a few different things:
d) The comms layer
e) Something that validates the attestation message (i.e. the
signatures are valid, the hashes all add up etc)
f) Something that knows what hashes to expect (i.e. oh that's a
RHEL
8.4 kernel, or that's a valid kernel command line)
g) Something that holds some secrets that can be handed out if
e & f
are happy.
There have also been proposals (e.g. Intel HTTPA) for an
attestable
connection after a VM is running; that's probably quite different
from
(g) but still involves (e) & (f).
In the simpler setups d,e,f,g probably live in one place; but it's
not
clear where they live - for example one scenario says that your cloud
management layer holds some of them, another says you don't trust
your
cloud management layer and you keep them separate.
So I think all we're actually interested in at the moment, is (d) and
(e) and the way for (g) to get the secret back to the guest.
Unfortunately the comms and the contents of them varies heavily with
technology; in some you're talking to the qemu/hypervisor
(SEV/SEV-ES)
while in some you're talking to the guest after boot (SEV-SNP/TDX
maybe
SEV-ES in some cases).