Join our Newsletter — 33% off our NHI Course

What is the difference between repository-based discovery and external attack surface discovery for DAST programs?

Repository-based discovery starts from connected code and generated specs, so coverage is bounded by what engineering exposes. External attack surface discovery starts from internet-facing signals such as DNS, certificates, fingerprints, and observed traffic, then identifies assets that may have no repo access. The practical difference is whether unknown assets can be tested at all.

Why This Matters for Security Teams

DAST coverage is only as good as the asset inventory behind it. Repository-based discovery is useful when engineering teams expose code, manifests, or generated specs, but it will miss services that were created outside the normal development path. External attack surface discovery is the counterbalance: it looks for DNS records, certificates, fingerprints, and observed traffic to find what the organisation actually has online, not just what the repo says should exist.

That distinction matters because unknown internet-facing assets are the places DAST programs most often fail. If a service is absent from source control, repo-driven discovery will not test it, and security may incorrectly assume it does not exist. NHIMG’s The 52 NHI breaches Report shows how often exposed systems and credentials become discovery problems first and incident problems later. External reconnaissance helps close that gap before attackers do.

In practice, many security teams learn about an unmanaged production endpoint only after scanners, logs, or an external report reveal it, rather than through deliberate discovery.

How It Works in Practice

Repository-based discovery usually begins with code repositories, CI/CD artifacts, API definitions, infrastructure-as-code, and test environments. DAST tooling can derive targets from OpenAPI files, route tables, or generated service catalogs, then run authenticated or unauthenticated tests against those known endpoints. This works well when engineering discipline is high and deployment pipelines preserve an accurate map of live services.

External attack surface discovery starts from the outside in. It enumerates internet-facing domains and subdomains, certificate transparency logs, IP ranges, reverse DNS, CDN and WAF fingerprints, and traffic observations to identify exposed applications that may never appear in a repo. That is why it is complementary, not redundant. The point is not just to find more URLs, but to find the URLs that repository-based methods cannot see.

Operationally, the strongest DAST programs combine both views:

  • Use repository-based discovery for high-fidelity coverage of known services and authenticated test paths.
  • Use external discovery to detect shadow IT, forgotten subdomains, legacy apps, and acquisitions that bypass normal engineering workflows.
  • Deduplicate findings so the same target is not treated as separate assets simply because it was found by two methods.
  • Feed both discovery streams into a single asset inventory so DAST scope can be reviewed continuously.

For teams building a broader exposure-management process, NHIMG’s Top 10 NHI Issues is a useful reminder that discovery failures and identity sprawl usually travel together, while MITRE’s MITRE ATT&CK Enterprise Matrix helps map how exposed services are typically abused after they are found.

These controls tend to break down in fragmented environments where product teams deploy independently, because external assets can exist without any repo, pipeline, or ownership record to anchor scanning.

Common Variations and Edge Cases

Tighter discovery coverage often increases operational overhead, requiring organisations to balance test breadth against false positives, scope churn, and asset-owner friction. That tradeoff is real: the more aggressively external discovery is used, the more often security teams must resolve ambiguous hostnames, shared platforms, and transient infrastructure.

Current guidance suggests treating the two discovery methods as different risk lenses. Repository-based discovery is usually better for precision, authenticated testing, and change tracking. External discovery is better for completeness, especially when governance is uneven or infrastructure is managed across multiple business units. There is no universal standard for which source of truth should dominate; mature programs reconcile both and use human review for conflicts.

Edge cases matter. APIs behind gateways may be visible in repos but not directly reachable from the internet. Conversely, marketing sites, acquisition leftovers, or third-party hosted services may be externally reachable yet completely absent from engineering records. In cloud-heavy environments, ephemeral hosts and short-lived certificates can make external discovery noisy, so the scan cadence must match deployment velocity.

From a DAST standpoint, the right question is not which method is better, but which one is missing the asset class most likely to matter in production. That is where programs usually under-scan, especially when ownership is unclear and the asset was never intentionally brought into the testing workflow.

Standards & Framework Alignment

This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.

OWASP Non-Human Identity Top 10, OWASP Agentic AI Top 10 and CSA MAESTRO address the attack and risk surface, while NIST AI RMF and NIST CSF 2.0 set the governance and control requirements practitioners need to meet.

Framework Control / Reference Relevance
OWASP Non-Human Identity Top 10 NHI-01 Discovery gaps often hide unmanaged identities tied to exposed services.
OWASP Agentic AI Top 10 Autonomous tooling can create unknown attack surfaces outside repo control.
CSA MAESTRO TRD-01 Maps to tracing runtime exposure across distributed agentic workloads.
NIST AI RMF AI RMF requires visibility into system scope and operational context.
NIST CSF 2.0 ID.AM-1 Asset management is central to distinguishing known from unknown attack surface.

Inventory all non-human identities behind discovered assets before DAST scope is approved.