Repository navigation
fix(security): remove pre-allowed messaging from base sandbox policy - #1705
Conversation
…ox policy Telegram and Discord were pre-allowed in the base network policy, giving every sandboxed agent default access to external messaging APIs without user opt-in. Move these to opt-in only via the existing preset system, which is already applied automatically during onboarding when users configure messaging tokens. Signed-off-by: Aaron Erickson <[email protected]>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
💤 Files with no reviewable changes (3)
📝 WalkthroughWalkthroughNetwork policy entries for Telegram and Discord external services are removed from baseline documentation and sandbox policy configurations. This eliminates previously allowed outbound access to Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
…VIDIA#1705) ## Summary - Removed Telegram (`api.telegram.org`) and Discord (`discord.com`, `gateway.discord.gg`, `cdn.discordapp.com`) from the base sandbox network policy - These endpoints gave every sandboxed agent default access to external messaging APIs without user opt-in — a data exfiltration vector - Users who configure messaging tokens during onboarding already get connectivity via the existing preset system (`presets/telegram.yaml`, `presets/discord.yaml`), which is applied automatically when tokens are detected ## Test plan - [x] Full vitest suite passes (1243 tests, 0 failures) - [x] Base policy YAML parses correctly - [x] No telegram/discord references remain in base policy - [ ] E2E: verify messaging preset auto-application when tokens are present <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Chores** * Removed Telegram API endpoint from baseline network allow-list policies * Removed Discord API endpoints (REST and WebSocket gateway) from sandbox network policies * Updated network policy documentation to reflect removed endpoint groups <!-- end of auto-generated comment: release notes by coderabbit.ai --> Signed-off-by: Aaron Erickson <[email protected]>
…VIDIA#1705) ## Summary - Removed Telegram (`api.telegram.org`) and Discord (`discord.com`, `gateway.discord.gg`, `cdn.discordapp.com`) from the base sandbox network policy - These endpoints gave every sandboxed agent default access to external messaging APIs without user opt-in — a data exfiltration vector - Users who configure messaging tokens during onboarding already get connectivity via the existing preset system (`presets/telegram.yaml`, `presets/discord.yaml`), which is applied automatically when tokens are detected ## Test plan - [x] Full vitest suite passes (1243 tests, 0 failures) - [x] Base policy YAML parses correctly - [x] No telegram/discord references remain in base policy - [ ] E2E: verify messaging preset auto-application when tokens are present <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Chores** * Removed Telegram API endpoint from baseline network allow-list policies * Removed Discord API endpoints (REST and WebSocket gateway) from sandbox network policies * Updated network policy documentation to reflect removed endpoint groups <!-- end of auto-generated comment: release notes by coderabbit.ai --> Signed-off-by: Aaron Erickson <[email protected]>
## Summary The base sandbox policy (`nemoclaw-blueprint/policies/openclaw-sandbox.yaml`) was silently granting every sandbox egress to `api.telegram.org`, `discord.com`, `gateway.discord.gg`, and `cdn.discordapp.com` — regardless of whether the user enabled the telegram/discord messaging channel in step [5/8] or ticked the preset in step [8/8] of onboard. This is a regression of a previously-fixed behavior. After a fresh onboard that explicitly skipped messaging channels and did not tick Discord in the Balanced-tier preset picker, `nemoclaw <name> policy-list` reports: ``` ● discord — Discord API, gateway, and CDN access (active on gateway, missing from local state) ``` ## Problem Regression history: - [#1705](#1705) (2026-04-09, [`77051cc8`](77051cc8)) — removed `telegram` and `discord` from baseline "for exactly this reason." Explicitly called it a data exfiltration vector. - [#1700](#1700) (2026-04-14, [`855924fd`](855924fd)) — an unrelated npm_registry PR that was rebased on a branch predating #1705. The CodeRabbit release notes on #1700 even flagged it: *"Added network policy entries to enable controlled Telegram and Discord messaging access."* The messaging entries came back as part of that PR's conflict-resolution and have been in the baseline since. Once `discord` exists as a key in the gateway's loaded policy, `policies.getGatewayPresets()` detects the Discord preset as active (it matches on key presence). `nemoclaw policy-list` then renders the misleading "active on gateway, missing from local state" line for a preset the user never selected — and the egress is actually enforced, so it's a real capability grant, not just a display bug. ## Test plan - [x] `npx vitest run test/validate-blueprint.test.ts test/policies.test.ts` — 124 tests pass, including the three new regression tests that guard against this specific re-add pattern for telegram, discord, and slack. - [x] `npx vitest run test/validate-configs-dangerous-hosts.test.ts test/onboard.test.ts` — 160 tests pass. No onboard-flow regressions. - [x] Manually verified that users who enable a messaging channel in step [5/8] and apply the corresponding preset in step [8/8] still get identical endpoint access via `presets/{telegram,discord}.yaml` (no preset YAML changes in this PR). - [x] `openclaw-sandbox-permissive.yaml` (used for `--dangerously-skip-permissions`) unchanged — permissive users still get pre-allowed messaging as before. Fixes #2180. Signed-off-by: latenighthackathon <[email protected]> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Removed default network permissions for Telegram and Discord from the sandbox baseline; messaging endpoints (Telegram, Discord, Slack) are no longer enabled by default and must be added via opt-in presets during onboarding. * **Tests** * Added regression tests to ensure messaging provider access (Telegram, Discord, Slack) remains restricted in the baseline policy and cannot be reintroduced inadvertently. <!-- end of auto-generated comment: release notes by coderabbit.ai --> Signed-off-by: latenighthackathon <[email protected]> Co-authored-by: latenighthackathon <[email protected]> Co-authored-by: J. Yaunches <[email protected]>
Summary
api.telegram.org) and Discord (discord.com,gateway.discord.gg,cdn.discordapp.com) from the base sandbox network policypresets/telegram.yaml,presets/discord.yaml), which is applied automatically when tokens are detectedTest plan
Summary by CodeRabbit