feat: real DNS egress test + AI domain tunnel probe#3
Open
kevinchen797 wants to merge 2 commits into
Open
Conversation
Replace the static resolver-IP-vs-country-table DNS check with an actual egress test, and split the verdict into Claude-specific vs general-env risk. - Real DNS leak test (bash.ws randomized subdomains): measures the resolver IPs/countries that actually perform resolution, on the direct (OS) and proxy paths separately; auto-retries on failure/timeout. - AI domain tunnel probe: resolves 10 mainstream foreign AI domains and checks whether the resolved IP is reachable through the proxy tunnel (routing signal that complements DNS egress; also surfaces DNS poisoning when a polluted IP is unreachable). - Two-part conclusion: "Claude 专用风险" (IPv6 / exit-IP reputation / tz / Claude core-domain reachability) vs "通用环境风险" (general DNS egress / other AI domains). Avoids false "Claude high-risk" from a generic DNS leak. - KNOWN_DNS static table demoted to labeling + fallback when leak test is off. - --no-leak / --fast to skip network-heavy tests. - Add CHANGELOG.md. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The new DNS-egress / probe rows can produce values longer than the value column (long ASN org names), which pushed the right border out and broke the box alignment. - Add display-width-aware clip() that truncates to the column width, preserving ANSI color codes and appending an ellipsis. - Apply it in tbl_row so any value (current or future) stays within the box. - Shorten the over-long DNS-consistency verdict (drop country enumeration). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
Motivation
The current DNS check reads the machine's configured resolver IPs and matches them against a hardcoded public-DNS country table (
KNOWN_DNS). On setups that use fake-ip + per-domain DoH (common with modern proxy clients), this:223.5.5.5is flagged as a leak even though it never participates in actual resolution, andIn other words it tests configuration, not where DNS actually egresses.
What this adds
Claude 专用风险(IPv6 / exit-IP reputation / timezone / Claude core-domain reachability) vs通用环境风险(general DNS egress / other AI domains). Avoids flagging Claude as high-risk when only non-allowlisted traffic leaks.KNOWN_DNSkept as a label + as the fallback when the egress test is off.--no-leak/--fastto skip the network-heavy tests.Things to weigh (happy to adjust)
ROADMAP.mdthat DNS-domestic-provider was recently downgraded to a yellow hint by design. This PR re-surfaces DNS, but as a measured signal under its own通用环境风险line — it does not push Claude-specific risk to high. Glad to gate the whole block behind a flag (default off) if you prefer.whoami.akamai.net) or make the block fully opt-in.random,concurrent.futures). The proxy-path parts lean on the existing macOSget_system_proxy(); on Linux/Windows the proxy-path test is best-effort.Testing
Verified on macOS (Darwin 23.6) against a fake-ip + per-domain-DoH proxy: the static check false-positived (configured AliDNS) while the egress test correctly showed the generic path leaking to CN and the Claude domains resolving to real IPs + tunnel-reachable.
--no-leakfalls back cleanly. Not yet verified on Linux/Windows.See
CHANGELOG.mdfor the full summary. Happy to adjust scope / wording / flags / dependency per your direction.