Skip to content

fix(network): restore Windows binary path normalization - #5014

Open
shailendra-nv wants to merge 1 commit into
windowsfrom
fix/5013-windows-binary-path-normalization/shailendra-nv
Open

shailendra-nv wants to merge 1 commit into
windowsfrom
fix/5013-windows-binary-path-normalization/shailendra-nv

Conversation

@shailendra-nv

Copy link
Copy Markdown
Collaborator

Summary

Restore Windows executable-path matching from #3482 on the windows branch, where that behavior is currently missing. A policy naming C:\WINDOWS\SYSTEM32\CURL.EXE now authorizes trusted runtime c:/windows/system32/curl.exe when Windows confirms case-insensitive lookup, including subsequent HTTP request checks.

This PR intentionally targets windows. The downstream Windows repository port will follow the merged upstream change.

Related Issue

Closes #5013

Changes

  • Normalize ordinary Windows separators in YAML and protobuf policies and runtime matching. Fold ASCII case only after every parent directory of the trusted runtime executable confirms case-insensitive lookup. Preserve exact case for sensitive or indeterminate directories and exact spelling for namespace paths.
  • Keep Win32 queries behind a safe API in openshell-binary-identity, preserving the network crate's prohibition on unsafe code. Never open policy-authored paths or alter the executable path used for hashing.
  • Carry matching evidence from connection authorization into the pinned HTTP evaluator and credential-grant owner selection. Preserve non-Windows matching and exclude command-line-only paths from grants.
  • Add regression tests and an MXC socket-owner scenario with deliberately changed case and separators. Update the subsystem READMEs, published policy guide, and policy-authoring skill.

Testing

  • Checks appropriate to the affected code and behavior pass
  • Unit tests added/updated
  • E2E tests added/updated

The current windows base (5d1bfbf9) has exactly the same source tree as the previously tested base. After carrying over the patch, this PR's complete tree is also identical to the tested implementation (8475b9b57a63f946970c048b1bb8584840042dee). Every changed runtime/test file was additionally compared against the source archive used on the Windows machine. Validation below was performed on that identical implementation in this work session; no runtime changes were made while retargeting the PR.

  • Native Windows ARM64: 1,517 network unit tests and 2 integration tests passed; 7 existing environment-dependent tests ignored. Coverage includes case-sensitive ancestors, failed directory queries, ancestor/glob matching, command-line denial, and inspected HTTP relay behavior.
  • macOS: affected-crate suite 1,524 unit tests and 4 integration tests passed; 7 existing environment-dependent tests ignored.
  • Native Windows Clippy passed for both affected crates using the Windows lane's existing dead-code, unused-imports, and clippy::unused-async allowances.
  • mise run pre-commit passed, including the commit hook; policy skill Markdown validation passed.
  • Native MXC E2E passed: pc_proxy_scopes_network_policy_to_socket_owner covered exact-path allow, mixed-case/slash allow, and wrong-owner deny (1 passed, 0 failed, 0 ignored). It used the freshly rebuilt supervisor with existing gateway, CLI, and Windows boundary binaries whose runtime code matches this base.
  • git diff --check passed after carrying the patch onto windows.

Full mise run ci was attempted and stopped on five unchanged VM-driver tests because the macOS host lacks mke2fs/mkfs.ext4 (e2fsprogs). The affected network suite passed separately.

Checklist

  • Follows Conventional Commits
  • Commit is signed off (DCO)
  • Subsystem documentation updated in the existing crate READMEs and published policy guide

Signed-off-by: shailendras <shailendras@nvidia.com>
(cherry picked from commit 8188a931bba467ea9f666cd4a95248efd22458d9)
Signed-off-by: shailendras <shailendras@nvidia.com>
@copy-pr-bot

copy-pr-bot Bot commented Oct 28, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-28T19:21:54.555047Z bbc7bb5 PR opened
🔒 Security Review 🔄 Running since 2026-10-28T19:19:54.809057Z bbc7bb5 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions

Copy link
Copy Markdown

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant