Fabric Connect: seal proxied operations end-to-end with the cluster secrets key (`encrypted_operation`), starting with the token mint (blocked on harper#3288)
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Anfängerfreundlichkeit
- 25/100
- Issue-Typ
- Feature
- Klarheit
- Größtenteils klar
- Aktivitätsstatus
- Aktiv
- Tech-Stack
- typescript
- Bereich
- authentication, backend-api-design, security
Rechercherichtung
Start with src/config/getInstanceClient.ts and trace the proxy client setup, then read src/lib/crypto/envSecret.ts, src/integrations/api/instance/secrets/secrets.ts, and authStore.establishFabricConnectAuth. The issue depends on Harper's encrypted_operation support and the control-plane relay, so confirm those interfaces before implementation. Done means the listed acceptance criteria pass, including interceptor tests, retry and fallback behavior, badge state, and logging redaction.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Studio leg of end-to-end encrypted Fabric Connect operations. Blocked on HarperFast/harper#3288 (encrypted_operation in core) and on the control-plane leg that relays it opaquely (linked as a dependency on this issue).
Context
When a cluster or instance is reached through Fabric Connect, getInstanceClient points the axios client at the proxy URL (src/config/getInstanceClient.ts:58-77) and every operation, request and response, crosses the proxy in plaintext. The first one in every session is createInstanceAuthenticationTokens (src/integrations/api/instance/auth/createInstanceAuthenticationTokens.ts, called from authStore.establishFabricConnectAuth), whose response is the operation token and refresh token the rest of the session uses; sessions whose direct connection fails (studio#1635 measured network-level direct failures across 11 organizations in a day) keep using the proxy for everything.
Studio already seals values to a cluster's secrets public key for set_secret: src/lib/crypto/envSecret.ts (encryptEnvelope, WebCrypto RSA-OAEP + AES-GCM, enc:v1 output) and secretsPublicKeyQueryOptions({ managedClusterId }) in src/integrations/api/instance/secrets/secrets.ts, which fetches the key from the control plane for managed clusters. harper#3288 lets the same envelope carry a whole operation and answers with a response sealed under a per-request key.
Changes
- Transparent sealing on the proxy client. In
getInstanceClient, whenfabricConnectis true and the target supports it, install a request interceptor that replaces the body with{ operation: 'encrypted_operation', envelope }whereenvelope = encryptEnvelope(JSON.stringify({ v: 1, op: body, rk, nonce, ts: Date.now(), actor }), publicKey, fingerprint)with fresh randomrk(32 bytes) andnonce(16 bytes); and a response interceptor that decryptsencrypted_responsewith WebCrypto AES-GCM underrk, AAD"harper.encrypted_operation.response:" + nonce, then resolves with the innerbodyor rejects with anAxiosErrorwhoseresponse.status/dataare the inner ones. Existing callers and react-query hooks see the same shapes as today.connectsThroughProxy(id)stays the single switch. - Self-heal paths. On a plaintext
409withcustody_fingerprint, invalidate the public-key query and retry once (same pattern as theKID_MISMATCH_ERROR_PHRASEhandling insecrets.ts). On a staleness error carryingserver_time, retry once with the clock offset applied. - Capability gate.
MIN_ENCRYPTED_OPERATION_VERSIONchecked withwasAReleasedBeforeBagainstgetRegistrationInfoQueryOptions' version, the pattern inuseSupportsDeploymentSSE.ts; the constant is set when the core release is cut. - No custody key. Self-hosted clusters (the control plane answers 400 for the key), clusters below the minimum version, or a node answering 503 "custody is not initialized": fall back to plaintext proxying and show a persistent indicator on the Fabric Connect badge ("not end-to-end encrypted; operations are visible to the control plane"). A "require encrypted proxying" preference is a follow-up, not this issue.
- Mode policy. harper#3288 has two modes: whole-body
sealed, andfields(keys in the clear, values sealed, inner status visible) so the control plane can audit what was attempted. Proposed default:fields, sealing every leaf exceptoperationand the structural keysdatabase,schema,table, with whole-bodysealedas a per-call override for operations whose structure is sensitive. Infieldsmode the interceptor serializesopto JSON text, puts its SHA-256 in the sealed header asoph, and binds each sealed leaf to its JSON Pointer; the helper lives besideenvSecret.ts. Both modes must be selectable per call; the default is left open until the core issue has had feedback (Devin, 2026-10-19). - First consumer is the token mint over the proxy; the proxy-fallback mode in
resolveFabricConnectAuthis covered by the same interceptor. - Never log the sealed request,
rk, or the unsealed response; the existing rule of logging onlyerror.message(axios configs carry bearer tokens) applies.
Acceptance criteria
-
With a capable managed cluster, every operation sent through the proxy leaves the browser as
encrypted_operationwith anenc:v1envelope sealed to the cluster key the secrets page uses, and the caller receives the inner response or error with unchanged shape (unit tests on the interceptors with a mocked proxy; one test proves the plaintext operation name never appears in the request body). -
The token mint over the proxy is sealed; the minted token is unsealed in the browser only.
-
Key-mismatch and clock-skew answers self-heal with one retry; a second failure surfaces as the inner error.
-
Without a key or below the minimum version, operations still work in plaintext and the badge shows the plaintext state; the secrets page's "no custody" copy mentions that proxied operations are affected too.
-
No sealed material or key bytes reach
console, Datadog RUM actions, or error tracking (assert on the RUM wrapper's redaction as existing tests do). -
In
fieldsmode the request body showsoperationand the structural keys in plaintext and every other leaf as{ $sealed }; a test provesophmatches the sentopbytes and that a sealed leaf moved to another path is rejected by the node.
Links
- Core: HarperFast/harper#3288 (mechanism, threat model). Related: studio#1635 (direct-connect reachability), studio#1974 (sign-out through the proxy).
🤖 Generated by Anthropic Claude (Mythos 5.1) as devain; posted via @Devin-Holland.
- Vorherrschende Sprache
- TypeScript
- Sterne
- 5
- Forks
- 4
- Ø Merge
- 1 T. 12 Std.
- Gemergte PRs (30 T.)
- 65
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Keine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus HarperFast/studio
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
HarperFast/studio#2070 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 74/100
HarperFast/studio#2067 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
HarperFast/studio#2053 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 65/100
HarperFast/studio#2026 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 77/100
HarperFast/studio#2021 ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in HarperFast/studio
Ähnliche Issues
-
area:tooling good first issue
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
interledger/publisher-tools#1007 ·
Maintainer antworten meist innerhalb von 1 Tag
-
priority/medium roadmap/v1.1.1 stakeholder/rapr type/bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 83/100
databrickslabs/ontos#1420 ·
Maintainer antworten meist innerhalb von 3 Tagen
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
vercel-labs/just-bash#756 ·
Maintainer antworten meist innerhalb von 1 Tag
-
area: ci good first issue
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 85/100
interledger/web-monetization-extension#1555 ·
Maintainer antworten meist innerhalb von 1 Tag
-
🐞 bug 🧐 unconfirmed
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
Tencent/tdesign-vue-next#7056 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag