Skip to content

prototype(snp_collateral): verify VCEK signature against ASK and enforce canonical HCL base64, report version, and component bounds (#646) - #651

Open
drk-ram wants to merge 1 commit into
agentrust-io:mainfrom
drk-ram:drk-ram-fix-snp-collateral-646
Open

drk-ram wants to merge 1 commit into
agentrust-io:mainfrom
drk-ram:drk-ram-fix-snp-collateral-646

Conversation

@drk-ram

@drk-ram drk-ram commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

What this changes

Closes #646.

Hardens appraise_collateral and tcb_component in prototype/snp_collateral.py:

  • Verifies vcek.issuer == ask.subject and _verify_signed_by(vcek, ask) in appraise_collateral (CollateralDenied("product_chain")).
  • Requires canonical base64 encoding on packet["hcl_b64"] and report_version >= 2 in appraise_collateral (CollateralDenied("platform_evidence_format")).
  • Bounds now to 1 <= now <= 9007199254740991 - max_age under CollateralDenied("clock_or_age") and rejects a mismatched appraisal["profile"] under CollateralDenied("component_inputs") in tcb_component.

Validation commands and results:

  • PYTHONPATH=src python -m pytest tests/test_snp_collateral.py -q -> passed
  • python -m ruff check prototype/snp_collateral.py tests/test_snp_collateral.py -> passed (All checks passed!)
  • python tools/check_dashes.py -> passed (no dashes outside examples/, spec/trace-v0.1.md)
  • PYTHONPATH=src python tools/review_bar.py --base origin/main --head HEAD -> passed (7 changed test cases fail on behaviour at origin/main)

Type of change

  • Editorial (typo, link fix, clarification: no normative effect)
  • Non-breaking spec change (new optional field, new platform profile, informative addition)
  • Breaking spec change (requires 14-day comment period and Project Lead sign-off)
  • Schema change
  • Example addition

Spec section

prototype/snp_collateral.py (experimental SEV-SNP platform collateral appraisal prototype; no normative change to spec/trace-v0.2.md)

Tests for a fix

  • vcek.issuer == ask.subject, _verify_signed_by(vcek, ask), canonical hcl_b64 round-trip, and version >= 2 in appraise_collateral: tests/test_snp_collateral.py::test_appraise_collateral_verifies_vcek_issuer_and_signature_and_report_bounds
  • 1 <= now <= 9007199254740991 - max_age and appraisal["profile"] == PROFILE in tcb_component: tests/test_snp_collateral.py::test_tcb_component_rejects_zero_or_overflow_now_and_wrong_profile

Changelog entry

Checklist

  • DCO sign-off on all commits (git commit -s)
  • Breaking changes marked with <!-- CHANGED: #NNN: description --> in spec text
  • Backward compatibility statement included (for breaking changes)

@drk-ram
drk-ram requested review from a team, lywinged and rajnisht7 as code owners October 30, 2026 15:08
@github-actions

github-actions Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

🟡 Contributor Check: MEDIUM

Check Result
Profile MEDIUM
Credential LOW
Overall MEDIUM

Automated check by AgenTrust Contributor Check.

@github-actions github-actions Bot added the needs-review:MEDIUM Contributor check flagged MEDIUM risk label Oct 30, 2026
@drk-ram
drk-ram force-pushed the drk-ram-fix-snp-collateral-646 branch from 6d5a463 to 1fbe6b0 Compare October 30, 2026 15:10
…rce canonical HCL base64, report version, and component bounds (agentrust-io#646)

- Verify vcek.issuer == ask.subject and _verify_signed_by(vcek, ask) in appraise_collateral.
- Require canonical base64 encoding on packet['hcl_b64'] and report_version >= 2 in appraise_collateral.
- Bound now to [1, 9007199254740991 - max_age] under clock_or_age and reject mismatched appraisal['profile'] in tcb_component.

Closes agentrust-io#646

Signed-off-by: Raghuvar Karthik Durga <177662415+drk-ram@users.noreply.github.com>
@drk-ram
drk-ram force-pushed the drk-ram-fix-snp-collateral-646 branch from 1fbe6b0 to 717a2c1 Compare October 30, 2026 15:11
@rajnisht7

Copy link
Copy Markdown
Member

Batch response for this cluster is here: #653 (comment)

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-review:MEDIUM Contributor check flagged MEDIUM risk

Projects

None yet

Development

Successfully merging this pull request may close these issues.

prototype(snp_collateral): verify VCEK signature against ASK and enforce canonical HCL base64, report version, and component bounds

2 participants