Skip to content

feat(sce): sign run results with the attested enclave key - #132

Draft
prdai wants to merge 2 commits into
mainfrom
feat/sign-run-results-93
Draft

prdai wants to merge 2 commits into
mainfrom
feat/sign-run-results-93

Conversation

@prdai

@prdai prdai commented Nov 22, 2026 •

Copy link
Copy Markdown
Member

what changed

  • The enclave signs runId, algorithmId, status, and output with the ephemeral P-384 key it already registers in its Nitro attestation document.
  • sce-unit streams a base64 payload plus DER signature to the host. The host only forwards the envelope and adds instanceId.
  • verifier-service stores the attestation document public_key on the RunAttestationTable row at /attest, rejects a document without one, and exposes GET /runs/{runId}.
  • result-consumer fetches that run attestation from verifier-service, checks the returned runId, verifies the signature and signed algorithmId, then persists only verified fields.
  • Docs and READMEs updated in the same commits.

why

The host is untrusted, so it could previously fabricate or change any stored result before sqs:SendMessage. Signing inside the enclave binds the result to the measured image and makes forged values fail verification. Closes #93.

This does not fix #120: the host still chooses the runId it serves to the enclave, so a host can ask the enclave to sign a result for another unattested run.

verification

  • cd secure/sce-unit && gofmt -l . && go vet ./... && go build ./... passes.
  • cd secure/result-consumer && bun run lint && bun run typecheck passes.
  • cd secure/verifier-service && bun run lint && bun run typecheck passes.
  • Manually generated a Go-signed P-384 envelope and verified it with the same Node crypto call the consumer uses, including non-ASCII output.
  • Deployed verifier-service, result-consumer, execution-service, and the rebuilt registry/EIF image to the dev account.
  • End-to-end run 1a8fa043-7ce4-422d-86be-f5bf5fef78ee returned exit:0 and persisted the expected health-risk output. Consumer and verifier logs show the run attestation fetch and the verified result.
  • Negative test: sent a forged result for the same runId with a bogus signature. result-consumer logged skipping result with invalid signature, and GET /run/{runId} still returned the original output.

notes

  • A host-only failure before the enclave can attest has no signature, so result-consumer rejects it and the run stays pending. That is deliberate under the Result integrity: a compromised enclave host can forge run results #93 threat model, but it removes the old unsigned failure record.
  • The deployed test also required redeploying pdm-service from main, because the live stack was older than the current encrypted-envelope shape.

Prove it works
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

prdai and others added 2 commits November 22, 2026 16:31
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.

Result binding: host-selected run id lets an enclave publish under another run Result integrity: a compromised enclave host can forge run results

1 participant