Uh oh!
There was an error while loading. Please reload this page.
fix(egress-proxy): probe reports DNS failure distinctly, not as a TCP connect [#104] - #256
Merged
Merged
Conversation
…connect succeeded" [#104] Bugbot (PR #254): the non-enforcement WARNING ("...reached :443 ... the TCP connect succeeded") was emitted for every non-{7,28} curl exit code, including exit 6 (DNS resolution failure) where no TCP connection was ever attempted — so the failure output could contradict what actually happened and mislead troubleshooting. Split the verdict into a case: 7|28 => TCP never established => egress blocked (pass, exit 0) 6 => INCONCLUSIVE: could not resolve host, no TCP attempted => fail (exit 1) with an accurate message (never claim "enforced" on a DNS failure) else (0, or TLS-/HTTP-layer errors 35/52/56/60 that all require a completed TCP connect) => host reached => NOT enforced (exit 1) Default probe host is an IP, so exit 6 only arises for a hostname probe on a cluster with broken DNS. helm-unittest 248/248; lint clean. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
LukasWodka
commented
Jun 15, 2026
Contributor
👋 Heads-up — Code review queue is at 14 / 8 Above the WIP limit. The team convention is to review existing PRs before opening new work. Open PRs currently in Code review (oldest first):
Pull from review before opening new work. (This is a nudge from the kanban WIP check, not a block.) |
This was referenced Jun 15, 2026
Merged
aptracebloc
approved these changes
Jun 15, 2026
Uh oh!
There was an error while loading. Please reload this page.
saadqbal added a commit
that referenced
this pull request
Jun 15, 2026
…light helm test, inert) (#254) * test(charts): add helm-unittest suite for mysql-storage-pvc template (#250) The mysql-storage-pvc template (PVC + bare-metal hostPath PV backing the per-cluster MySQL state store) had no dedicated suite. Add one covering: - dynamic-PVC-only path (hostPath.enabled=false, managed default) - hostPath PV+PVC pair, claimRef binding, fixed release-scoped path - the helm.sh/resource-policy:keep annotation protecting the state store - access-mode defaulting, pvc size, and storageClass wiring Tests-only; no source/template/values changes. Security invariants unchanged. Co-authored-by: Claude <noreply@anthropic.com> * test(charts): add helm-unittest suite for logs-pvc template (#251) The logs-pvc template (PV + PVC for client logs) had no dedicated helm-unittest suite. Adds tests/logs_pvc_test.yaml covering the dynamic-provisioning PVC path and the hostPath PV+PVC path. Co-authored-by: Claude <noreply@anthropic.com> * Merge pull request #253 from tracebloc/feat/104-egress-enforcement-check feat(egress-proxy): deploy-time egress-enforcement pre-flight (non-blocking) [client-runtime#104] * fix(egress-proxy): enforcement check probes TCP reachability, not HTTP code [#104] (#255) Bugbot (PR #254): the check treated curl HTTP code 000 as proof of a block, but a TCP connection that succeeds (egress OPEN) then fails TLS verification also yields 000 — so `helm test` could pass on a non-enforcing CNI when probing an IP whose cert doesn't validate (the default 1.1.1.1 without -k). It conflated "TLS failed" with "egress blocked", defeating the check. Key the verdict off TCP reachability via curl's exit code instead of the HTTP status, and add -k so TLS is explicitly irrelevant: exit 28 (timeout) / 7 (connect failed) => egress blocked => test PASSES (exit 0); any other outcome (0 success, or a TLS-/HTTP-layer error such as 35/52/60 — all of which require the TCP connect to have already succeeded) => egress reached => NOT enforced => test FAILS (exit 1). Tests assert the verdict keys on the exit code (rc=$?, -k) and guard against a regression to the old http_code/000 logic. helm-unittest 248/248; lint clean. Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com> * fix(egress-proxy): probe reports DNS failure distinctly, not as "TCP connect succeeded" [#104] (#256) Bugbot (PR #254): the non-enforcement WARNING ("...reached :443 ... the TCP connect succeeded") was emitted for every non-{7,28} curl exit code, including exit 6 (DNS resolution failure) where no TCP connection was ever attempted — so the failure output could contradict what actually happened and mislead troubleshooting. Split the verdict into a case: 7|28 => TCP never established => egress blocked (pass, exit 0) 6 => INCONCLUSIVE: could not resolve host, no TCP attempted => fail (exit 1) with an accurate message (never claim "enforced" on a DNS failure) else (0, or TLS-/HTTP-layer errors 35/52/56/60 that all require a completed TCP connect) => host reached => NOT enforced (exit 1) Default probe host is an IP, so exit 6 only arises for a hostname probe on a cluster with broken DNS. helm-unittest 248/248; lint clean. Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com> --------- Co-authored-by: Claude <noreply@anthropic.com>
2 tasks
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 freeto 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.
Bugbot follow-up on the v1.7.1 release PR #254 (rolls under the §8.2 egress epic, client-runtime#104). Low severity, message-accuracy. Chart-only.
Bug
The non-enforcement
WARNINGblock (…reached ${HOST}:443 directly (curl exit $rc; the TCP connect succeeded)) was printed for every curl exit code outside{7,28}— including exit 6 (DNS resolution failure), where no TCP connection was ever attempted. The output could flatly contradict what happened and mislead troubleshooting.Fix
Split the verdict into a
case:7/28OK, exit 0 (pass)60, or TLS/HTTP-layer35/52/56/60— all require a completed TCP connect)Exit 6 fails rather than passing, so a broken-DNS cluster never masquerades as "enforced." The default probe host is an IP (
1.1.1.1), so exit 6 only arises for a hostname probe on a cluster with broken DNS.Tests
helm unittest248/248, lint clean. The suite now also asserts the script reports the DNS case distinctly (could not resolve host).🤖 Generated with Claude Code
Note
Low Risk
Chart-only messaging and probe branching for the §8.2 helm test hook; no runtime auth or data-path changes.
Overview
The egress enforcement
helm testprobe no longer treats curl exit 6 (DNS resolution failure) like a successful TCP connect to the canary host.Verdict logic moves from a simple
{7,28}check to acaseon exit code:7/28still mean blocked (pass);6is inconclusive — it prints a dedicated “could not resolve host” warning, advises using an external IP (e.g.1.1.1.1) or fixing DNS, and fails the test so broken DNS cannot look like enforcement. All other codes still imply the TCP handshake succeeded and trigger the existing “lockdown not enforced” failure path. Inline comments document the three buckets.Helm unittest now asserts the rendered script includes
could not resolve hostfor the DNS branch.Reviewed by Cursor Bugbot for commit 8c1005c. Bugbot is set up for automated code reviews on this repo. Configure here.