Repository navigation
Closed
Labels
area: dnsResolver, classification, wildcardResolver, classification, wildcardenhancementNew feature or requestNew feature or requesthelp wantedExtra attention is neededExtra attention is neededseverity: mediumEdge-case bugs, degraded behavior, meaningful maintenance costEdge-case bugs, degraded behavior, meaningful maintenance cost
Description
Summary
The takeover-prone provider list is compiled into the binary, so every new fingerprint needs a code change and a release (#134, #214). Users who track their own providers, or who want to drop a provider that is noisy for them, can't. A -takeover-providers <file> flag would let them extend or replace the list without waiting for a release.
Where
internal/dns/takeover.go:15-49(takeoverProviders): hard-coded{suffix, name}tableinternal/dns/takeover.go:53-61(TakeoverProvider): suffix matching against that table only
Proposal
- File format: one
suffix namepair per line,#comments allowed (same style as-exclude-file), e.g..example-cdn.net example-cdn. - Default: merge the file with the built-in list.
-takeover-providers-only(or areplacedirective in the file) uses only the file. - Validate suffixes like domains (leading dot, lowercase, IDN through the existing punycode path); reject bad lines with the line number, exit 2.
- Pass the table through the scan config instead of the package global, so
pkg/subenumcallers can set it too. - Show the source in
-print-config.
Who benefits
Security teams with in-house or regional hosting providers, and maintainers, who get fewer "please add provider X" requests.
Trade-offs
- Keep matching DNS-only; a file can't add HTTP fingerprint checks, and the docs should say a match is still only a hint.
Acceptance criteria
- Flag, config key and
SUBENUM_*env var via the settings table (One table for setting tokens, flag names, config fields and TUI labels #160) - Merge and replace modes tested; bad lines report line numbers
-
TakeoverProviderno longer reads a mutable global - Docs (
docs/cli.md, README flag table viamake docs-flags) and CHANGELOG
Getting started
- Relevant files:
internal/dns/takeover.go,internal/scan/settings.go,main.go - Tests:
go test ./internal/dns/ ./... - Related: Add more takeover-prone providers to the CNAME fingerprint list #134, fix(dns): recognize Anima and Discourse takeover targets #214
Filed by repo-audit/feature-ideas at 3fd0128. Severity: medium. Effort: M. audit-key: enhancement|internal/dns/takeover.go|takeoverProviders
Metadata
Metadata
Assignees
Labels
area: dnsResolver, classification, wildcardResolver, classification, wildcardenhancementNew feature or requestNew feature or requesthelp wantedExtra attention is neededExtra attention is neededseverity: mediumEdge-case bugs, degraded behavior, meaningful maintenance costEdge-case bugs, degraded behavior, meaningful maintenance cost
Activity
TMHSDigital commentedon Nov 11, 2026
Fixed in 06aa15b.
-takeover-providers <file>adds<suffix> <name>pairs to the built-in list. An entry for a suffix that is already listed replaces it, a name of-removes the suffix, and the longest matching suffix wins.-takeover-providers-onlyuses the file alone.scan.Configinstead of a package global.pkg/subenumgainsConfig.TakeoverProvidersandConfig.TakeoverProvidersOnly.SUBENUM_TAKEOVER_PROVIDERSenv var and-print-configall work through the existing generic flag handling.Verified with
TestParseTakeoverProviders(merge, replace, remove, IDN, longest match, line-numbered errors),TestScanTakeoverProviders(library) andTestE2ETakeoverProviders(CLI, local test DNS server). Also ran the fullgo test ./...,-raceon the touched packages, andgolangci-lint run(0 issues).feat(dns): load extra takeover providers from a file (TMHSDigital#219)