Repository navigation
security: confine session workers and add standalone proxy - #346
ebursztein wants to merge 253 commits into
Conversation
fcc5415 to
ff3f040
Compare
bfecf47 to
aa79a59
Compare
|
CI diagnosis for run 37971649154, ARM64 job 113959771469:
|
aa79a59 to
2922a8f
Compare
|
CI diagnosis for run 37971649154, macOS job 113959771017: The confined-worker step passed ( |
2922a8f to
9f38147
Compare
|
CI diagnosis for run 37974377516, macOS job 113968904613: The full 5,786-test Rust suite, ledger 2/2, proxy 5/5, integration, frontend, Python distribution/install, lint, and Python SDK checks all passed. The later TypeScript SDK package acceptance failed because the CI job entered its clean offline npm consumer without first running the package prewarm owned by the authoritative local gate. A fresh macOS runner's pnpm store does not imply that npm's separate cache contains Head 9f38147 adds |
9f38147 to
df77b45
Compare
|
CI diagnosis for run 37977436941, macOS job 113979231430: Static, both Linux architectures, docs/sites, the full 5,786-test macOS Rust suite, ledger 2/2, proxy 5/5, integration, frontend, Python distribution/install, lint, Python SDK, and the corrected TypeScript SDK package acceptance all passed. The subsequent MCP packed-package acceptance failed because CI likewise skipped Head df77b45 adds |
aba4b50 to
605b206
Compare
|
CI run 37986536371 reached the build-system release contracts and failed one debt-ratchet assertion: the integrated tree contains 21 Python The latest |
7fc85cd to
b53fa7a
Compare
b53fa7a to
a1b8cb0
Compare
Issue #206 found that the VM owner and service retained ambient authority over guest-facing network and per-session ledger resources. This change moves those resources behind generation-bound descriptor grants: one confined proxy worker and one confined ledger worker per session, supervised by the trusted service. It also adds
capsem proxy, a VM-free OpenAI-compatible endpoint that reuses the same policy, credential, telemetry, and audit engine without accepting client-selected upstream authority.The worker boundary is enforced before readiness. Linux uses Landlock plus seccomp and macOS uses Seatbelt; workers clear inherited environments and descriptors, bind every capability to the trusted session and generation, and attest that unrelated files, ambient network and control-socket paths, direct dialing, process execution, and parent signals are denied. Linux also denies socket creation. Seatbelt permits authority-free private unnamed socketpairs while denying external bind, listen, and connect operations. Broker grants are typed, single-use, and revoked with their generation. KVM sockets are prepared before the VM owner enters confinement, and the trusted service owns the global MCP discovery cache so a VM owner retains only its session, read-only assets, and granted IPC.
The ledger worker is the sole SQLite and native-zstd owner for its session. VM, proxy, service-read, stopped-session, retention, WARC, and body operations use bounded typed channels. Producer commitments are ordered and anchored outside the ledger directory, with explicit limits for unanchored tail loss and compromised producers. The zstd archive extension preserves deflate reads, corruption detection, durability ordering, and history across flushes.
capsem proxysupports official Python and TypeScript OpenAI clients for Chat Completions and Responses, including streaming, tools, usage, cancellation, and upstream error propagation. It exposes no CONNECT or forward-proxy path, cannot change its configured provider authority, starts no VM, and shuts down its worker and audit session together. The listener is unauthenticated as specified by #206; SDK gateway authentication remains separate.The rebuilt docs include the implemented process and capability model, VM and standalone traffic paths, OS differences, lifecycle and revocation behavior, integrity limits, and a working SDK
base_urlexample.Validation for current
3153cada3311f6c3a71aa638cb8e3298a3e0664d:just fast-testpassed 46/46 in 3m44s (20261010-161320-1dbfc5-test-fast), including 1,436 Citadel tests, dependency audits, workspace clippy, SDK/frontend tests, and docs/release-site builds0.7runtime assetsjust test ... forceafter its previous complete attempt failed; physical-Mac proof also remains pending before mergeThe branch also updates vulnerable locked dependencies where patched releases exist and retains the repository's time-boxed build-only exception for
braces, for which no patched release exists.Closes #206