fix(supervisor-network): L7 endpoint validation edge cases - #2464
fix(supervisor-network): L7 endpoint validation edge cases#2464andrewwhitecdw wants to merge 1 commit into
Conversation
|
I have read the DCO document and I hereby sign the DCO. |
johntmyers
left a comment
There was a problem hiding this comment.
gator-agent
PR Review Status
Validation: This is project-valid small, concentrated work in supervisor network-policy handling: it replaces a malformed-input panic with fail-closed validation and attempts to make zero-port handling consistent. No duplicate work was found.
Head SHA: 583f62ef7019a4c54b23fe91e6ef289c2ca02d4a
Review findings:
- One correctness issue is anchored inline: the raw-policy zero-port filter does not normalize the policy data later supplied to OPA, so mixed arrays still retain zero.
- Focused regression coverage is missing for all three changed contracts. Please add unit tests showing that a non-object endpoint reports the expected validation error and preset expansion remains panic-free; raw-policy
[0]and[0, 443]follow the intended contract; and agent proposals reject an all-zero array while retaining only positive entries from mixed arrays, including scalar fallback.
Docs: Fern docs are not needed for this malformed-input robustness fix; the existing policy reference already describes endpoint objects and concrete MCP ports.
E2E: The changed network-policy path requires test:e2e after review findings are resolved.
Next state: gator:in-review pending an author update.
|
@andrewwhitecdw Several of your PRs are awaiting feedback, please let us know if you plan on looking so we can plan accordingly |
…ion tests Addresses gator-agent review feedback on NVIDIA#2464: - Filter zero values from endpoint ports arrays in normalize_endpoint_ports so OPA never sees a zero port. - Promote positive scalar port to ports array; leave all-zero arrays empty. - Skip non-object endpoints during normalization instead of panicking. - Add regression tests for non-object endpoint validation, zero-port filtering, and scalar fallback. Signed-off-by: Andrew White <andrewh@cdw.com>
johntmyers
left a comment
There was a problem hiding this comment.
gator-agent
PR Review Status
Validation: This remains project-valid small, concentrated robustness work in supervisor network-policy handling.
Head SHA: 200ecd2f0444b5ef60d33c2332990c546e521dc5
Thanks @andrewwhitecdw. I checked the update you pushed after the earlier zero-port normalization and test feedback. The raw-YAML mixed-array case is now normalized and the added helper tests cover that path, but the production proto load/reload path still bypasses the new normalizer.
Review findings:
- One critical correctness/security-boundary issue is anchored inline: zero ports still reach OPA through
OpaEngine::from_proto. - One warning is anchored inline: the separate agent-proposal parser behavior still needs focused regression coverage.
Docs: Fern docs are not needed because this hardens malformed input without changing supported policy syntax or commands.
E2E: The network-policy path still requires test:e2e after review findings are resolved.
Next state: gator:in-review pending an author update.
|
Thanks for the nudge — I’ve gone through all five open PRs:
All relevant test suites pass. Please re-review when you have a chance. |
|
Both review items addressed:
Verified: |
johntmyers
left a comment
There was a problem hiding this comment.
gator-agent
PR Review Status
Validation: This remains project-valid small, concentrated robustness work in supervisor network-policy handling.
Head SHA: ed4a4b63649a5857e2405a8f72bbb62f99a93282
Thanks @andrewwhitecdw. I checked your update about filtering zero ports in the production proto-to-OPA path and adding focused proposal-parser coverage. Those prior gaps are addressed, but the independent review found two remaining normalization cases that can reinterpret malformed or zero-only authorization input as a scalar-port allow; both are anchored inline. A focused preset-expansion regression gap is also anchored inline.
Review findings:
- Two blocking CWE-20 warnings are anchored inline: malformed JSON array elements can be discarded before scalar fallback, and zero-only proto arrays can activate a shadowed scalar despite documented
portsprecedence. - One focused test gap is anchored inline for the removed
expand_access_presetsunwraps.
Docs: Fern docs are not needed for the intended malformed-input robustness fix. If scalar fallback for an explicitly present zero-only ports array is intentional, the schema and proto precedence contract would need updating.
E2E: The network-policy path still requires test:e2e after review findings are resolved.
Next state: gator:in-review pending an author update.
Author Follow-Up NudgeThis PR has been in @andrewwhitecdw, please respond to the two blocking review comments about malformed array elements and zero-only proto-array precedence, or push an update. If this is no longer planned, please say so and a maintainer can close it out. |
1 similar comment
Author Follow-Up NudgeThis PR has been in @andrewwhitecdw, please respond to the two blocking review comments about malformed array elements and zero-only proto-array precedence, or push an update. If this is no longer planned, please say so and a maintainer can close it out. |
96d1085 to
805f189
Compare
|
/ok to test 805f189 |
johntmyers
left a comment
There was a problem hiding this comment.
gator-agent
PR Review Status
Validation: This remains project-valid small, concentrated robustness work in supervisor network-policy handling.
Head SHA: 805f189c9a35f241bcbf3395bbd0cea1bfaa5d7a
Base SHA: 0c7e59a95355cabc15ccaddb86fcbe6a1d30eaaa
Merge base SHA: 21da343c9f838bd9ac85dc61bf44889de1a72873
Patch ID: d8044cf19d18d7dd4ad2547d4467f81feea7a843
Gator payload: 3
Review mode: follow_up
Previous reviewed SHA: ed4a4b63649a5857e2405a8f72bbb62f99a93282
Thanks @andrewwhitecdw. I checked the update pushed after the malformed-array and zero-only proto-array feedback. The raw-policy normalizer now preserves malformed non-numeric entries for fail-closed validation, the proto conversion preserves explicit ports precedence, and focused regression coverage now exercises both cases plus preset expansion with a non-object endpoint.
Blocking findings:
- No blocking findings remain.
Carried findings:
gator-inline-3679152284: resolved by preserving non-numeric array entries through normalization.gator-inline-3679152285: resolved by branching on whether the original protoportsarray is present.
Docs: Fern docs are not needed because this hardens malformed input without changing supported policy syntax or user workflows.
E2E: test:e2e is applied. The mirror was absent, so an authorized maintainer command /ok to test 805f189c9a35f241bcbf3395bbd0cea1bfaa5d7a was posted.
Next state: gator:watch-pipeline
|
Label |
|
/ok to test 805f189 |
|
Pushed an additional fix (7d2795a) for the YAML-normalization path in
The previously-flaky |
johntmyers
left a comment
There was a problem hiding this comment.
gator-agent
PR Review Status
Validation: This remains project-valid small, concentrated robustness work in supervisor network-policy handling.
Head SHA: 7d2795a07ebfff47d7d3385d7d73149bfe83c5c7
Base SHA: d85339d621e0e96697499a9d4c8780ee9b9c1324
Merge base SHA: 21da343c9f838bd9ac85dc61bf44889de1a72873
Patch ID: 1b46948db13a9f420d22f80cc84f0e36b8af8828
Gator payload: 3
Review mode: follow_up
Previous reviewed SHA: 805f189c9a35f241bcbf3395bbd0cea1bfaa5d7a
Thanks @andrewwhitecdw. I checked your update making an explicitly present YAML ports array take precedence over scalar port. The focused delta now matches the proto serialization path, preserves fail-closed handling for a zero-only array, and does not invalidate the prior review resolutions.
Blocking findings:
- No blocking findings remain.
Carried findings:
gator-inline-3679152284: remains resolved; malformed non-numeric entries are preserved for fail-closed validation.gator-inline-3679152285: remains resolved; both YAML and proto paths now preserve explicitportsprecedence.
Docs: Fern docs are not needed because this hardens malformed input without changing supported policy syntax or user workflows.
E2E: test:e2e is applied. The current head requires authorized test execution.
Next state: gator:watch-pipeline
|
/ok to test 7d2795a |
Author Follow-Up NudgeThis PR has been in @andrewwhitecdw, please fix the Clippy |
Review Convergence CheckpointHead SHA: Three finding-bearing review rounds have completed. Thanks @andrewwhitecdw. I checked your latest update replacing the Clippy-rejected boolean expression at Root-cause findings:
Scope growth:
Reviewer-quality signals:
Maintainer action: accept the current scope, split follow-up work, waive a finding, or explicitly authorize another autonomous review round. Given the resolved obligations and no new Critical finding, accepting the current scope will allow gator to resume pipeline monitoring. Next state: |
|
/ok to test 3f45123 |
3f45123 to
e71e6af
Compare
…ion tests Addresses gator-agent review feedback on NVIDIA#2464: - Filter zero values from endpoint ports arrays in normalize_endpoint_ports so OPA never sees a zero port. - Promote positive scalar port to ports array; leave all-zero arrays empty. - Skip non-object endpoints during normalization instead of panicking. - Add regression tests for non-object endpoint validation, zero-port filtering, and scalar fallback. Signed-off-by: Andrew White <andrewh@cdw.com>
|
/ok to test e71e6af |
Review Convergence CheckpointHead SHA: Three finding-bearing review rounds have completed. Thanks @andrewwhitecdw. I checked the force-rebased current head and the final Clippy-motivated boolean rewrite. The author-series range-diff preserves the six previously reviewed commits, the current patch ID matches the prior checkpoint patch, and the bounded checkpoint reviewer found no newly introduced Critical defect. Root-cause findings:
Scope growth:
Reviewer-quality signals:
CI:
Maintainer action: accept the current scope, split follow-up work, waive a finding, or explicitly authorize another autonomous review round. Given the resolved obligations and no new Critical finding, accepting the current scope will allow gator to resume pipeline monitoring. Next state: |
Merge Decision NudgeThis PR has been in @NVIDIA/openshell-maintainers @NVIDIA/openshell-codeowners @mrunalp @maxamillion @derekwaynecarr, can someone merge this PR or close/request changes if it should not proceed? |
|
Closing this sweep-generated PR: PR has 7 commits; sweep requires exactly one commit per PR. It does not meet the sweep requirements (single signed-off commit). |
Monitoring CompleteHead SHA: Monitoring is complete because this PR has been closed without merge. Final status: The durable finding ledger records all review findings addressed or non-blocking, no remediation scope growth, and no newly introduced Critical defect. Required Branch Checks, Helm Lint, and E2E status contexts were green, and maintainer approval was present. The author closed the PR because the sweep requires exactly one signed-off commit and this PR contains seven commits. I removed the active |
…orts validate_l7_policies assumed every endpoint entry was a JSON object and used ep.as_object_mut().unwrap() in expand_access_presets. A non-object endpoint would panic. Add an object-shape validation error and replace the unwraps with safe pattern matching. Also filter zero values out of the ports array to match the scalar port validation (which already rejects port == 0). Signed-off-by: Andrew White <andrewh@cdw.com> Signed-off-by: andrewwhitecdw <andrewwhitecdw@users.noreply.github.com>
e71e6af to
a3d00b9
Compare
Summary
Two small robustness fixes in L7 network policy handling:
validate_l7_policiesassumed every entry innetwork_policies.<name>.endpointswas a JSON object, andexpand_access_presetscalledep.as_object_mut().unwrap(). A malformed non-object endpoint caused a panic. This change adds an object-shape validation error and replaces the unwraps with safe pattern matching.portfield was already validated to be> 0, but theportsarray accepted0values silently. The same inconsistency existed in the agent-proposal endpoint parser. Both paths now filter out zero ports.Related Issue
N/A — small fixes found during code review.
Changes
l7/mod.rs: validate endpoint is an object; replaceas_object_mut().unwrap()with safe matching; filterportsarray to> 0policy_local.rs: filter zero entries fromendpoint.portsTesting
mise run pre-commitpasses (mise unavailable in this environment; ran equivalentcargo fmt+cargo clippy -p openshell-supervisor-network --all-targets— clean)cargo test -p openshell-supervisor-network --lib— 969 passed)Checklist