Skip to content

Takeover provider list is compiled in; allow extending it from a file #219

Closed

Description

@TMHSDigital

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} table
  • internal/dns/takeover.go:53-61 (TakeoverProvider): suffix matching against that table only

Proposal

  • File format: one suffix name pair 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 a replace directive 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/subenum callers 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

Getting started


Filed by repo-audit/feature-ideas at 3fd0128. Severity: medium. Effort: M. audit-key: enhancement|internal/dns/takeover.go|takeoverProviders

Activity

  1. added
    enhancementNew feature or request
    help wantedExtra attention is needed
    area: dnsResolver, classification, wildcard
    severity: mediumEdge-case bugs, degraded behavior, meaningful maintenance cost
    on Nov 11, 2026
  2. TMHSDigital commented on Nov 11, 2026

    @TMHSDigital
    OwnerAuthor

    Fixed in 06aa15b.

    • Merge mode: -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.
    • Replace mode: -takeover-providers-only uses the file alone.
    • A bad line is a usage error (exit 2) that names the line number.
    • The list now reaches the takeover cache through scan.Config instead of a package global.
    • pkg/subenum gains Config.TakeoverProviders and Config.TakeoverProvidersOnly.
    • The config-file key, the SUBENUM_TAKEOVER_PROVIDERS env var and -print-config all work through the existing generic flag handling.

    Verified with TestParseTakeoverProviders (merge, replace, remove, IDN, longest match, line-numbered errors), TestScanTakeoverProviders (library) and TestE2ETakeoverProviders (CLI, local test DNS server). Also ran the full go test ./..., -race on the touched packages, and golangci-lint run (0 issues).

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: dnsResolver, classification, wildcardenhancementNew feature or requesthelp wantedExtra attention is neededseverity: mediumEdge-case bugs, degraded behavior, meaningful maintenance cost

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions