Open
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…yption key rotation Three security improvements to the sealed secrets system: 1. Egress allowlist enforcement (#4 - highest priority) Thread project egress allowlist through the full stack so the MITM proxy actually enforces it. Previously the allowlist was stored in the DB but never passed to the proxy — any host could receive sealed tokens. - Add EgressAllowlist to SandboxConfig and CreateSandboxRequest proto - Control plane reads project.EgressAllowlist and passes via gRPC - Worker extracts and passes to CreateSealedEnvs() in all 3 code paths (manager.go Create, snapshot.go warm fork, snapshot.go golden create) - Proxy now blocks outbound HTTPS to hosts not in the allowlist 2. mTLS on gRPC (#1 - control plane ↔ worker) New internal/grpctls package. When OPENSANDBOX_GRPC_TLS_{CA,CERT,KEY} env vars are set, all gRPC connections use mutual TLS 1.3 with client cert verification. Falls back to insecure when unset (backwards compatible). - Worker gRPC server requires client certs - Control plane persistent pool (redis_registry) and ad-hoc connections both use mTLS client credentials 3. Encryption key rotation (#3) New internal/crypto/keyring.go adds versioned encryption. Ciphertext gets a 2-byte version header; decryption tries the matching version key, then falls back to primary for legacy (pre-rotation) data. - OPENSANDBOX_SECRET_ENCRYPTION_KEY = primary key - OPENSANDBOX_SECRET_ENCRYPTION_KEY_V1..V9 = previous keys - To rotate: generate new key, move old to _V1, set new as primary - All existing tests pass + 4 new keyring tests (rotation, legacy fallback) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.
Projects & Sealed Secrets
Adds the full projects and sealed secrets system — secrets are encrypted at rest in Postgres, sealed into opaque
osb_sealed_*tokens inside the VM, and transparently replaced with real values by a MITM proxy on outbound HTTPS requests. The real secret value never exists in VM memory.What's included
Core infrastructure
internal/secretsproxy/— HTTP CONNECT MITM proxy that intercepts outbound HTTPS and replaces sealed tokens with real secret values in headers and request bodiesinternal/crypto/— AES-256-GCM encryption for secrets at rest (key viaOPENSANDBOX_SECRET_ENCRYPTION_KEY)internal/secretsproxy/ca.go— per-worker CA generation, persisted across restartsinternal/firecracker/— iptables redirect rules to route VM HTTPS traffic through the proxy; sealed env injection on sandbox create, checkpoint restore, and golden snapshot pathsAPI & control plane
internal/api/projects.go+internal/controlplane/projects.go— full CRUD for projects and secrets (create, update with partial merge, list, delete)internal/db/migrations/014_projects.up.sql— projects, org_secrets, secret_groups tablesinternal/db/store.go— all project/secret DB operations with encrypted storageprojectparam to inherit config defaults and sealed secretsCLI
oc project create/list/get/update/delete— project lifecycle managementoc secret set/list/delete— secret management scoped to projectsoc create --project— create sandbox with project configSDKs
Projectclass with full CRUD + secrets,Sandbox.create({ project })supportProjectclass with full CRUD + secrets,Sandbox.create(project=)supportDocs
projectparameterHow sealed secrets work
Testing
Unit tests
internal/crypto/encrypt_test.go— AES-256-GCM encrypt/decrypt round-trip, wrong-key rejectioninternal/secretsproxy/replacer_test.go— token replacement in headers, bodies, partial matches, edge casesSDK integration tests (run against dev server)
sdks/typescript/examples/test-projects.ts— 8-step test: create project → set secrets → create sandbox with project → verify env vars are sealed (osb_sealed_*) inside VM → cleanupsdks/python/examples/test_projects.py— equivalent 8-step test in PythonManual testing against dev server
$ANTHROPIC_API_KEYresolves toosb_sealed_*tokenenvoutput contains no plaintext secret valuesEnd-to-end proxy replacement test (
scripts/test-proxy-secrets.sh)osb_sealed_*)env