API Advanced Protection
API Posture
AI Posture
AI Firewall
Blog →
API Posture

API Discovery: How to Find Shadow and Orphaned APIs | Harness Blog

API discovery finds every API you actually run, including shadow and orphaned endpoints. Learn what they are, why they matter, and how to find them.

API Discovery: How to Find Shadow and Orphaned APIs

TL;DR

  • API discovery finds every API an organization actually runs, including endpoints missing from the official inventory.
  • A shadow API was never documented or approved; an orphaned API was documented once, then lost its owner.
  • Discovery combines live traffic, code, documentation, infrastructure, DNS, certificates, and logs, then reconciles them with the catalog.
  • OWASP lists Improper Inventory Management as API9 of its ten 2023 API risks and rates it widespread.

Answer capsule

What is API discovery? 

API discovery is the practice of finding every API an organization runs, whether or not it was formally documented or approved, by comparing live traffic, code, and infrastructure with the official inventory. OWASP rates the resulting gap, Improper Inventory Management (API9:2023), as widespread.

Quick facts: API discovery
What it finds All APIs running in production
Shadow API Never formally documented or approved
Orphaned API Documented once, then lost its owner
Typical sources Live traffic, code and pipelines, documentation, cloud infrastructure, DNS and certificates, logs and SIEM data
OWASP mapping API9:2023 Improper Inventory Management: exploitability easy, prevalence widespread, detectability average (OWASP)
Cadence Continuous, because new APIs get deployed or modified constantly
What it does not do Secure an API by itself; it supplies the visibility that testing and protection depend on

‍

The API had been running for two years.

A contractor had built it for a feature that shipped, but nobody formally handed it off when the work was done. The contractor moved on. The endpoint remained live, still processing production data, but it was absent from the organization's official API documentation.

The team found it during a security audit.

That is the problem with APIs you do not know what you have. This article explains what API discovery means, how shadow APIs differ from orphaned APIs, and the methods teams can use to find them. It also explains why discovery has to be continuous: new APIs can appear during ordinary development long before anyone updates the official inventory.

What is API discovery?

API discovery is the practice of finding every API an organization runs across its environments, whether or not those APIs were formally documented or approved. It compares what is actually running with what your API catalog says should be running, using signals such as live traffic, code repositories, and infrastructure.

An API catalog tells you what your organization believes it has. API discovery tests that assumption against reality. An endpoint can be missing from the catalog but still receive production traffic. Discovery exposes that gap.

That makes API discovery an ongoing process, not a one-time audit. New APIs can appear as teams build features, add integrations, or deploy services, while older APIs may remain active long after their original owners or use cases have disappeared. And, just as important, continuous discovery can tell you when an API or its dependencies have been modified, so your information doesn’t get stale.

Reliable discovery therefore needs more than an API gateway or documentation repository. It should draw on traffic, code, and infrastructure to build a more complete picture of what is actually running.

What are shadow APIs and orphaned APIs?

Shadow APIs and orphaned APIs are different problems, even though both can exist outside an organization's current API inventory.

A shadow API is an API that was never formally documented or approved. It may have been created for a specific feature, test, or third-party integration and never added to the official inventory. The security team may not know it exists.

An orphaned API is an API that was documented and known at some point but has since lost its owner. The team that built it may have moved on, the feature may have been deprecated, or the person who understood it may have left. The API can remain running without anyone actively maintaining or reviewing it, causing the API to still show up in the catalog but have significant differences in function or dependencies than were originally documented.

The difference is straightforward: a shadow API was never accounted for; an orphaned API was accounted for and then forgotten. Both can be missed by a security review that relies only on current documentation.

How do I discover shadow and undocumented APIs?

Discovering shadow and undocumented APIs usually requires combining several sources. No single method can show everything that is running across an organization's environments.

Method What to do
Analyze live traffic Observe network and API gateway traffic to identify endpoints that are actually being called, including APIs that do not appear in the documentation.
Scan code and repositories Search source code and CI/CD pipelines for API route definitions. This can surface APIs in development before they are deployed.
Inventory cloud infrastructure Compare what is running across cloud accounts, load balancers, and API gateways with the documented inventory. This can expose infrastructure that was never formally registered or decommissioned.
Monitor DNS and certificates Unexpected subdomains and certificates can point to API endpoints that are missing from the official inventory.
Correlate logs and SIEM data Review access logs for request patterns and endpoints that do not correspond to known, documented routes.
Reconcile the results Compare everything discovered through traffic, code, infrastructure, DNS, certificates, and logs against the official API catalog. Anything found in the environment but missing from the catalog needs further investigation as a potential shadow or orphaned API.

‍

The key is correlation across sources, creating a single source of truth. Traffic shows what is being used, code shows what has been built, and infrastructure shows what is deployed. Comparing those signals with the official inventory gives you a more complete view of the APIs actually in operation.

Why is API discovery important for API security?

API discovery matters for API security because you cannot secure, test, or apply a policy to an API you do not know exists. This connects directly to API9:2023, Improper Inventory Management, in the OWASP API Security Top 10, which identifies incomplete or outdated API inventories and documentation as security weaknesses.

Risk Why it matters
Security reviews can miss shadow APIs An API that never entered the official catalog may also fall outside the security testing and controls applied to known endpoints.
Orphaned APIs can remain unmaintained When an API loses its owner, its code, dependencies, and security controls may not receive the same ongoing attention as actively maintained services.
The attack surface can grow unnoticed Undocumented and unreviewed endpoints give security teams less visibility into what is exposed. OWASP notes that outdated inventories and documentation can leave unnecessarily exposed API hosts and unpatched systems in operation.
Sensitive data can fall outside oversight An API that is missing from the inventory can also be missing from reviews of the data it handles, making it harder to identify and address exposure.

‍

API discovery does not secure an API by itself. It gives security teams the visibility needed to identify what is running, determine what needs review, and apply the appropriate controls.

How do you keep API discovery current, not just accurate once?

API discovery is not a project you finish once. It must keep pace with APIs being deployed and retired across your environments, or the inventory will become incomplete again.

  • Point-in-time audits go stale: An inventory can be accurate when it is created but become incomplete as new APIs are deployed and existing ones change.
  • Shadow APIs can appear through ordinary work: A quick integration, a test endpoint left running, or a new microservice can introduce an API that never makes it into the catalog.
  • Continuous discovery keeps the inventory current: Monitoring live production traffic helps teams identify APIs as they appear instead of waiting for the next periodic audit.

The goal is to keep knowing what APIs are actually running.

How Harness discovers and protects live APIs

The challenge

The hard part of API security is knowing what is actually running, which documentation alone cannot show. 

The approach

The Harness Runtime Protection Agent continuously discovers APIs from the edge, inline, and out of band, so it can identify newly surfaced endpoints as they appear wherever they appear.

Find every API from live traffic and prioritize them. 

Harness API Posture Management continuously discovers API endpoints from live traffic, including shadow and forgotten APIs, and assesses their exposure, vulnerabilities, and drift. It provides the visibility needed to understand what APIs are actually running and identify endpoints that may have been missed by the official inventory. It offers multiple deployment options and can collect data from everywhere so no APIs are missed. It then assesses and scores the risk of each API so security teams can prioritize appropriately.

Act on what discovery finds. 

Once an endpoint is discovered, Harness API Advanced Protection provides contextual runtime threat protection using behavioral analysis to detect and block malicious API activity. This extends protection beyond knowing an endpoint exists to detecting threats against APIs while they run.

Extend discovery to AI-fronting endpoints. 

The same continuous discovery model extends to AI workloads. Harness AI Security monitors AI API traffic to discover LLMs, MCP servers, AI services, and agents, including AI assets that were never formally inventoried. This gives security teams visibility into AI endpoints alongside the rest of their API surface.

The outcome

The result is a unified view of the API surface built from live traffic: newly surfaced endpoints appear as they are observed, and each one can move from discovery to posture assessment to runtime protection.

What this means for your APIs

The test is whether every endpoint you discover has a corresponding entry in that catalog and that each entry has a current risk assessment. That shift matters because APIs can disappear from view in two ways: they can be created without ever being documented, or they can remain active after their owners and documentation have disappeared.

API discovery addresses both problems by combining live traffic with code, infrastructure, DNS, certificates, and logs. The result is a view of what is actually running, not just what your documentation says should be running.

See how Harness continuously discovers the APIs carrying live traffic, shadow and forgotten ones included.

Explore Harness API Posture Management

← Previous:
Next: →‍

FAQs

Related Resources

Get Started

Get Started with Harness AI

Try the full platform free. No module restrictions, no credit card.

Christine Ferrusi Ross
Principal Product Marketing Manager
Christine Ferrusi Ross leads product marketing for Harness’ runtime security – WAAP and AI Security. Prior to Harness she worked in observability and application security, and blockchain. She also spent many years as an industry analyst helping organizations buy and manage emerging technologies and services.
christine-ferrusi-ross
Christine Ferrusi Ross