-
Notifications
You must be signed in to change notification settings - Fork 90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SEV-SNP: Attestation workflow unclear #212
Comments
Hi I've since cycled through a variety of settings, cross-referenced with direct script invocations of I've sifted through the SNP ABI, which does not list
Therefore, the issue must be in the LD calculation. From what I've understood reading the code: To summarize, am I correct that the problem is not related to any runtime interactions or potential bugs in the OVMF, but must be solely located in either the /EDIT: I was able to verify that the kernel, initrd, and cmdline hashes agree between qemu and sev-snp-measure. Footnotes
|
We have a guide which is in-progress for being published. That being said, there are two general workflows:
Standard AttestationWith standard attestation a guest owner will use software within the guest to retrieve an attestation report from the AMD Secure processor. Taking the evidence produced by that piece of software (something like snpguest), the Guest owner may request the AMD certificate chain from the AMD Key Distribution Server (KDS). Then, on a trusted platform (not within the guest which generated the report), the guest owner may use additional software (something like snpguest) to attest the guest meets the security policies required. Following is the attestation process being performed by the Guest owner (handled by snpguest): Extended AttestationWhile the standard attestation workflow works well for small deployments, it struggle to scale for larger deployments because the KDS implements rate-limiting. To mitigate this, we created the Extended Attestation workflow, which provides a mechanism for platform owners to store certificate chains in a cache. Because the certificates have been cryptographically signed by AMD, when the guest owner retrieves these certificates from the cache, the trustworthiness of the certificates may be verified. In the extended attestation flow, the platform owner will use software to generate a Guest Hypervisor Communication Block compliant binary containing the certificates the platform owner would like to provide for the guest to request (something like snphost provides this capability) and forwards this binary to their VMM. The VMM will utilize an IOCTL to store these certificates. The guest owner will then utilize software to retrieve this certificate binary from the cache, instead of calling out to the KDS (again, snpguest provides this functionality). The rest of the attestation process would remain the same. Following is the attestation process being performed by the Guest owner (handled by snpguest): All of this being said, we have still noticed a discrepancy with the latest kernel version we released and the measurement being calculated by One additional question I had, though, was are you looking to run legacy SEV, or SEV-SNP? In your example, you mentioned you were generating a PDH, etc, which is part of the legacy SEV workflow, and is not included with SEV-SNP. |
Hi First of all, thanks for the very clear and simple workflow description! I'm looking to run SEV-SNP - I was erroneously assuming (perhaps due to the similar naming, perhaps because of reading resources referring simply to "SEV") that SEV-SNP was an evolution of SEV-ES - i.e. SEV-ES+Integrity. Just to verify: This also means that there is no longer a way to add guest-owner provided secrets at launch, and the idea is instead to authenticate the VM first and then negotiate a key (e.g. by having What is the role of providing a measurement at launch through the id-block in the attestation process? From the diagrams you provided, it seems that this process requires a booted and running VM, but the ID-block check seems to fail before calling VMRUN. Thank you and let me know if I can help localizing the issue! |
Of course, it was my pleasure 🙂 !
There are definitely more improvements to security in the newer protocol. SEV-SNP utilizes SEV-ES in its underlying technology, so you get all of the benefits of SEV-ES without as much work to get it working.
Actually, the guest-owner may provide a nonce which will be included in the attestation report. I would recommend reading over section 6 which documents how to include 64 bytes of guest-owner-supplied data in your report.
The diagrams above do not include the Identity Block workflow. Essentially, utilizing the ID-block will provide the pre-launch attestation you received through the legacy SEV/SEV-ES workflow.
Will do! We actually have a PR opened for sev-snp-measure to add some floating-point registers which were recently adjusted in the VMSA of the latest version of the AMD kernel patches. We have tested the patch, and it seems to address the mis-matching measurement. |
Hi
If I understand this section correctly, this is from within the SNP-enabled guest? I'm referring to mechanics as described in the non-SNP specification, where it is possible to provide the guest with secrets at launch using
Thanks for finding this issue, I wouldn't even know where to start with this! I've applied your PR locally to a fresh checkout of Footnotes |
Hi
First of all, thanks for the legwork and the opportunities that arise from them!
Unfortunately, I seem to be unable to get attestation to work correctly on SEV-SNP.
I believe there might be an issue with me taking information from different sources because I have not found a comprehensive example walkthrough yet on SEV-SNP in particular.
I've compiled the system from the
build.sh
, running the following versions:Host:
6.9.0-rc1-snp-host-f9b5bc22b945
, running a Milan 7443 CPU, PSP version 1.55, loaded and active in dmesg,snphost ok
shows all greenQemu: Commit
c139a28810964fe90804421561fb6fb0ab2c5056
Guest (not sure if relevant):
6.7.0-snp-guest-98543c2aa649
I've created the single-file OVMF as described in #93.
Steps I'm running:
sevctl export --full /tmp/pdh
sevctl verify --sev pdh.bin
sevctl session --name myvm pdh.bin
. This gives me the four filesmyvm_session.b64
,myvm_godh.b64
,myvm_tik.bin
andmyvm_tek.bin
.openssl ecparam -name secp384r1 -genkey -noout -out <key_name>
sha256sum
.First question arises here: Does the
myvm_session.b64
include themyvm_godh.b64
for SNP? When I try to pass thedh-cert-file
-parameter, I get an "invalid parameter" error from qemu.Just starting with normal parameters, I start it as:
(id-auth and id-block are long base64 strings, omitted for clarity)
Are the steps so far correct?
With this mode, I get the following trace output:
Do you see an error in the steps that lead to this bad measurement? Is there a way to determine which element (policy, hashes, ...) triggers the bad measurement?
As a note, it seems to be the case that setting kernel-hashes=on without specifying the
-kernel
argument results in an assertion onkernel_hashes_data
. This is logical (as there cannot be any hashes), but may be confusing and profit from an earlier check (kernel-hashes=on should not be allowed without-kernel
.Is there any reference implementation out there that does this so I could compare with?
The text was updated successfully, but these errors were encountered: