Skip to content

fix(dns): enforce a timeout floor alongside the resolver pool#365

Open
TBX3D wants to merge 4 commits into
vmfunc:mainfrom
TBX3D:fix/dns-resolver-timeout
Open

fix(dns): enforce a timeout floor alongside the resolver pool#365
TBX3D wants to merge 4 commits into
vmfunc:mainfrom
TBX3D:fix/dns-resolver-timeout

Conversation

@TBX3D

@TBX3D TBX3D commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

the resolver pool change let a caller-supplied timeout of zero (or unset) slip through uncapped, so a hung resolver could block a scan indefinitely. enforce a minimum floor regardless of what the caller passes.

TBX3D added 4 commits July 3, 2026 12:40
DNS modules were a stub that returned the unsupported sentinel. Implement
the executor: resolve the configured name and record type, then run the
module's matchers and extractors against the answer. A matcher targets a
part, either the record set (answer), the response status (rcode), or the
full response (default), so a status like NXDOMAIN is matchable directly.
A name's {{FQDN}} resolves to the target host. The record type and matcher
types are validated at parse time so a bad module fails to load rather than
silently matching nothing. Promotes miekg/dns to a direct dependency for the
record type codes.
the dns executor built its resolver over a hardcoded public pool and
ignored the -resolvers flag, so dns modules could never target an
internal or authoritative resolver and could not be exercised without
external egress. thread the parsed resolver list through Options into
newDNSResolver, falling back to the bundled pool when none is given.
first shipped type: dns module: resolves the target's txt records,
reports its spf policy and extracts the sender set and enforcement
qualifier.
opts.Timeout <= 0 reached retryabledns as a literal zero, and
retryabledns applies no default of its own, so a black-hole or
non-responsive resolver blocked the query forever. floor it to
defaultDNSTimeout before building the client, mirroring the tcp
executor's existing floor.
@TBX3D
TBX3D requested a review from vmfunc as a code owner July 10, 2026 00:11
@github-actions github-actions Bot added size/xl 500+ lines changed modules changes to scan modules docs documentation changes tests test changes deps dependency updates labels Jul 10, 2026
@github-actions

Copy link
Copy Markdown

pr summary

10 files changed (+856 -35)

category files
go source 7
tests 2
deps 1

@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 95.41985% with 6 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (main@7ea1cd2). Learn more about missing BASE report.

Files with missing lines Patch % Lines
sif.go 0.00% 4 Missing ⚠️
internal/modules/dns.go 98.38% 1 Missing and 1 partial ⚠️
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #365   +/-   ##
=======================================
  Coverage        ?   55.52%           
=======================================
  Files           ?       82           
  Lines           ?     7000           
  Branches        ?        0           
=======================================
  Hits            ?     3887           
  Misses          ?     2843           
  Partials        ?      270           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

deps dependency updates docs documentation changes modules changes to scan modules size/xl 500+ lines changed tests test changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants