Bug 2040638

Summary: Libvirt needs to document how to validate a AMD SEV guest measurement
Product: Red Hat Enterprise Linux 9 Reporter: Daniel Berrangé <berrange>
Component: libvirtAssignee: Daniel Berrangé <berrange>
libvirt sub component: General QA Contact: Luyao Huang <lhuang>
Status: CLOSED ERRATA Docs Contact:
Severity: unspecified    
Priority: unspecified CC: coli, crobinso, jdenemar, jsuchane, lcheng, lmen, meili, pkrempa, virt-maint, xuzhang, yicui, zixchen
Version: 9.2Keywords: Triaged
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: libvirt-9.0.0-1.el9 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-05-09 07:26:11 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 2040646    

Description Daniel Berrangé 2022-01-14 10:53:32 UTC
Description of problem:
The current AMD SEV docs in libvirt merely illustrate how to configure a guest with AMD SEV support enabled. At best this means that an *existing* guest will be protected *after* the virt host is compromised.

Ideally users want a guarantee that all new guests are protected, even if the virt host is already compromised. At the very least this requires validating the measurement for a guest exposed by AMD SEV.

Libvirt has the code needed to do that once bug 2030435 is complete.

Figuring out how to actually put this into practice, however, is incredibly difficult and error prone.

For this to be supportable, we need to clearly document how to validate a guest measurement with libvirt.

This needs to be done in a libvirt knowledge base article. 

Version-Release number of selected component (if applicable):
8.0.0

Comment 1 Jaroslav Suchanek 2023-02-02 12:00:50 UTC
Dan, there is this article for the AMD SEV setup, https://access.redhat.com/articles/4491591. Is there anything else you would suggest to document?

Comment 2 Daniel Berrangé 2023-02-21 13:50:45 UTC
This is covered in two upstream docs:

https://libvirt.org/kbase/launch_security_sev.html#guest-attestation-for-sev-sev-es-from-a-trusted-host

https://libvirt.org/manpages/virt-qemu-sev-validate.html

both are included in the -docs RPM, so this should be sufficient to consider this bug addressed.

Comment 6 Luyao Huang 2023-02-23 08:58:25 UTC
Verify this bug with libvirt-docs-9.0.0-6.el9.x86_64:

1. check and review sev update in launch_security_sev.html

# ls /usr/share/doc/libvirt-docs/html/kbase/launch_security_sev.html
/usr/share/doc/libvirt-docs/html/kbase/launch_security_sev.html

In this document, it include important steps/configs for sev guest measurement:

a. If intending to attest the boot measurement, it is required to use a firmware binary that is stateless, as persistent NVRAM can undermine the trust of the secure guest. This is achieved by telling libvirt that a stateless binary is required

...
<os type='efi'>
  <type arch='x86_64' machine='q35'>hvm</type>
  <loader stateless='yes'/>
</os>
...

b. Guest attestation for SEV/SEV-ES from a trusted host


2. check the man page of virt-qemu-sev-validate

# man virt-qemu-sev-validate

Comment 8 errata-xmlrpc 2023-05-09 07:26:11 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (libvirt bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2023:2171