Skip to content
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

attestation.snp: reflect dependency of validators on productLine in verify.Options #1082

Merged
merged 1 commit into from
Dec 20, 2024

Conversation

jmxnzo
Copy link
Contributor

@jmxnzo jmxnzo commented Dec 18, 2024

Our reference values of SNP attestation have a hard dependency on the productLine used during attestation. This includes the derivation of trustedRoots, as well as the trustedMeasurements. By design, we start a validator configured with specific verifyOpts for each reference value.
This led to the error "VCEK could not be verified by any trusted roots", because validators configured with the wrong productLine tried to fulfill the attestation verification. Therefore this PR adds the explicit setting of the productLine in verifyOpts, to reflect the dependency of our reference values on the productLine. As expected we then run into the error below prior to validation, which reveals that a validator is configured for the wrong productLine:
time=2024-12-18T10:46:20.815Z level=ERROR msg="Validation failed" mesh-authority.validator.tee-type=snp mesh-authority.validator.nonce=6881501f40cebdb1492a87316e5a11cbb1bb9dfc2939240a9df098dacdab8b6a mesh-authority.validator.error="verifying report: expected product name SEV_PRODUCT_MILAN, got SEV_PRODUCT_GENOA"

Logging considerations were moved to #1095

@jmxnzo jmxnzo added the bug fix Fixing a user facing bug label Dec 18, 2024
@jmxnzo jmxnzo requested a review from burgerdev December 18, 2024 11:22
internal/attestation/snp/validator.go Outdated Show resolved Hide resolved
Comment on lines 65 to 67
v.logger.Info("Validation failed", "nonce", hex.EncodeToString(nonce), "error", err)
} else {
v.logger.Info("Validation successful")
v.logger.Info("Validation successful", "nonce", hex.EncodeToString(nonce))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to log the nonce? If validation fails because of it, wouldn't we see that in the corresponding error?

Copy link
Contributor Author

@jmxnzo jmxnzo Dec 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Logging considerations were moved to #1095

internal/manifest/manifest.go Outdated Show resolved Hide resolved
@jmxnzo jmxnzo marked this pull request as draft December 18, 2024 14:14
@jmxnzo jmxnzo force-pushed the bug/snp-attestation-jla branch from b0a4247 to 18c2dbd Compare December 19, 2024 10:57
@jmxnzo jmxnzo changed the title attestation: avoid running in validation errors bcs of productLine dependence attestation.snp: reflect dependency of validators on productLine in verify.Opts Dec 19, 2024
@jmxnzo jmxnzo changed the title attestation.snp: reflect dependency of validators on productLine in verify.Opts attestation.snp: reflect dependency of validators on productLine in verify.Options Dec 19, 2024
@jmxnzo jmxnzo force-pushed the bug/snp-attestation-jla branch from 18c2dbd to df5e047 Compare December 19, 2024 16:35
@jmxnzo jmxnzo force-pushed the bug/snp-attestation-jla branch from df5e047 to 1d79796 Compare December 19, 2024 16:43
@jmxnzo jmxnzo marked this pull request as ready for review December 20, 2024 09:14
@jmxnzo jmxnzo merged commit bfabdb6 into main Dec 20, 2024
10 checks passed
@jmxnzo jmxnzo deleted the bug/snp-attestation-jla branch December 20, 2024 09:59
@edgelessci
Copy link
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport release/v1.2 bug fix Fixing a user facing bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants