Skip to content

fix(policy): add node binary to npm_registry network policy#669

Merged
cv merged 2 commits intoNVIDIA:mainfrom
jnun:fix/npm-binary-policy
Mar 30, 2026
Merged

fix(policy): add node binary to npm_registry network policy#669
cv merged 2 commits intoNVIDIA:mainfrom
jnun:fix/npm-binary-policy

Conversation

@jnun
Copy link
Copy Markdown
Contributor

@jnun jnun commented Mar 22, 2026

Summary

npm install inside the sandbox fails with 403 Forbidden because the npm_registry network policy does not include /usr/local/bin/node in its allowed binaries list.

The sandbox proxy checks which binary initiates each outbound HTTPS CONNECT request.
npm is 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 node as the caller, finds no matching binary in the policy, and returns 403.

Reproduction

$ openshell sandbox create --name demo
$ npm install discord.js
npm error 403 403 Forbidden - GET https://registry.npmjs.org/discord.js

Fix

Add /usr/local/bin/node to the npm_registry binaries list in nemoclaw-blueprint/policies/openclaw-sandbox.yaml.
Update docs/reference/network-policies.md to reflect the corrected binaries and access level.

Test plan

  • npm install discord.js succeeds inside the sandbox after applying the updated policy
  • Verified the proxy logs show deny_reason="no matching network policy" for /usr/local/bin/node before the fix
  • openshell policy set with the corrected YAML resolves the 403
  • All existing tests pass (npm test, cd nemoclaw && npm test)

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Documentation

    • Updated npm registry network policy documentation.
  • Chores

    • Broadened npm registry network policy to allow the Node runtime alongside existing tools and expanded permissions for connecting to the npm registry.

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>
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Mar 22, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 08c3ffd0-bca7-401c-aff9-cc7d388f1157

📥 Commits

Reviewing files that changed from the base of the PR and between 9d7b90d and dadfa36.

📒 Files selected for processing (1)
  • nemoclaw-blueprint/policies/openclaw-sandbox.yaml

📝 Walkthrough

Walkthrough

Expanded the npm registry network policy to include /usr/local/bin/node in allowed executables and updated docs to state that connections to registry.npmjs.org:443 from those binaries permit all methods and paths (previously GET-only).

Changes

Cohort / File(s) Summary
NPM Registry Policy Update
nemoclaw-blueprint/policies/openclaw-sandbox.yaml
Added /usr/local/bin/node to the npm_registry policy's allowed executables for connections to registry.npmjs.org:443.
Policy Documentation
docs/reference/network-policies.md
Updated npm_registry baseline endpoint group documentation to reflect broadened egress permissions from GET-only to all methods/paths for the listed binaries.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 A tiny hop to nodes and npm,
Permissions widened, a lively gem,
Docs updated, the policy sings,
Binaries roam with freer wings. ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately and specifically summarizes the main change: adding the node binary to the npm_registry network policy to fix npm install failures.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands and usage tips.

@wscurran wscurran added the bug Something isn't working label Mar 23, 2026
@wscurran
Copy link
Copy Markdown
Contributor

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.

@wscurran wscurran added the priority: medium Issue that should be addressed in upcoming releases label Mar 23, 2026
Copy link
Copy Markdown
Contributor

@senthilr-nv senthilr-nv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 setnpm install lodash succeeds immediately after.

@kjw3 kjw3 self-assigned this Mar 29, 2026
@kjw3
Copy link
Copy Markdown
Contributor

kjw3 commented Mar 29, 2026

@jnun you need to fix the commits so they have verified signatures. Until then, we cannot merge

@cv cv merged commit 67debc3 into NVIDIA:main Mar 30, 2026
10 of 11 checks passed
quanticsoul4772 pushed a commit to quanticsoul4772/NemoClaw that referenced this pull request Mar 30, 2026
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>
laitingsheng pushed a commit that referenced this pull request Apr 2, 2026
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>
lakamsani pushed a commit to lakamsani/NemoClaw that referenced this pull request Apr 4, 2026
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>
gemini2026 pushed a commit to gemini2026/NemoClaw that referenced this pull request Apr 14, 2026
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working priority: medium Issue that should be addressed in upcoming releases

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants