Failed peer-binary resolution during policy DENY crashes the supervisor session, tearing down the sandbox's SSH relay
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 48/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- rust
- 领域
- networking, security
调研方向
从由 OPA 支持的网络策略引擎入口点 openshell_supervisor_network::opa 开始,跟踪检查 /proc/<pid>/net/tcp{,6} 的 peer-binary 解析分支。重现被拒绝的请求,并跟踪缺少匹配的 socket 条目时如何到达 supervisor 会话;当被拒绝的连接能够干净地失败,且不会结束 relay 或将 sandbox 移至 Error 时,即表示完成。
由索引模型根据 Issue 内容生成。
描述
Summary
A single correctly denied outbound request — not a bypass attempt, not a policy misconfiguration, just an app trying to reach a host that isn't allowlisted — can kill the whole sandbox. That's a significant reliability/security-usability problem: the failure mode of "policy correctly blocks something" should be "request fails," not "sandbox dies."
Steps to reproduce
openshell sandbox createwith a policy that does not allowlist a host the sandbox's main command will try to reach (in our repro:openclaw-start, whose onboarding flow reachesregistry.npmjs.org:443, not present in the default policy'snvidia/nvidia_web/github/github_rest_api/gitlab/claude_codenetwork_policies).- Attach to the sandbox over SSH and let the onboarding flow run.
- Observe the denied request in
openshell logs <name>. - Within ~1 second, observe the supervisor session error/end in the same log, and the SSH client disconnect (
client_loop: send disconnect: Broken pipe). openshell sandbox get <name>→Phase: Error, no recovery available.
Logs (two independent reproductions)
Run 1 (sandbox 42449366-d949-4285-b787-aa7415570ccf):
[1789391073.953] NET:OPEN [MED] DENIED -> registry.npmjs.org:443 [reason:failed to resolve peer binary: No ESTABLISHED TCP connection found for 10.200.0.2:46932 -> 10.200.0.1:3128 in /proc/54/net/tcp{,6}]
[1789391074.213] [gateway] [WARN] relay stream: inbound errored
[1789391074.213] [gateway] [WARN] supervisor session: stream error
[1789391074.213] [gateway] [INFO] supervisor session: ended
Run 2 (sandbox 9e489e30-42f3-411a-983d-...):
[1789394150.856] NET:OPEN [MED] DENIED -> registry.npmjs.org:443 [reason:failed to resolve peer binary: No ESTABLISHED TCP connection found for 10.200.0.2:46932 -> 10.200.0.1:3128 in /proc/53/net/tcp{,6}]
[1789394151.798] [gateway] [WARN] relay stream: inbound errored
[1789394151.798] [gateway] [WARN] supervisor session: stream error
[1789394151.798] [gateway] [INFO] supervisor session: ended
Expected
A policy DENY — including one where peer-binary resolution fails — should result in the connection attempt failing cleanly from the sandboxed process's point of view. It should never crash the supervisor session or bring down the sandbox.
Suspected area
The peer-binary resolution path in the OPA-backed network policy engine (openshell_supervisor_network::opa), specifically the branch when no matching entry is found in /proc/<pid>/net/tcp{,6} for the connecting socket — this looks like a race (the connecting process's socket may have already closed/reused by the time policy inspects /proc) that isn't handled gracefully and instead propagates into the supervisor session, killing it.
openshell version: 0.0.116
Related: #3308
- 主要语言
- Rust
- 星标
- 8.7k
- 派生
- 1.3k
- 平均合并
- 1 天 20 小时
- 30 天内合并 PR
- 311
环境准备
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
NVIDIA/OpenShell 的其他 Issue
-
area:docs
难度 1/5 1 小时以内 新手友好度 88/100
维护者通常 1 天内回复
-
state:triage-needed
难度 2/5 1-3 小时 新手友好度 82/100
NVIDIA/OpenShell#3400 · 1 条评论 ·
维护者通常 1 天内回复
-
area:cli state:validated
难度 2/5 1-3 小时 新手友好度 72/100
NVIDIA/OpenShell#2888 · 1 条评论 ·
维护者通常 1 天内回复
-
state:triage-needed
难度 1/5 1 小时以内 新手友好度 90/100
维护者通常 1 天内回复
-
area:build spike state:review-ready state:stale
难度 2/5 半天 新手友好度 68/100
NVIDIA/OpenShell#2401 · 1 条评论 ·
维护者通常 1 天内回复
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 92/100
bytecodealliance/wasmtime#14433 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
-
bug
难度 2/5 1-3 小时 新手友好度 76/100
-
难度 2/5 1-3 小时 新手友好度 88/100
维护者通常 1 天内回复