fix(policy): add node binary to npm_registry network policy#669
fix(policy): add node binary to npm_registry network policy#669jnun wants to merge 1 commit intoNVIDIA:mainfrom
Conversation
npm is a Node.js script (/usr/local/lib/node_modules/npm/bin/npm-cli.js), so the actual binary making HTTPS CONNECT requests to the sandbox proxy is /usr/local/bin/node, not /usr/local/bin/npm. The proxy checks the calling binary against the policy's binaries list and returns 403 Forbidden when node is not listed. This causes every `npm install` inside the sandbox to fail with: npm error 403 403 Forbidden - GET https://registry.npmjs.org/<pkg> Adding /usr/local/bin/node to the npm_registry binaries list fixes it. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
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 (2)
📝 WalkthroughWalkthroughThe changes extend npm registry network policy permissions by adding Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 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 |
Summary
npm installinside the sandbox fails with403 Forbiddenbecause thenpm_registrynetwork policy does not include/usr/local/bin/nodein its allowed binaries list.The sandbox proxy checks which binary initiates each outbound HTTPS CONNECT request.
npmis a Node.js script (/usr/local/lib/node_modules/npm/bin/npm-cli.js), so the actual binary making the request is/usr/local/bin/node, not/usr/local/bin/npm.The proxy sees
nodeas the caller, finds no matching binary in the policy, and returns403.Reproduction
Fix
Add
/usr/local/bin/nodeto thenpm_registrybinaries list innemoclaw-blueprint/policies/openclaw-sandbox.yaml.Update
docs/reference/network-policies.mdto reflect the corrected binaries and access level.Test plan
npm install discord.jssucceeds inside the sandbox after applying the updated policydeny_reason="no matching network policy"for/usr/local/bin/nodebefore the fixopenshell policy setwith the corrected YAML resolves the 403npm test,cd nemoclaw && npm test)🤖 Generated with Claude Code
Summary by CodeRabbit
Release Notes
Documentation
Chores