Skip to content

fix(ocsf): attribute MXC proxy events to sandboxes - #3434

Open
prekshivyas wants to merge 1 commit into
NVIDIA:windowsfrom
prekshivyas:6783086-attribute-network-ocsf/pv
Open

prekshivyas wants to merge 1 commit into
NVIDIA:windowsfrom
prekshivyas:6783086-attribute-network-ocsf/pv

Conversation

@prekshivyas

Copy link
Copy Markdown
Contributor

Summary

Give every Windows MXC host proxy its own immutable OCSF event context so denied HTTP/network events retain the sandbox ID and name when one gateway hosts multiple sandboxes. This removes the incorrect dependency on the process-global fallback context for top-level CONNECT and forward-proxy decisions.

Related Issue

NVBug 6783086 (internal)

Changes

  • build and validate a per-sandbox EventContext from HostProxyConfig
  • attach that context to the static Windows proxy identity and use it for proxy lifecycle, CONNECT, and forward allow/deny/error events
  • add a regression test that interleaves two sandbox contexts and validates both class-4002 events against the OCSF schema
  • document the multi-sandbox concurrency invariant
  • align Windows host-proxy startup with the current endpoint-observation argument on the windows branch

Testing

  • mise run pre-commit passes — blocked on Windows ARM64 because grpcio-tools 1.78.0 invokes MSVC with incompatible /std:c++17 and /std:c11 flags; attempted with the repository Python 3.14 and an isolated Python 3.13 environment
  • Unit tests added/updated
  • E2E tests added/updated (N/A: audit-context plumbing only; no E2E surface changed)
  • cargo check -p openshell-supervisor-network --lib
  • focused cargo clippy -p openshell-supervisor-network --all-targets --no-deps --target aarch64-pc-windows-msvc
  • changed-path OCSF, host-context, host-authentication, and compatibility tests
  • cargo test -p openshell-supervisor-network — 1,230 passed, 2 ignored, and 3 pre-existing Windows failures caused by an unescaped executable path in an MCP YAML fixture

Checklist

  • Follows Conventional Commits
  • Commits are signed off (DCO)
  • Architecture docs updated (if applicable)

Scope note

This PR fixes container.uid and container.name attribution. The static Windows proxy identity still has no trustworthy per-process PID, so the existing actor PID behavior is unchanged.

NVBug 6783086

Signed-off-by: Prekshi Vyas <prekshiv@nvidia.com>
@prekshivyas
prekshivyas force-pushed the 6783086-attribute-network-ocsf/pv branch from 8169e22 to ed94456 Compare September 17, 2026 22:03
@prekshivyas

Copy link
Copy Markdown
Contributor Author

Live Windows ARM64 MXC qualification completed against the current windows content (PR #3468) and this PR.

  • Baseline: qualified fix(windows): restore MXC qualification and cold-start readiness #3468 artifact at acd2a5721 reproduced NVBug 6783086. A denied GET http://microsoft.com/ emitted one class-4002 event with destination microsoft.com:80 and status_detail = "network connections not allowed by policy", but container.uid and container.name were empty (actor PID remained 0).
  • Fixed: ARM64 release build of fix(windows): restore MXC qualification and cold-start readiness #3468 + ed94456aa succeeded. Repeating the identical request emitted one class-4002 denial with container.uid = cd47baeb-e748-4263-9b79-04cb0f6d5b0f and container.name = n678-s-f-e43944f5, exactly matching the created sandbox. Destination, denial reason, and wire behavior were unchanged.
  • Current upstream/windows is fb2980e07; git merge-tree --write-tree upstream/windows ed94456aa succeeds without conflict and yields the same tested combined tree 565d4d988613cb79bcda5c3d7859218156ba0652.
  • Cleanup verified: the two temporary gateways/sandboxes and CLI registrations were removed; the pre-existing gateway was left untouched.

This live run confirms both the original failure and the fix. The unchanged actor PID 0 behavior remains outside this PR's scope, as noted in the description.

@prekshivyas

Copy link
Copy Markdown
Contributor Author

Qualification before/after summary

NVBug: 6783086 — MXC proxy OCSF events can be attributed to the wrong sandbox

Before: Host-proxy audit decisions depended on process-global fallback context. With multiple sandboxes under one gateway, denied CONNECT/forward-proxy events could lose or misattribute sandbox ID/name.

After: Each Windows MXC host proxy carries an immutable per-sandbox EventContext. The regression test interleaves two sandbox contexts and validates both class-4002 events against the OCSF schema. Focused check/Clippy and changed-path OCSF, authentication, context, and compatibility tests passed. The broader crate run reached 1,230 passed and 2 ignored, with 3 pre-existing Windows MCP-fixture path failures.

Qualification status: Focused scenario PASS; full current-tip qualification pending. Rebase onto the current windows tip, repair the shared mise.lock gate, run hosted CI, and include this runtime proxy change in the combined two-cycle qualification with #3472.

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