opencode sandbox policy: npm child-process CONNECT denied (ECONNRESET) and no Vertex AI / WIF egress
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 74/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- node.js, yaml
- Lĩnh vực
- infrastructure, security
Hướng nghiên cứu
Start by reading sandboxes/base/policy.yaml and sandboxes/gemini/policy.yaml, then compare the existing npm policies for droid and ollama and the Google host set in the gemini policy. Reproduce the npm install and Vertex AI/WIF requests, and consider the issue done when both policies permit the required npm processes and Google endpoints without breaking the existing sandbox rules.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Summary
The opencode network policy (in both sandboxes/base/policy.yaml and sandboxes/gemini/policy.yaml) has two egress gaps that break real-world OpenCode usage:
-
npm installs fail with
ECONNRESET.registry.npmjs.orgis listed as an endpoint, but thenpmbinary is not in the policy'sbinaries:allowlist. When opencode spawns a backgroundnpm install(arborist), the connecting process is/usr/local/bin/npm(or/usr/bin/npm), not
the allowlisted opencode/node binaries, so its CONNECT toregistry.npmjs.orgis denied. -
No Google / Vertex AI egress. The
opencodepolicy has zero Google hosts, so running OpenCode against agoogle-vertex-*provider (Vertex AI, including Workload Identity Federation) cannot reach the requiredGoogle endpoints.
Environment
- Base image:
nvcr.io/nvidia/base/ubuntu:noble-20251013(Ubuntu 24.04) - Node
22.22.1-1nodesource1, npm11.11.0,opencode-ai@1.2.18(global) - Sandbox invoked non-interactively:
openshell sandbox exec -- sh -c <cmd>
Repro - npm ECONNRESET
- Start an opencode sandbox.
- In a repo whose deps aren't fully installed, trigger opencode's background dependency install (or run
npm installdirectly). - The CONNECT to
registry.npmjs.orgis denied →ECONNRESET.
Expected: npm reaches registry.npmjs.org (endpoint already allowlisted).
Actual: connection reset, because the npm binary isn't in the opencode policy's binaries: list.
Root cause: policy pairs are (binary, endpoint). registry.npmjs.org is a plain CONNECT tunnel (no tls: terminate), so this is not TLS-MITM - it is a binary allowlist gap. droid and ollama already ship dedicated npm policies; opencode never allowlists npm.
Repro - Vertex AI / WIF egress
- Configure opencode with a
google-vertex-anthropic/*model. - Run any request.
- Auth token exchange and inference fail: no route to
sts.googleapis.com,oauth2.googleapis.com, or*-aiplatform.googleapis.com.
Note: the gemini policy ships the Google auth host set but uses service-account impersonation, so it lacks sts.googleapis.com.
GitHub-OIDC Workload Identity Federation additionally requires sts.googleapis.com:443.
Proposed fix
- Add
/usr/local/bin/npmand/usr/bin/npmto theopencodepolicy'sbinaries:(or a shared dedicatednpmpolicy as droid/ollama do). - Add the Vertex AI + Google token hosts (mirroring
gemini, plussts.googleapis.comfor WIF) to theopencodepolicy'sendpoints:.
A PR applying (1) and (2) to the base and gemini policies will follow.
- Ngôn ngữ chính
- Dockerfile
- Star
- 191
- Fork
- 76
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của NVIDIA/OpenShell-Community
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
-
Contributing AIO Sandbox Image Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
Tất cả issue của NVIDIA/OpenShell-Community
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
copse-dev/agent-pane#2953 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 90/100
simonw/sqlite-utils#872 ·
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 84/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
danielmiessler/LifeOS#2215 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
sympozium-ai/sympozium#627 ·