Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

bug: align empty network binary scope semantics

未关闭
#3,476 0 条评论 0 个 reaction 已指派 1 人 在 GitHub 查看

@pimlock 已经在做这个了。

开始于 2026年9月19日。

评估

这个 Issue 还没有评估数据。

描述

area:policy topic:l7 topic:networking

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 binaries list.
  • 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_binary according to the chosen representation.
  • Add tests covering explicit binaries, binaries: [], omitted binaries, and incremental L7 updates.
  • Ensure coverage and reload reporting cannot claim authorization that runtime enforcement denies.

Reproduction Steps

  1. Start a Docker-backed OpenShell gateway and sandbox.
  2. Apply a policy allowing index.crates.io:443 for /usr/bin/curl and confirm the request succeeds.
  3. Replace the binary list with binaries: [] and wait for policy activation.
  4. Repeat the request and observe that the runtime denies it.
  5. Apply the same policy with the binaries field omitted. The gateway reports the policy unchanged because it canonicalizes identically, and the runtime still denies it.
  6. Compare this result with binary_scope_covers, policy_covers_rule, merge handling, and the --any-binary documentation, which treat the empty list as any binary.

Environment

  • OpenShell: current main checkout 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

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

NVIDIA/OpenShell 的其他 Issue

查看 NVIDIA/OpenShell 的全部 Issue

相似的 Issue

更多 Rust Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。