Repository navigation
fix: route captured network decisions through Tessera - #1419
Richie Gomez (richiemsft) wants to merge 3 commits into
Conversation
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
ff0d00b to
d66c3b4
Compare
33bf935 to
731c328
Compare
Gudge (MGudgin)
left a comment
There was a problem hiding this comment.
Verified review notes
The substantive issue is treating the normalized network_egress Option as evidence that a caller explicitly requested egress; the second comment asks for a negative control on the separate no-capture guard. This is a comment-only review, not a change request.
Verified clean: GitHub's patch matches the local delta. The new tests preserve the proxy posture and prove that the default-deny egress table is still serialized. ensure_capability avoids duplicate capability strings. The runner gains only two new tests (48 to 50); neither covers a parsed request with absent or ingress-only network policy. I did not reproduce a brokered-DNS/Tessera bypass on a PSEC host and am not asserting one.
Verified pre-existing — not attributed to this PR
src/mxc-sdk/src/core/mxc_common/network_parser.rs:159-175 is byte-identical at base and head. Its normalization of absent egress to Some(default) is not itself charged to this PR; the new gate's reliance on presence is the introduced defect. The existing egress-rule serializer and guarded AppContainer capability helper are also unchanged and are not being treated as regressions.
| .collect(); | ||
| add_default_network_capabilities(policy, &mut capabilities); | ||
| if policy.capture_denials.is_some() | ||
| && policy.network_egress.is_some() |
There was a problem hiding this comment.
Medium (correctness) — Normalized Some does not mean explicitly requested egress.
Attribution: introduced_by_change — this new gate tests network_egress.is_some(), but parse_network_policy fills network_egress = Some(NetworkEgressPolicy::default()) when network is absent and also when a supplied network section omits egress.
Consequently, parsed direct captureDenials requests with no network section or with ingress only can gain internetClient even though the PR promises synthesis only for direct directional egress requests. The PSEC default egress table still denies traffic; this is a capability-posture and denial-observation change, not proof of an egress bypass. Fix: Preserve explicit egress-section presence through normalization and use that signal here; add parse-to-PSEC tests for absent network, ingress-only and explicitly authored egress.
| .cloned() | ||
| .collect(); | ||
| add_default_network_capabilities(policy, &mut capabilities); | ||
| if policy.capture_denials.is_some() |
There was a problem hiding this comment.
Medium (test coverage) — Pin the no-capture side of this privilege gate.
Attribution: introduced_by_change — both added tests have capture_denials = Some(...). Existing shared-helper tests do not run through this new effective_capabilities branch. If this capture_denials.is_some() guard were removed, ordinary default-deny ProcessContainer requests could gain internetClient without failing a PSEC-builder test.
Fix: Build a PSEC spec with capture_denials = None and directional egress.default = deny; assert that it has no internetClient and still serializes deny-default egress. The parse-to-PSEC matrix in the other comment should cover the positive and negative cases together.
d66c3b4 to
b3f6785
Compare
731c328 to
cd9e80a
Compare
b3f6785 to
31a0195
Compare
cdbd9d6 to
82dce5d
Compare
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: e408b60b-e267-416c-806d-0a7e119fe53f
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: e408b60b-e267-416c-806d-0a7e119fe53f
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: e408b60b-e267-416c-806d-0a7e119fe53f
05c16d0 to
183a905
Compare
82dce5d to
72c85b5
Compare
📖 Description
Routes direct ProcessContainer denial-capture traffic through Tessera so WFP Learning Mode can observe the policy decision without weakening enforcement.
internetClientonly for direct directionalcaptureDenialsrequests.This is PR 3 of 4 in the WFP Learning Mode stack. Its base is the decoder-layer branch.
🔗 References
Related to #1286.
Depends on the preceding decoder PR in this stack.
🔍 Validation
cargo test -p mxc-sdk --lib 'capture_denials_'— 25 passed.cargo test -p mxc-sdk --lib 'network_policy_helpers::tests::'— 5 passed.✅ Checklist
Cargo.lock, thedependency-feed-checkcheck passes (not applicable)📋 Issue Type
🧱 Stack
Review and merge in this order.
Microsoft Reviewers: Open in CodeFlow