Skip to content

feat(cicd-tee): pin SecretVM v0.0.27-alpha.1, SEV-SNP per-template measurements, baked LOG_LEVEL_* in attestation manifest#722

Merged
abs2023 merged 1 commit into
devfrom
cicd/tee-sev-and-secretvm-v0.0.27
Apr 29, 2026
Merged

feat(cicd-tee): pin SecretVM v0.0.27-alpha.1, SEV-SNP per-template measurements, baked LOG_LEVEL_* in attestation manifest#722
abs2023 merged 1 commit into
devfrom
cicd/tee-sev-and-secretvm-v0.0.27

Conversation

@abs2023
Copy link
Copy Markdown
Collaborator

@abs2023 abs2023 commented Apr 29, 2026

Summary

Brings the TEE CI/CD pipeline in line with SCRT Labs' new portal-mandated SecretVM release v0.0.27-alpha.1 and integrates the AMD SEV-SNP runtime support landed in #718 / #720, while explicitly baking LOG_LEVEL_* into the attestation manifest so privacy-relevant logging cannot drift silently from a TEE-deployed image.

  • Pin: SECRETVM_RELEASE=v0.0.27-alpha.1 in .github/tee/secretvm.env with both TDX and SEV rootfs URLs + SHA-256s, plus a SCRT Labs SEV artifact-registry pointer
  • SEV measurement compute: new proxy-router/scripts/compute-sev-measurement.py ports CalcSevMeasurement (sev_gctx.go) to Python; mirrors the existing compute-rtmr3.py CI pattern. CI now produces SHA-384 launch digests for all 5 SecretVM vCPU templates (small/medium/large/2xlarge/4xlarge) — the manifest publishes measurements.amd_sev_snp.per_template so verifiers pick the entry matching the live quote's vCPU count
  • Privacy gate: new Extract baked log levels from Dockerfile.tee step reads LOG_LEVEL_APP/TCP/ETH_RPC/STORAGE + LOG_COLOR/JSON/IS_PROD and hard-fails the build if LOG_LEVEL_APP=debug or any required LOG_LEVEL_* is missing; values are signed into baked_env
  • Parity guard: new hermetic TestComputeSevMeasurementPythonParity ensures Go (sev_gctx.go — runtime source of truth) and the Python CI tool produce byte-identical SHA-384 chains for all 5 templates. Fixture is intentionally version-agnostic (artifacts_ver=parity-test-fixture-v1) so future SecretVM bumps do not require touching the test
  • Parser update: golden.go JSON tag amd_sevamd_sev_snp; adds SEVMeasurements.PerTemplate map and GoldenValues.MatchSEVMeasurement(live) helper
  • Docs: TEE_Attestation_Architecture.md and TEE_CICD_Supply_Chain_Hardening.md updated with the v0.0.27-alpha.1 pin, SEV per-template measurement asymmetry table, baked log-level explanation, and updated manifest schema

Scope explicitly NOT in this PR

  • SEV auto-deploy + RTMR3-poll (Deploy-SecretVM-Test) stays TDX-only — extracts RTMR3 from a raw TDX quote at fixed offset, so it does not work for SEV. Manual SEV verification works today via the published SEVPerTemplate map; deferred to a follow-up.

Validation

  • python3 -m py_compile compute-sev-measurement.py — clean
  • TestComputeSevMeasurementPythonParityPASS (Go ↔ Python identical for all 5 templates)
  • go vet ./internal/attestation/... — clean
  • yaml.safe_load(build.yml) — clean
  • Local jq dry-run of manifest assembly — produces well-formed manifest with amd_sev_snp.per_template and baked_env.LOG_* populated

Test plan (post-merge)

  • Confirm GHCR-Build-and-Push-TEE job runs cleanly on dev push, including:
    • TDX + SEV rootfs both downloaded and SHA-verified
    • SCRT Labs SEV artifact registry fetched, sev.json SHA-256 recorded
    • All 5 SEV per-template measurements computed (job outputs sev_measurement_{small,medium,large,2xlarge,4xlarge} populated)
    • Privacy gate passes (LOG_LEVEL_APP=info, no debug)
    • Cosign-signed manifest published with amd_sev_snp.per_template and baked_env.LOG_*
  • If pushed under cicd/... branch (or merged to test), Deploy-SecretVM-Test runs against the new test VM UUID and post-deploy attestation poll matches manifest RTMR3
  • Manual: pull manifest from GHCR, verify schema and per-template values match the SCRT Labs SEV registry entry for v0.0.27-alpha.1

Made with Cursor

…plate measurements, bake LOG_LEVEL_* into attestation manifest

Brings the TEE CI/CD pipeline in line with SCRT Labs' new portal-mandated
SecretVM release v0.0.27-alpha.1 and PRs #718/#720 (AMD SEV-SNP support
in proxy-router runtime). Extends the cosign-signed attestation manifest
so verifiers can match per-template SEV-SNP launch digests and prove that
verbose logging cannot leak privacy data from a TEE-deployed image.

Changes
- .github/tee/secretvm.env: pin SECRETVM_RELEASE=v0.0.27-alpha.1; add TDX
  and SEV rootfs URLs/SHA-256s; add SEV artifact registry pointer
- proxy-router/scripts/compute-sev-measurement.py (new): Python port of
  CalcSevMeasurement; computes SHA-384 launch digests for all 5 SecretVM
  vCPU templates (small/medium/large/2xlarge/4xlarge); mirrors the
  existing compute-rtmr3.py CI pattern
- proxy-router/internal/attestation/sev_python_parity_test.go (new):
  hermetic Go-vs-Python parity test using a version-agnostic synthetic
  fixture (artifacts_ver=parity-test-fixture-v1) so future SecretVM
  bumps do not require touching the test
