test(netpol): characterize the locked-down egress policy (RFC-0003 D6, #199-1) - #537
Merged
Merged
Conversation
…#199-1) Test-only, no behavior change — the regression net for the egress-lockdown default flip (#199-2). The egress mechanism is fully shipped (client-runtime#102 / #378); #199 is just flipping allowExternalHttps to false by default, which drops the rule-2 external-HTTPS hole and shifts the remaining egress indices. - Pin allowExternalHttps: true in the three cases that assert the rule-2 hole or the MySQL rule at a rule-2-dependent index (external-443, MySQL, OpenShift), so they keep passing once the default flips. - Add two locked-down cases (allowExternalHttps: false): the 0.0.0.0/0 rule is gone (MySQL shifts to egress[1]), the UNCONDITIONAL requests-proxy egress (8888) survives so pods can still POST results/FLOPs, and the egress-proxy allowlist rule (3128) renders when egressProxy.enabled. 13 network-policy tests (was 11), 322 helm suite green. Lands first so #199-2 is a green-to-green flip. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Contributor
Author
|
bugbot run |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 31325bd. Configure here.
saqlainsyed007
approved these changes
Aug 3, 2026
saqlainsyed007
left a comment
Contributor
There was a problem hiding this comment.
Review summary — APPROVE ✅
Test-only PR (#199-1); the regression net so the allowExternalHttps default flip (#199-2) is a green-to-green change. Verified locally.
What I checked
- Ran
helm unittest client -f tests/network_policy_test.yaml→ 13 passed. - Walked the render order in
templates/network-policy-training.yaml:DNS(0) → external-HTTPS(1, gated on allowExternalHttps) → MySQL → requests-proxy → egress-proxy(gated on egressProxy.enabled).allowExternalHttps: false⇒ MySQL →egress[1], requests-proxy →egress[2]✓+ egressProxy.enabled⇒ egress-proxy →egress[3], port 3128 ✓
- The three
allowExternalHttps: truepins land on exactly the rule-2-dependent cases (external-443, MySQL@egress[2], OpenShift except-block@egress[1]); comments are accurate.
Assessment
- Correctness: assertions match the template exactly.
- Conventions: matches the existing suite's style; comments explain why each pin exists — good for the next reader hitting the index shift.
- No template/runtime change, so risk is confined to CI. Nothing blocking.
One non-blocking robustness nit inline.
LukasWodka
added a commit
that referenced
this pull request
Aug 3, 2026
Add direct `lengthEqual` assertions on spec.egress for the two locked-down cases so a stray appended rule is caught, not just an index shift. Correction vs the review suggestion: the locked-down case is 4 rules, not 3. `egressProxy.enabled` DEFAULTS TRUE (values.yaml — only `routeWorkloads` defaults false), so the egress-proxy permit rule renders even when the case doesn't set it: DNS + MySQL + requests-proxy + egress-proxy. Both locked-down cases assert count 4. Fast-follow to the #537 review (non-blocking nit, deferred at merge). Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Contributor
Author
|
/fr-pass |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
#199, PR 1 of the egress-lockdown work — test-only, no behavior change. It's the regression net so the actual default flip (#199-2) is a green-to-green change.
The egress mechanism is already fully shipped (squid gateway, the
allowExternalHttpsgate, jobs-manager proxy injection, the seal-check enforcement probe — client-runtime#102 / client#378). #199 is just making deny-by-default the shipped default. FlippingallowExternalHttpstofalsedrops the rule-2 external-HTTPS hole, so the egress rule indices shift.This PR pins the current behavior and characterizes the locked-down state:
allowExternalHttps: truein the three cases that assert the rule-2 hole or a rule-2-dependent index (external-443, MySQL, OpenShift) — so they survive the flip.allowExternalHttps: false): the0.0.0.0/0rule is gone (MySQL shiftsegress[2] → egress[1]); the unconditional requests-proxy egress (8888) survives so pods still POST results/FLOPs; the egress-proxy allowlist rule (3128) renders underegressProxy.enabled.Tests
13 network-policy tests (was 11), 322 helm suite green.
Track: #199 — PR-1 (tests) lands anytime · PR-2 (the 4-line flip) is gated on the dev→staging→prod fleet pin-rollout. Epic: backend#1151 (D6).
🤖 Generated with Claude Code
Note
Low Risk
Only Helm unit tests in
network_policy_test.yaml; no template or runtime behavior changes.Overview
Test-only prep for RFC-0003 D6 / #199: no chart behavior changes; this is the regression net before
allowExternalHttpsdefaults tofalsein a follow-up PR.Existing network-policy cases that assert the rule-2 external HTTPS hole (
0.0.0.0/0ategress[1]) or rules that sit after it (MySQL ategress[2], OpenShift except blocks) now explicitly setallowExternalHttps: trueso they stay valid when the default changes.Two new cases with
allowExternalHttps: falsedocument the locked-down shape: the broad external-443 rule is absent (MySQL moves toegress[1]), requests-proxy on 8888 remains, and withegressProxy.enabledthe egress-proxy rule on 3128 appears ategress[3].Reviewed by Cursor Bugbot for commit 31325bd. Bugbot is set up for automated code reviews on this repo. Configure here.