Add client code transparency for verifiable client builds - #1
Open
jameslbarnes wants to merge 4 commits into
Open
jameslbarnes wants to merge 4 commits into
jameslbarnes wants to merge 4 commits into
Conversation
This feature enables developers to be transparent about their client-side code, providing end-to-end verification from client to server. Key components: - Manifest generator: Hash all files in a build directory - Code signing: RSA-2048 signatures compatible with D-Shield TEE keys - Registry API: /api/manifests endpoints for publishing and discovery - Client SDK: Browser-compatible verification for self-verification - CLI tool: dshield-sign command for CI/CD integration The client transparency system complements D-Shield's server-side egress attestation by proving WHAT code is running on clients, enabling users to verify the complete data flow from client to attested backend.
Extends client transparency to fully document ALL APIs the client talks to: New features: - ApiSurface type: Documents endpoints, methods, data categories, third-party services, WebSockets, localStorage, and cookies - Static analyzer: Scans JS/TS code to auto-discover fetch/axios/XHR/WebSocket calls with file locations and confidence levels - CLI analyze command: `dshield-sign analyze --dir ./src` generates API surface template and markdown report - Data flow categories: Standardized types (user-input, credentials, analytics, PII flags) for documenting what data goes where This enables users to see exactly: - Which domains the client contacts - What HTTP methods are used - What data is sent/received - Which services are third-party vs first-party - What local storage and cookies are used Example workflow: dshield-sign analyze --dir ./src --report # Edit api-surface.json to add descriptions dshield-sign generate --api-surface api-surface.json ...
- Add transparent-sdk.ts that wraps global fetch to route all requests through D-Shield proxy for complete network visibility - Add /proxy endpoint in server.ts to handle client SDK requests - Add SDK hash verification to manifest generator - Auto-detect D-Shield SDK in builds and include in manifest - Update documentation to highlight SDK approach as recommended method
- Add request logging with source IP, client ID, size, and body hash - Add response logging with status, size, body hash, and duration - Link request/response with sequence numbers for correlation - Add 'type' field to log entries (egress, request, response) - Update tests to include new type field Now logs the complete chain: - Request: who called, from where, with what (hash) - Egress: what external APIs were called - Response: what was returned (hash), how long it took
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This feature enables developers to be transparent about their client-side
code, providing end-to-end verification from client to server.
Key components:
The client transparency system complements D-Shield's server-side egress
attestation by proving WHAT code is running on clients, enabling users
to verify the complete data flow from client to attested backend.