-
Notifications
You must be signed in to change notification settings - Fork 15
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
Issue with Recalculating Measurement from Attestation Report in Guest Machine on the Host Machine #37
Comments
Calculating the expected measurement can be a little bit unforgiving. I see a couple issues the steps you followed. First, if you are using the AMDESE/AMDSEV tools, you are probably only measuring the firmware of your guest so don't use any of the flags for things that are not the firmware i.e. kernel, append. If you would like to measure those pieces, we support a measured direct boot approach. This will require you to use different firmware. If you specify the kernel flag but do not have the appropriate firmware you will get the error that you see. Your best bet is to start with only measuring the firmware. If you specify the You might have more issues, but I'd start with those. |
If that doesn't work, please supply more details on were you got launch-qemu.sh and sev-guest.qcow2 -- exactly which repo and branch. |
@fitzthum you beat me to it... 1-0 in the first half. |
Wow that was a close one. |
Thank you @fitzthum and @dubek for your thorough guidance and suggestions. I truly appreciate your time and effort in helping me navigate through this challenge. I will carefully implement the adjustments you recommended, excluding non-firmware flags and omitting the --snp-ovmf-hash flag while specifying --ovmf. I am eager to see the results of these changes. I will reattempt the process shortly and will revert to you promptly with an update on the outcomes. If I encounter any further difficulties or have additional questions, I will not hesitate to seek your valuable guidance. Once again, thank you for your support, and I look forward to being in touch soon. |
Hello @dubek and @fitzthum, thank you again for your guidance. The launch script I used originates from the AMDSEV repository, specifically from the following location: https://github.com/AMDESE/AMDSEV/tree/snp-latest, and I pulled it from the branch 'snp-latest.' Despite following your previous suggestions, I still encountered a hash discrepancy. To provide additional context, I executed the following command: In light of this, I would appreciate further guidance on resolving this discrepancy. Could you suggest specific alternative firmware options suitable for the measured direct boot approach, particularly when measuring components like the kernel and append? Specifically, information on where to acquire such firmware and details about the recommended branch and tools would be immensely helpful. Thank you |
It might help to post the entire qemu command-line that is executed by launch-qemu.sh (should be printed to the console before the VM starts up). |
Also see the thread in AMDESE/AMDSEV#195 - there's a new feature called FYI @larrydewey |
Here is the qemu command-line :
|
Thanks @steve-237 , it looks OK, these are the relevant qemu entries:
This seems to match your sev-snp-measure invocation:
Can you try to make the one-line change to In any case, just to be sure, it would help to know exact versions (branches, commits) of host kernel, qemu, and ovmf. |
Thank you @dubek for the suggestion. Regarding the modification described in #32, I've reviewed the issue, but I'm unsure which specific file to modify. Could you kindly provide guidance on the exact file and location where the change should be made? |
In sevsnpmeasure/vmsa.py , change line 187 to
|
Thank you @dubek for your prompt assistance. I've implemented the suggested modification, setting sev_features to 0x21, and I'm pleased to report that it resolved the issue. The measurement calculation now aligns with expectations. |
New discussion occurring in #43 |
I am encountering an issue while attempting to recalculate the measurement from the attestation report within the guest machine. Below are the details of the problem:
I have installed the guest machine, a virtual machine, using the AMDSEV project from the GitHub user AMDESE. After successfully installing the guest machine, I executed it using the command:
Following the execution of the guest machine, I utilized the 'snpguest' tool to generate the attestation report. The report contains the measurement, represented by the hash:
Subsequently, I attempted to recalculate this hash (measurement) from the host machine using the 'sev-snp-measurement' tool with the following command:
./sev-snp-measure.py --mode snp --vcpus=1 --vcpu-type=EPYC-v4 --vmm-type=QEMU --ovmf=/home/user/AMDSEV/usr/local/share/qemu/OVMF_CODE.fd --kernel=/home/user/AMDSEV/sev-guest.fd --initrd=/home/user/AMDSEV/sev-guest.qcow2 --append="console=ttyS0 loglevel=7" --snp-ovmf-hash=711dd640bc679fcdefa729f47ff56700c95b1c590a779391ab178d511d6237677bea447327923972c4eee313fc2f915d
However, I encountered the following error:
This has led me to question the correctness of the kernel path, initrd value, and other parameters.
Additionally, when using the 'sev-snp-measure.py' tool with the command:
I get a value that does not match the measurement in the attestation report within the guest machine.
Any guidance or assistance on resolving this issue and accurately recalculating the measurement would be highly appreciated.
The text was updated successfully, but these errors were encountered: