Uh oh!
There was an error while loading. Please reload this page.
fix(egress-enforcement-check): retry probe to tolerate standard-mode CNI reconciliation window - #276
Conversation
…CNI reconciliation window The SECURITY §8.2 egress-lockdown enforcement helm test false-failed on clusters whose CNI enforces egress NetworkPolicy in "standard" mode — notably AWS VPC CNI with NETWORK_POLICY_ENFORCING_MODE=standard, which both the dev and prod fleets use. Standard mode allows a brand-new pod all traffic until its per-pod policy reconciles (a few-second startup window); the probe curled the canary host instantly on startup, won that race, connected, and reported "EGRESS LOCKDOWN NOT ENFORCED" — even though the lockdown is enforced for real training pods, which start far slower than the window. Retry the probe until egress is observed blocked, bounded by a new networkPolicy.training.enforcementProbeTimeoutSeconds (default 60s): PASS as soon as the connect is blocked, FAIL only if the host stays reachable for the whole timeout. Correct on standard mode, strict mode, and genuinely non-enforcing clusters alike. Also refresh the stale values.yaml CNI guidance (AWS VPC CNI does enforce with enableNetworkPolicy=true) and extend helm-unittest (full suite 267 pass). Verified on dev (EKS, tb-client-dev-templates): a training-labelled pod that sleeps 30s then probes is blocked on 1.1.1.1:443 and example.com:443, and reaches the backend via the squid gateway. Refs #275, tracebloc/client-runtime#104, tracebloc/client-runtime#102. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit db87393. Configure here.
Uh oh!
There was an error while loading. Please reload this page.
…NS failure Bugbot (PR #276): the post-loop inconclusive branch keyed off only the last curl exit code. If an earlier attempt observed the host reachable (rc=0) but a later attempt failed DNS (rc=6), the hook reported "inconclusive / no TCP attempted" instead of "NOT ENFORCED" — a misdiagnosis that could send an operator chasing DNS when the CNI simply isn't enforcing egress. Latch a `reached` flag whenever a probe establishes a TCP connection (any curl exit other than 6) and branch on it after the loop: a connect seen on ANY attempt yields the definitive NOT-ENFORCED verdict; INCONCLUSIVE is reserved for the case where no TCP connection ever succeeded. helm-unittest updated. Refs #275. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Uh oh!
There was an error while loading. Please reload this page.
Readies the 1.8.1 release, which ships the egress-enforcement-check standard-mode CNI fix (#276, closes#275): the §8.2 helm-test gate now retries through the per-pod NetworkPolicy reconciliation window instead of racing it, so it no longer false-fails on AWS VPC CNI standard mode (the dev and prod fleets both use it). Validated end-to-end on dev — the patched `helm test` goes green where the previous instant-probe test failed. Refs #275. Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
saadqbal
commented
Jun 24, 2026
/fr-pass Functional review passed on dev: the patched |
…k standard-mode CNI fix) (#278) * fix(egress-enforcement-check): retry probe to tolerate standard-mode CNI reconciliation window (#276) * fix(egress-enforcement-check): retry probe to tolerate standard-mode CNI reconciliation window The SECURITY §8.2 egress-lockdown enforcement helm test false-failed on clusters whose CNI enforces egress NetworkPolicy in "standard" mode — notably AWS VPC CNI with NETWORK_POLICY_ENFORCING_MODE=standard, which both the dev and prod fleets use. Standard mode allows a brand-new pod all traffic until its per-pod policy reconciles (a few-second startup window); the probe curled the canary host instantly on startup, won that race, connected, and reported "EGRESS LOCKDOWN NOT ENFORCED" — even though the lockdown is enforced for real training pods, which start far slower than the window. Retry the probe until egress is observed blocked, bounded by a new networkPolicy.training.enforcementProbeTimeoutSeconds (default 60s): PASS as soon as the connect is blocked, FAIL only if the host stays reachable for the whole timeout. Correct on standard mode, strict mode, and genuinely non-enforcing clusters alike. Also refresh the stale values.yaml CNI guidance (AWS VPC CNI does enforce with enableNetworkPolicy=true) and extend helm-unittest (full suite 267 pass). Verified on dev (EKS, tb-client-dev-templates): a training-labelled pod that sleeps 30s then probes is blocked on 1.1.1.1:443 and example.com:443, and reaches the backend via the squid gateway. Refs #275, tracebloc/client-runtime#104, tracebloc/client-runtime#102. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * fix(egress-enforcement-check): NOT-ENFORCED verdict outranks a late DNS failure Bugbot (PR #276): the post-loop inconclusive branch keyed off only the last curl exit code. If an earlier attempt observed the host reachable (rc=0) but a later attempt failed DNS (rc=6), the hook reported "inconclusive / no TCP attempted" instead of "NOT ENFORCED" — a misdiagnosis that could send an operator chasing DNS when the CNI simply isn't enforcing egress. Latch a `reached` flag whenever a probe establishes a TCP connection (any curl exit other than 6) and branch on it after the loop: a connect seen on ANY attempt yields the definitive NOT-ENFORCED verdict; INCONCLUSIVE is reserved for the case where no TCP connection ever succeeded. helm-unittest updated. Refs #275. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com> * chore(chart): bump client 1.8.0 → 1.8.1 (version + appVersion) (#277) Readies the 1.8.1 release, which ships the egress-enforcement-check standard-mode CNI fix (#276, closes#275): the §8.2 helm-test gate now retries through the per-pod NetworkPolicy reconciliation window instead of racing it, so it no longer false-fails on AWS VPC CNI standard mode (the dev and prod fleets both use it). Validated end-to-end on dev — the patched `helm test` goes green where the previous instant-probe test failed. Refs #275. Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>

What
Fixes the SECURITY §8.2 egress-lockdown enforcement
helm test(egress-enforcement-check) false-negative on standard-mode CNI clusters — notably AWS VPC CNI withNETWORK_POLICY_ENFORCING_MODE=standard.Closes#275. Follow-up to tracebloc/client-runtime#104; unblocks the per-fleet rollout gate for tracebloc/client-runtime#102.
Why
standardmode allows a brand-new pod all traffic until its per-pod policy reconciles (a few-second startup window). The probecurled the canary host immediately on startup, won that race, connected, and reportedEGRESS LOCKDOWN NOT ENFORCED— even though the lockdown is enforced for real training pods (which start far slower than the window). Both dev (tb-client-dev-templates) and prod (tracebloc-clients-prod) run AWS VPC CNI instandardmode, so as-is the gate would false-fail on every fleet and could mislead an operator into thinking the lockdown is broken.Change
networkPolicy.training.enforcementProbeTimeoutSeconds(default 60s); FAILs only if the host stays reachable for the whole timeout. Correct on standard mode, strict mode, and genuinely non-enforcing clusters alike.values.yamlCNI guidance: AWS VPC CNI does enforce withenableNetworkPolicy=true(the prior comment claimed it doesn't).Verified on dev (EKS, 2026-06-24)
Applied the lockdown on
tb-client-dev-templatesand probed from atracebloc.io/workload=trainingpod:helm test(old single-shot behaviour) → Failed (probe connected on startup).1.1.1.1:443andexample.com:443blocked (curl exit 28); backend reachable via the squid gateway (exit 0).So the lockdown works for real pods; only the instant probe raced it. Dev was rolled back to its original state after verification.
Not in scope
standardmode's startup window is itself a narrow egress gap for untrusted pod code;strictmode closes it but is a cluster-wide change — tracked separately as a §8.2 threat-model decision.🤖 Generated with Claude Code
Note
Low Risk
Changes only the helm test hook script, values docs, and chart tests; no runtime training or NetworkPolicy behavior is modified.
Overview
Fixes false FAIL results on the §8.2 egress-lockdown
helm testwhen the CNI enforces policy only after a short per-pod reconcile (e.g. AWS VPC CNIstandardmode).The
egress-enforcement-checkprobe no longer curls once at startup. It loops (3s between attempts) until curl sees blocked egress (exit 7/28) → PASS, or untilnetworkPolicy.training.enforcementProbeTimeoutSeconds(default 60s) expires while the host stayed reachable → FAIL. Areachedlatch records any successful TCP connect so a later DNS failure cannot flip a real non-enforcement case to “inconclusive.”values.yamldocuments the new timeout, updates EKS guidance (VPC CNI can enforce withenableNetworkPolicy=true), and refreshes failure-message hints. Helm unittest adds coverage for the retry loop, timeout wiring, and the 60s default.Reviewed by Cursor Bugbot for commit 5ba4646. Bugbot is set up for automated code reviews on this repo. Configure here.