fix(policy): add node binary to npm_registry network policy#669
fix(policy): add node binary to npm_registry network policy#669cv merged 2 commits 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 (1)
📝 WalkthroughWalkthroughExpanded the npm registry network policy to include Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 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 |
|
Thanks for submitting this PR, adding the node binary to the npm_registry network policy should fix the issue with npm install failing with 403 Forbidden. |
senthilr-nv
left a comment
There was a problem hiding this comment.
Reproduced on DGX Spark (ARM64) and Brev VM (x86_64) with fresh destroy + onboard on current main. The proxy logs confirm the deny:
CONNECT action=deny binary=/usr/local/bin/node dst_host=registry.npmjs.org dst_port=443
reason=binary '/usr/local/bin/node' not allowed in policy 'npm_registry'
Applied the fix via openshell policy set — npm install lodash succeeds immediately after.
|
@jnun you need to fix the commits so they have verified signatures. Until then, we cannot merge |
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> Co-authored-by: KJ <kejones@nvidia.com>
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> Co-authored-by: KJ <kejones@nvidia.com>
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> Co-authored-by: KJ <kejones@nvidia.com>
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> Co-authored-by: KJ <kejones@nvidia.com>
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
Documentation
Chores