fix(policy): restore L4 tunnel for WebSocket hosts via tls: skip - #2098
Conversation
OpenShell [v0.0.15+ auto-terminates TLS unconditionally](NVIDIA/OpenShell#544) on every detected TLS stream, which also applies to WSS. Without an explicit opt-out, messaging WebSocket endpoints (previously shipping as pure L4 CONNECT tunnels via `access: full`) are now MITMed, and the Discord client consistently loses its gateway connection with close code 1006. Add `tls: skip` to the affected endpoints to restore the pre-v0.0.15 pass-through behaviour: - discord preset: gateway.discord.gg - slack preset: wss-primary.slack.com, wss-backup.slack.com - baseline openclaw-sandbox.yaml: gateway.discord.gg Extend the policy schemas to accept `skip` in the `tls` enum. Fixes #2092. Fixes #1738. Related to #2085. Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: Tinson Lai <tinsonl@nvidia.com>
📝 WalkthroughWalkthroughThe changes introduce a new Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
ericksoa
left a comment
There was a problem hiding this comment.
LGTM. Straightforward fix — adds tls: skip to the WebSocket endpoints that need pure L4 pass-through now that OpenShell v0.0.15+ auto-terminates TLS.
- Correct endpoints targeted (Discord gateway, Slack Socket Mode primary + backup)
- Schemas updated consistently across all three files
- Comments accurately explain the change motivation (NVIDIA/OpenShell#544)
- Discord preset stays in sync with baseline openclaw-sandbox.yaml
- CI all green
## Summary - The `telegram.yaml` preset was missing `tls: terminate` on the `api.telegram.org` endpoint - The baseline `openclaw-sandbox.yaml` has it, but the preset omitted it - After PR #2098 changed gateway TLS field handling, the omission causes 403 on live policy-add (TC-NET-03) ## Test plan - [ ] Nightly E2E `network-policy-e2e` job passes (TC-NET-03) Fixes regression from #2098. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Chores** * Telegram network preset now uses TLS termination for connections to api.telegram.org:443, changing TLS handling for that endpoint. * **Tests** * Test suite updated to reflect TLS behavior: gateway/WebSocket presets assert TLS is skipped, and Telegram preset asserts TLS termination for REST endpoints. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
## Summary Add `tls: skip` to all six endpoints in the `brew` policy preset so the L7 proxy performs L4 pass-through instead of TLS termination. ## Problem After OpenShell v0.0.15+ began auto-terminating TLS on every detected TLS stream ([OpenShell#544](NVIDIA/OpenShell#544)), `git` inside the sandbox fails with: ``` fatal: unable to access 'https://github.com/Homebrew/brew.git/': server certificate verification failed. CAfile: none CRLfile: none ``` `curl` to the same host through the same proxy succeeds, and `git -c http.sslVerify=false` also succeeds — isolating the defect to the proxy's TLS termination presenting a certificate that git's OpenSSL cannot validate. ## Fix Add `tls: skip` to all brew preset endpoints (`formulae.brew.sh`, `github.com`, `ghcr.io`, `pkg-containers.githubusercontent.com`, `objects.githubusercontent.com`, `raw.githubusercontent.com`). This restores L4 pass-through so git validates the real server certificates directly. This follows the same pattern established in PR #2098 for Discord/Slack WebSocket endpoints. ## Test plan - [x] `npx vitest run test/policies.test.ts` — 86 tests pass - [ ] Nightly E2E: `brew` preset `git ls-remote` against whitelisted endpoint succeeds without `http.sslVerify=false` Fixes #2331 Signed-off-by: kagura-agent <kagura-agent@users.noreply.github.com> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Chores** * Updated network policy presets to modify TLS certificate verification behavior for connections to multiple package repository and external service endpoints supporting package management operations. <!-- end of auto-generated comment: release notes by coderabbit.ai --> Signed-off-by: kagura-agent <kagura-agent@users.noreply.github.com> Signed-off-by: kagura-agent <kagura.agent.ai@gmail.com>
…IDIA#2338) ## Summary Add `tls: skip` to all six endpoints in the `brew` policy preset so the L7 proxy performs L4 pass-through instead of TLS termination. ## Problem After OpenShell v0.0.15+ began auto-terminating TLS on every detected TLS stream ([OpenShell#544](NVIDIA/OpenShell#544)), `git` inside the sandbox fails with: ``` fatal: unable to access 'https://github.com/Homebrew/brew.git/': server certificate verification failed. CAfile: none CRLfile: none ``` `curl` to the same host through the same proxy succeeds, and `git -c http.sslVerify=false` also succeeds — isolating the defect to the proxy's TLS termination presenting a certificate that git's OpenSSL cannot validate. ## Fix Add `tls: skip` to all brew preset endpoints (`formulae.brew.sh`, `github.com`, `ghcr.io`, `pkg-containers.githubusercontent.com`, `objects.githubusercontent.com`, `raw.githubusercontent.com`). This restores L4 pass-through so git validates the real server certificates directly. This follows the same pattern established in PR NVIDIA#2098 for Discord/Slack WebSocket endpoints. ## Test plan - [x] `npx vitest run test/policies.test.ts` — 86 tests pass - [ ] Nightly E2E: `brew` preset `git ls-remote` against whitelisted endpoint succeeds without `http.sslVerify=false` Fixes NVIDIA#2331 Signed-off-by: kagura-agent <kagura-agent@users.noreply.github.com> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Chores** * Updated network policy presets to modify TLS certificate verification behavior for connections to multiple package repository and external service endpoints supporting package management operations. <!-- end of auto-generated comment: release notes by coderabbit.ai --> Signed-off-by: kagura-agent <kagura-agent@users.noreply.github.com> Signed-off-by: kagura-agent <kagura.agent.ai@gmail.com>
OpenShell v0.0.15+ auto-terminates TLS unconditionally on every detected TLS stream, which also applies to WSS. Without an explicit opt-out, messaging WebSocket endpoints (previously shipping as pure L4 CONNECT tunnels via
access: full) are now MITMed, and the Discord client consistently loses its gateway connection with close code 1006.Add
tls: skipto the affected endpoints to restore the pre-v0.0.15 pass-through behaviour:Extend the policy schemas to accept
skipin thetlsenum.Fixes #2092.
Fixes #1738.
Related to #2085.
Summary
Related Issue
Changes
Type of Change
Verification
npx prek run --all-filespassesnpm testpassesmake docsbuilds without warnings (doc changes only)AI Disclosure
Signed-off-by: Tinson Lai tinsonl@nvidia.com
Summary by CodeRabbit