Zero-config HTTPS MITM: --http-inject-ca and --http-ca-out#88
Open
congwang-mk wants to merge 20 commits into
Open
Zero-config HTTPS MITM: --http-inject-ca and --http-ca-out#88congwang-mk wants to merge 20 commits into
congwang-mk wants to merge 20 commits into
Conversation
Signed-off-by: Cong Wang <cwang@multikernel.io>
Signed-off-by: Cong Wang <cwang@multikernel.io>
Signed-off-by: Cong Wang <cwang@multikernel.io>
Signed-off-by: Cong Wang <cwang@multikernel.io>
Signed-off-by: Cong Wang <cwang@multikernel.io>
Signed-off-by: Cong Wang <cwang@multikernel.io>
Signed-off-by: Cong Wang <cwang@multikernel.io>
Signed-off-by: Cong Wang <cwang@multikernel.io>
Signed-off-by: Cong Wang <cwang@multikernel.io>
Signed-off-by: Cong Wang <cwang@multikernel.io>
Signed-off-by: Cong Wang <cwang@multikernel.io>
Signed-off-by: Cong Wang <cwang@multikernel.io>
Signed-off-by: Cong Wang <cwang@multikernel.io>
Signed-off-by: Cong Wang <cwang@multikernel.io>
Signed-off-by: Cong Wang <cwang@multikernel.io>
…ot seen as self-signed Signed-off-by: Cong Wang <cwang@multikernel.io>
Signed-off-by: Cong Wang <cwang@multikernel.io>
Signed-off-by: Cong Wang <cwang@multikernel.io>
Signed-off-by: Cong Wang <cwang@multikernel.io>
… view Signed-off-by: Cong Wang <cwang@multikernel.io>
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.
Summary
Makes sandlock's HTTP-level ACL work over HTTPS, end to end. Two parts:
1. Zero-config CA + trust injection
--http-inject-ca <path>(repeatable): splices the active MITM CA's public cert into each named trust bundle atopenattime via a built-in seccomp handler (reuses the existing/etc/hostsmemfd-injection mechanism). Without--http-ca, it also generates an ephemeral CA (private key in memory only, never on disk).--http-ca-out <path>: writes the active CA's public cert (never the key) for runtimes with a compiled-in CA store (Node viaNODE_EXTRA_CA_CERTS).[config], FFI (header regenerated), Python SDK.2. Transparent HTTPS MITM proxy (replaces hudsucker)
hudsucker only performs TLS MITM after an explicit
CONNECT, but sandlock intercepts connections transparently (seccomp connect-redirect), so HTTPS never actually worked. This replaces hudsucker with a transparent proxy sandlock owns:0x16= TLS).rcgen), then the decrypted request runs through the existing ACL.http_acl_check, 403 on deny); allowed requests are forwarded upstream (rustls client validating the host's real system roots for HTTPS, plaintext for HTTP).hudsuckerdependency removed.Verification
curl https://api.openai.com/v1/modelsthrough the sandbox with--http-allow "GET api.openai.com/v1/models" --http-inject-ca /etc/ssl/certs/ca-certificates.crtreturns HTTP 401 (reached the real API through MITM, trusting the injected CA); a disallowedPOST .../chat/completionsreturnsBlocked by sandlock HTTP ACL policy/ HTTP 403.Notes for reviewers
🤖 Generated with Claude Code