Write ADR 0027 — confidential verified-serving tier (universal image in a Dstack CVM)
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 54/100
- Tipo di issue
- Documentazione
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- docker, github, postgresql, typescript
- Ambito
- documentation, infrastructure, security
Direzione di ricerca
Read docs/adr/0021-universal-runtime-image.md, docs/adr/0020-child-bundle-storage-r2.md, and docs/adr/README.md for the existing decisions and ADR style. Write docs/adr/0027-confidential-verified-serving-tier.md with the two verification channels, both boot paths, attestation flow, and required honest limits; then add its index row and bump the next-free note to 0027. Done when the acceptance criteria are met.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
What to build
Write docs/adr/0027-confidential-verified-serving-tier.md — a decision doc recording a new optional runtime tier: the universal image (ADR 0021) run inside a Phala Dstack CVM (Intel TDX), providing end-to-end verifiability of the serving process — SSR output, API/auth behavior, key custody — which SRI pins alone cannot cover. Update docs/adr/README.md (index row + "next free" note bumped to 0027).
Core framing: two verification channels
End-to-end verifiability decomposes into two channels, one already owned by the repo:
| Channel | Covers | Mechanism | Status |
|---|---|---|---|
| Static bytes | UI/plugin bundles the browser loads | SRI pins in the on-chain FastKV config (ADR 0020 amendments), browser-enforced; host-side SRI-before-load (beta-v2 map decision #5) | Already designed |
| Serving process | SSR HTML, API/auth behavior, key custody | Hardware attestation of the universal image running in a Dstack CVM | This ADR |
The naive proposal ("verify the container hash matches the JS you see") conflates the two — the ADR decomposes them honestly, then binds them together.
Decision points to record
- New optional tier: confidential instance. Same universal image, digest-pinned Dstack compose; a hosting mode selected at deploy, not a second architecture. Root stays on Railway/CDN; opt-in per tenant.
- Digest-pinned compose. The Dstack compose pins the image by GHCR digest — the deploy train already produces
BOS_IMAGE_DIGEST, and Dstack best practice is digest pinning so RTMR3's compose-hash traces to exact bytes. - Boot paths — both designed, Path A is the default:
- Path A (default): self-contained boot. Own namespace staged in the image (ADR 0021 tier detection); the measurement covers every served byte. Changes require an image redeploy.
- Path B: CDN-fetch boot, pin-gated. Registry-tier boot allowed for confidential instances: the enclave hard-gates every fetched/served bundle against the FastKV config's SRI pins (beta-v2 #5's host-side SRI-before-load promoted to a hard gate in this tier) and reports the resolved config hash in runtime data. Minute-level config flips preserved; the measurement covers the verifier rather than the bytes, trust anchored in on-chain pins.
- TLS terminated inside the CVM. Dstack's ZT-TLS pattern: keys generated in the TEE, ACME with enclave-held private keys, evidence at
/evidences/bound to the quote'sreport_data, CAA DNS records on the domain. One origin + one start-stack process means one measurement covers the whole surface: SSR, API, and auth (browser API calls ride the same attested TLS). Gateway-managed*.phala.networkTLS is explicitly NOT used — sovereign mode is own domain + own enclave-held TLS. - The differentiating move: config-hash runtime-data binding. The enclave reports the resolved FastKV config hash (+ registry height) in attestation runtime data. The full verification chain — every link a primitive the repo already ships:
hardware signature → compose-hash ↔ GHCR digest ↔ CI-validated SHA → config hash ↔ FastKV entry at bos://<account>/<gateway> → SRI pins ↔ bytes in the browser - Attestation surface + three verification audiences. Expose
/.well-known/attestation(Dstack convention: quote + event log + VM config, nonce freshness viareportData). Audiences: (a) trustless local verification (dcap-qvl/dstack-verifier) for power users and agents — natural futurebos verify <domain>; (b) a monitor-backed UI badge for normal users, framed honestly as auditable, not in-browser math; (c) CI verification after each deploy. Future options: on-chain DCAP verification (Automata-style), a FastKV-published measurement allowlist mirroring DstackKms governance on NEAR. - Secret custody as a secondary benefit (not the goal, recorded as such):
BETTER_AUTH_SECRET, the relayer/Sponsor ephemeral key, and storage credentials KMS-released only to the whitelisted measurement. Postgres stays outside the enclave; boundary documented honestly.
Honest-limits section (required)
- Verifier bootstrap circularity (the verifier is served by the enclave it verifies — resolved by vendor-root-anchored quote verification + evidence binding, but stated explicitly).
- Browsers don't verify attestation natively; for ordinary users this lands as an auditable guarantee / badge, not a felt math check.
- The measurement covers boot-time state; runtime behavior is covered only via the config-hash binding.
- SSR output is generated at runtime — attestation proves the code, not each rendered byte.
- Postgres outside the enclave; DB URL/secret boundary.
- CVM cost, no serverless, migration re-attestation, debug-mode/TCB-freshness checks.
Status
Proposed, spike-gated — the direction is recorded; implementation is gated on the spike ticket.
Acceptance criteria
-
docs/adr/0027-confidential-verified-serving-tier.mdwritten in repo ADR style (context → decision → limits → consequences) - Both boot paths recorded as designed decisions with the tradeoff stated (A: measurement covers bytes; B: trust anchored in pins + enclave verifier)
-
docs/adr/README.mdindex row added and "next free" note bumped to 0027 - No changeset required (docs-only)
Context
- Follows discussion of ADR 0021 (
docs/adr/0021-universal-runtime-image.md), ADR 0020 (docs/adr/0020-child-bundle-storage-r2.md), and the beta-v2 wayfinder map decision #5 (publisher attestation + load-time SRI — the confidential tier is the process channel and proceeds independently). - Dstack references: RTMR3 measures the compose hash; TLS keys generated in-TEE with evidence bound to the quote; trustless verification via dcap-qvl; zkSecurity audit (2025-08).
- Spike ticket to follow (blocked by this one).
- Lingua principale
- TypeScript
- Stelle
- 5
- Fork
- 3
- Merge medio
- 9h 55m
- PR unite (30g)
- 108
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di NEARBuilders/everything-dev
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
NEARBuilders/everything-dev#400 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
NEARBuilders/everything-dev#546 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 54/100
NEARBuilders/everything-dev#545 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
NEARBuilders/everything-dev#531 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
NEARBuilders/everything-dev#526 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di NEARBuilders/everything-dev
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
Automattic/data-liberation-agent#953 ·
I maintainer di solito rispondono entro 1 giorno
-
README に GitHub の組織のバッジを足すApertadocumentation
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
funmary-app/funmary#399 ·
I maintainer di solito rispondono entro 1 giorno
-
area:curator enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
CassioDalla/Scrinalia#150 ·
I maintainer di solito rispondono entro 1 giorno
-
status: needs-triage v1-bug-bash
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
a2ui-project/a2ui#3533 ·
I maintainer di solito rispondono entro 1 giorno
-
backend enhancement priority:P3
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
geolens-io/geolens#3310 ·
I maintainer di solito rispondono entro 1 giorno