Skip to content

Pluggable keyless passive sources beyond crt.sh #193

Closed

Description

@TMHSDigital

Summary

"Seed then resolve" is built once for certificate transparency. Other keyless passive sources (for example passive-DNS and web-archive indexes) would reuse the same merge path verbatim, but the CT client is a concrete type hard-wired in main_ct.go, and the library cannot seed from CT at all.

Where

  • internal/ct/ct.go:30 (concrete Client, single URL at :22)
  • main_ct.go:24 (hard-wired), main_ct.go:40-62 (merge-into-candidates logic is already source-agnostic)
  • pkg/subenum/subenum.go:347 (no seeding hook in the library)

Proposal

Define type Source interface{ Names(ctx, domain string) ([]string, error) }, move the crt.sh client behind it, add -sources ct,... (default ct when -ct is set), record per-source names and error in the report, and have lab mode refuse all sources as it does -ct. Every seeded name is still verified by resolution. Expose a Sources []Source option in pkg/subenum.

Who benefits

Users who want more coverage without API keys; library embedders who want CT seeding.

Open questions

  • External endpoints rate-limit; keep one request per source per target and report failures as notices, as ct_error does
  • Which sources to ship first

Acceptance criteria

  • CT works unchanged through the interface
  • At least one additional source behind a flag
  • Library can pass sources

Getting started

  • Relevant files: internal/ct/ct.go, main_ct.go, pkg/subenum/subenum.go
  • How to run tests: go test ./internal/ct/ . ./pkg/...
  • Related docs: README (-ct), docs/library.md

Related: #85


Filed by repo-audit/full-audit at 3139c44. Severity: medium. Effort: M. audit-key: enhancement|internal/ct/ct.go|passive-sources

Activity

  1. added
    enhancement
    help wanted
    severity: medium
    on Nov 9, 2026
  2. TMHSDigital commented on Nov 13, 2026

    @TMHSDigital
    OwnerAuthor

    Fixed in 0160819.

    Interface: internal/passive holds Source (Name, Names(ctx, domain)) and a registry (Known, ParseList, New). The crt.sh client implements it unchanged.

    Second source: wayback reads hostnames from the Wayback Machine's CDX index of archived URLs. It's one HTTPS request per target with no API key, bounded to 200k URLs and 64 MB.

    CLI:

    • -sources ct,wayback picks the sources; -ct stays as shorthand for -sources ct.
    • Names from every source become candidates and -permute seeds, and each is still verified by a lookup.
    • A failed source is a warning, and the scan goes on.
    • The report gains sources: [{name, names, error}]; ct_names and ct_error are kept.
    • The resume state keeps each source's names, and older state files with only the CT fields still resume.
    • Lab mode refuses -sources, and simulation ignores it.

    Library: Config.Sources, the Source interface, CertificateTransparency(), WaybackMachine() and NoticeSource. Sources are asked before the scan inside Run's goroutine, so Run still returns at once.

    Open questions from the issue:

    • One request per source per target, failures as notices: yes, in both the CLI and the library.
    • Which sources first: the Wayback Machine. It needs no key, has a stable plain-text API, and remembers hosts that CT and DNS have forgotten. Others can now be added as one Source each.

    Acceptance criteria:

    • CT works unchanged through the interface; the existing CT e2e tests pass untouched.
    • One additional source is behind a flag.
    • The library can pass sources.

    Verified with go test -race ./... and golangci-lint locally, and CI is green on every job.

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

    enhancementhelp wantedseverity: medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions