bug: align empty network binary scope semantics
@pimlock 已经在做这个了。
开始于 2026年9月19日。
评估
这个 Issue 还没有评估数据。
描述
User Story
As an OpenShell policy maintainer, I want empty and omitted binary scopes to have one documented and enforced meaning, so that policy tooling and runtime authorization agree.
Problem Statement
OpenShell currently assigns two meanings to an empty NetworkPolicyRule.binaries list:
- Policy merge, coverage, advisor reconciliation,
L7RuleTarget.any_binary, and related documentation treat it as "any binary." - Runtime OPA enforcement requires a binary entry to match, so an empty list matches no binary and denies access.
The authored YAML schema defaults an omitted binaries field to an empty list and canonical serialization omits empty lists. Empty and omitted therefore cannot be distinguished later.
This issue is a low-urgency tracking item for follow-up next week, primarily to preserve the investigation and resolve the documentation and contract ambiguity.
Impact / Why This Matters
The disagreement can produce false-positive control-plane behavior. Coverage checks or the policy advisor may report that a binary authorization is present and loaded while the live proxy still denies it. Users reading the incremental-update documentation may also expect an empty list to authorize every binary.
The current workaround is to always provide an explicit, nonempty binaries list. That avoids the ambiguity but does not fix existing policies, advisor behavior, or misleading documentation.
Acceptance Criteria
- Decide and document the canonical meaning of an empty or omitted
binarieslist. - Align runtime enforcement, policy merge and coverage logic, advisor reconciliation, CLI and SDK contracts, and published documentation with that decision.
- Clarify or revise
L7RuleTarget.any_binaryaccording to the chosen representation. - Add tests covering explicit binaries,
binaries: [], omittedbinaries, and incremental L7 updates. - Ensure coverage and reload reporting cannot claim authorization that runtime enforcement denies.
Reproduction Steps
- Start a Docker-backed OpenShell gateway and sandbox.
- Apply a policy allowing
index.crates.io:443for/usr/bin/curland confirm the request succeeds. - Replace the binary list with
binaries: []and wait for policy activation. - Repeat the request and observe that the runtime denies it.
- Apply the same policy with the
binariesfield omitted. The gateway reports the policy unchanged because it canonicalizes identically, and the runtime still denies it. - Compare this result with
binary_scope_covers,policy_covers_rule, merge handling, and the--any-binarydocumentation, which treat the empty list as any binary.
Environment
- OpenShell: current
maincheckout on 2026-09-18 - Runtime: Docker-backed standalone gateway with locally built gateway, supervisor, and sandbox binaries
- Sandbox image:
ghcr.io/nvidia/openshell-community/sandboxes/base:latest
Logs
RESULT label=explicit status=0 expected=allow
RESULT label=empty status=7 expected=deny
Policy unchanged (same hash after changing empty to omitted)
RESULT label=omitted status=7 expected=deny
LIVE_TEST_PASS
- 主要语言
- Rust
- 星标
- 8.7k
- 派生
- 1.3k
- 平均合并
- 2 天 6 小时
- 30 天内合并 PR
- 301
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
NVIDIA/OpenShell 的其他 Issue
-
area:docs
难度 1/5 1 小时以内 新手友好度 88/100
-
state:triage-needed
难度 2/5 1-3 小时 新手友好度 82/100
-
area:cli state:validated
难度 2/5 1-3 小时 新手友好度 72/100
-
state:triage-needed
难度 1/5 1 小时以内 新手友好度 90/100
-
area:build spike state:review-ready state:stale
难度 2/5 半天 新手友好度 68/100
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 88/100
-
bug core
难度 2/5 1-3 小时 新手友好度 86/100
-
JIT-compiled number -> Decimal conversion silently overflows instead of raising DECIMAL_OVERFLOW 未关闭fuzz
难度 2/5 1-3 小时 新手友好度 82/100
ClickHouse/ClickHouse#122114 ·
-
难度 1/5 1 小时以内 新手友好度 92/100
linebender/vello_svg#90 ·
-
难度 2/5 1-3 小时 新手友好度 74/100