Skip to content

feat(sce)!: replace SQS with signed webhook delivery - #132

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

prdai wants to merge 12 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 registers in its Nitro attestation document.
  • Result delivery is now signed webhooks. POST /run requires a webhookUrl; pass secure/result-consumer's ResultWebhookUrl to store results for GET /run/{runId}, or a DC URL.
  • The control plane makes a 5s HEAD reachability check with redirects disabled before launching EC2. Any HTTP status counts; DNS/TLS/connection failure returns 400 webhook unreachable.
  • secure/result-consumer is now an HTTPS receiver (POST /results) instead of an SQS consumer. When used as the run webhook, it verifies the signature against verifier-service GET /runs/{runId} and writes RunResultsTable, so GET /run/{runId} returns the result.
  • Removed SQS result delivery: host credentials, port 5002, sqs:SendMessage, queue, result-consumer SQS trigger.
  • verifier-service stores the attestation document public_key at /attest and exposes GET /runs/{runId} for signature verification.
  • Docs, deploy units, CI change detection, and Make targets updated.

why

SQS could not be called from inside the enclave without either borrowing the host instance role or minting a presigned URL. Borrowing the role gives the enclave the host's AWS capabilities, and presigned SQS SendMessage does not work for a dynamic body (tested: SQS returned 404 UnknownOperationException). HTTPS delivery removes SQS and host credentials while keeping integrity bound to the measured enclave.

This does not fix #120: the host still chooses the runId it serves to the enclave. Optional DC-provided output encryption is tracked in #141.

verification

  • cd secure/sce-unit && gofmt -l . && go vet ./... && go build ./... passes.
  • cd secure/sce/execution-service && bun run lint && bun run typecheck passes.
  • cd secure/result-consumer && bun run lint && bun run typecheck passes.
  • cd secure/verifier-service && bun run lint && bun run typecheck passes.
  • cd benchmark && uvx ruff==0.17.4 check . && uvx ruff==0.17.4 format --check . passes.
  • Deployed result-consumer, execution-service, verifier-service; rebuilt and shipped the registry/EIF; rebuilt and seeded the health algorithm. The final commit 8876fc4 (required per-request webhook) is not deployed/tested yet; the behavior below used the previous default-internal-receiver build with the same receiver URL.
  • Internal delivery: runs 07bd452a-877d-4e22-8d1a-e218afa561df and ac9ad5e2-2d72-4921-80d9-88187f501355 returned exit:0 through GET /run/{runId} after the HEAD check and required-webhook change.
  • Forged result POSTed to result-consumer: 401 invalid signature; the stored result was unchanged.
  • Unknown run POSTed to result-consumer: 404 run has not attested.
  • DC webhook override: run 617fc6c6-49eb-48f8-ae98-c405b660ca5d delivered to a public webhook. The signature verified against GET /runs/{runId}, status was exit:0, and GET /run/{runId} stayed pending.
  • Signature check: original payload verifies true; tampered payload verifies false.

notes

  • An orphaned DynamoDB table result-consumer-dev-RunResultsTable-1APZOQFP38H41 remains; it has no CloudFormation stack tag and was not deleted.
  • The HEAD probe is an accepted SSRF surface: the control plane can reach VPC-internal hosts, and the hardcoded private-host filter was removed. A public-egress-only delivery proxy is the proper fix. Redirects are not followed, and DNS rebinding remains a gap.
  • A failure before attestation has no signature, so no webhook result is delivered for that run.

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

prdai and others added 3 commits November 22, 2026 16:31
@prdai prdai changed the title feat(sce): sign run results with the attested enclave key feat(sce): sign run results and send them to SQS from the enclave Nov 23, 2026
prdai and others added 2 commits November 23, 2026 14:11
Co-authored-by: Codex <codex@openai.com>
@prdai prdai changed the title feat(sce): sign run results and send them to SQS from the enclave feat(sce): sign run results and support per-run webhooks Nov 26, 2026
Co-authored-by: Codex <codex@openai.com>
@prdai prdai changed the title feat(sce): sign run results and support per-run webhooks feat(sce)!: replace SQS result delivery with signed webhooks Nov 26, 2026
@prdai prdai changed the title feat(sce)!: replace SQS result delivery with signed webhooks feat(sce)!: replace SQS with signed webhook delivery Nov 26, 2026
prdai and others added 4 commits November 27, 2026 10:00
Co-authored-by: Codex <codex@openai.com>
Co-authored-by: Codex <codex@openai.com>
Co-authored-by: Codex <codex@openai.com>
Co-authored-by: Codex <codex@openai.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.

Result binding: host-selected run id lets an enclave publish under another run

1 participant