attester: TPM report data size to 32 bytes#1500
Conversation
|
cc @mkulke do we also need to consider azure-tdx-vtpm? |
yes, it would be the same. I'm a bit puzzled why we need this now, though. What is the size of the nonce usually, have we changed something? @kimullaa the algo you referred to is for the PCRs not the nonce. let hash_algo = HashingAlgorithm::Sha256;
let selection_list = PcrSelectionListBuilder::new()
.with_selection(hash_algo, &VTPM_QUOTE_PCR_SLOTS)
.build()?; |
|
thank you for a feedback!
@mkulke I ran the The README.md states: evidence_getter expects 64 bytes(not up to 64bytes) Therefore, it seems that I might be missing something or executing it incorrectly. Could you please let me know if there is a correct way to run this command for az-snp-vtpm? |
44e4313 to
497b4e2
Compare
Truncate to 32 bytes because azure CVM + AMD SEV-SNP instances use SHA-256 hash-algorithm. ``` $ sudo tpm2_readpublic -c 0x81000003 ... name-alg: value: sha256 raw: 0xb attributes: value: fixedtpm|fixedparent|sensitivedataorigin|userwithauth|noda|restricted|sign raw: 0x50472 type: value: rsa raw: 0x1 exponent: 65537 bits: 2048 scheme: value: rsassa raw: 0x14 scheme-halg: value: sha256 raw: 0xb ``` See also 79554cf. Signed-off-by: Shunsuke Kimura <pbrehpuum@gmail.com>
497b4e2 to
01d11d3
Compare
I understand the Guest-component produces CoCo evidence that is consumed by Trustee's verifier, so it's not raw evidence but a CoCo-specific data envelope. That also means that we cannot change the behaviour of the producer (attester) unless we have made sure the consumer (verifier) doesn't break. If you want to get raw evidence from those azure TEEs, please follow those instructions:
If you intend to make the tool work, I would see 2 options:
|
|
@mkulke thank you for a reply!
The README.md states: guest-components/attestation-agent/attester/README.md Lines 11 to 13 in 1fcebcb so I think it is better to support az_snp_vtpm attester.(or add a warning/note to README.md.) To help me consider the way to fix this, please let me ask the following question.
Does this mean we should loosen the validation at the call site, rather than strictly matching exactly 64 bytes? |
what I am suggesting is to fix the evidence-getter tool to make it work without modifications to the attester code. the reason being: the guest-components/attester and trustee/verifier crates are inherently coupled, changes to the attester's behavior here will have to be matched on the trustee side. If we truncate/resize the report-data that is sent by trustee (because it is not compatible with the evidence-getter tool) trustee's verifier will have to change its logic. otherwise, it will choke on a report-data mismatch. that means we have bump evidence versions, etc. we want to avoid that, hence I suggest modifying the evidence-getter to work with az-snp/tdx-vtpm, so it'll produce evidence that can be validated by trustee. |
Failed to execute
evidence_getterin Azure CVM + SEV-SNP.(main branch.499658b307c39040efc009563737987c47a1dd63)Truncate to 32 bytes because az-snp-vtpm v0.8.1 only supports SHA-256. https://github.com/kinvolk/azure-cvm-tooling/blob/v0.8.1/az-cvm-vtpm/src/vtpm/mod.rs#L348
This patch seems to fix the issue.
See also 79554cf.