- proxy-router/internal/attestation/golden.go: rename JSON tag
  amd_sev -> amd_sev_snp; add SEVMeasurements.PerTemplate map and
  GoldenValues.SEVPerTemplate + MatchSEVMeasurement helper
- .github/workflows/build.yml:
  - download both TDX + SEV rootfs ISOs (SHA-verify both)
  - fetch SCRT Labs SEV artifact registry, record its SHA-256
  - run compute-sev-measurement.py for all 5 templates, expose as job outputs
  - extract baked LOG_LEVEL_*/LOG_COLOR/LOG_JSON/LOG_IS_PROD from
    Dockerfile.tee with privacy gate (hard-fails build if
    LOG_LEVEL_APP=debug or any required LOG_LEVEL_* missing)
  - manifest now publishes measurements.amd_sev_snp.per_template (×5) and
    baked_env.LOG_* fields alongside intel_tdx.rtmr3
- proxy-router/.gitignore + .dockerignore: ignore Python __pycache__/
- .ai-docs/TEE_Attestation_Architecture.md + TEE_CICD_Supply_Chain_Hardening.md:
  document v0.0.27-alpha.1 pin, SEV per-template asymmetry, baked log
  levels, updated manifest schema

Auto-deploy + RTMR3-poll (Deploy-SecretVM-Test) remains TDX-only for this
PR; SEV auto-deploy is deferred (manual verifier flow works today via the
SEVPerTemplate map).

Validation
- python3 -m py_compile compute-sev-measurement.py: clean
- TestComputeSevMeasurementPythonParity: PASS (Go and Python produce
  identical SHA-384 chains for all 5 templates)
- go vet ./internal/attestation/...: clean
- yaml.safe_load(build.yml): clean
- jq dry-run of manifest assembly: produces well-formed manifest with
  amd_sev_snp.per_template and baked_env.LOG_* populated

Made-with: Cursor
@abs2023 abs2023 merged commit beeb09c into dev Apr 29, 2026
17 checks passed
nomadicrogue added a commit that referenced this pull request Apr 29, 2026
…late + baked LOG_LEVEL_*) (#723)

## Summary

Promotes #722 from \`dev\` to \`test\`. Single commit:

- \`beeb09c\` — feat(cicd-tee): pin SecretVM v0.0.27-alpha.1, SEV-SNP
per-template measurements, baked LOG_LEVEL_* in attestation manifest

## What this delivers to the test environment

- TEE pipeline pinned to **SecretVM v0.0.27-alpha.1** (SCRT Labs' new
portal-mandated release)
- AMD SEV-SNP per-template launch digests (×5:
small/medium/large/2xlarge/4xlarge) computed in CI and signed into the
attestation manifest at \`measurements.amd_sev_snp.per_template\`
- Privacy gate: \`LOG_LEVEL_*\` extracted from \`Dockerfile.tee\` and
signed into \`baked_env\`; build hard-fails if \`LOG_LEVEL_APP=debug\`
or any required \`LOG_LEVEL_*\` is missing
- \`golden.go\` parser updated (\`amd_sev\` → \`amd_sev_snp\`;
\`PerTemplate\` map; \`MatchSEVMeasurement(live)\` helper)
- Hermetic Go ↔ Python parity test ensures CI's
\`compute-sev-measurement.py\` stays in lockstep with runtime
\`sev_gctx.go\`

## Why this is safe

End-to-end already validated on the cicd branch (run
[25120743562](https://github.com/MorpheusAIs/Morpheus-Lumerin-Node/actions/runs/25120743562)):

- ✅ Standard image built and pushed to GHCR
- ✅ TEE image built and pushed (with cosign keyless signature + SBOM)
- ✅ SecretVM SEV artifact registry fetched, all 5 per-template SEV
measurements computed
- ✅ TDX RTMR3 computed, manifest assembled with
\`amd_sev_snp.per_template\` + \`baked_env.LOG_*\` + signed and attached
to GHCR
- ✅ Deployed to the new SecretVM test instance (UUID updated by ops to
point at v0.0.27-alpha.1 VM)
- ✅ Post-deploy attestation poll: live RTMR3 from VM matched expected
RTMR3 from the manifest on attempt 2/12 (after VM reboot)

The dev-branch run
([25122325951](https://github.com/MorpheusAIs/Morpheus-Lumerin-Node/actions/runs/25122325951))
is also green; per existing repo policy, GHCR-push and SecretVM-deploy
jobs only fire for \`cicd/*\`, \`test\`, and \`main\` branches, so the
dev run validated tests + tag generation only. Merging into \`test\`
will retrigger the full pipeline (this time with \`:latest-test\` tag
promotion).

## Scope explicitly NOT in this PR

- SEV auto-deploy + auto-verify (\`Deploy-SecretVM-Test\` extracts RTMR3
at a TDX-quote-specific offset, so it's still TDX-only). Manual SEV
verification works today via the runtime verifier consuming
\`SEVPerTemplate\` from the signed manifest. SEV auto-deploy is a
tracked follow-up.

## Test plan (after merge to test)

- [ ] CI-CD on \`test\` branch runs cleanly: standard image + TEE image
both built, signed, pushed; \`:latest-test\` tag promoted
- [ ] Deploy-SecretVM-Test runs against the new test VM UUID and
post-deploy RTMR3 poll matches manifest \`intel_tdx.rtmr3\`
- [ ] Manual: pull manifest from GHCR for the new \`:latest-test\` tag,
confirm \`measurements.amd_sev_snp.per_template\` has 5 entries and
\`baked_env.LOG_LEVEL_APP=info\` (not debug)


Made with [Cursor](https://cursor.com)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant