Prompt
How do I find every API we expose, including shadow APIs?
Latest observation
To find every API you expose, including shadow APIs (untracked, forgotten, internal, or indirectly exposed endpoints), you need a mix of inventory, traffic analysis, network discovery, and code/config review.
1) Start with what you already know
Collect all known sources of APIs:
- API gateway / ingress configs
- Load balancer / reverse proxy routes
- Service mesh routes
- OpenAPI/Swagger specs
- Postman collections
- Terraform / IaC configs
- DNS records and subdomains
- Container / Kubernetes Ingress, Services, and VirtualServices
- CI/CD deploy manifests
- Internal developer docs and wiki pages
This gives you the “intended” API surface.
2) Discover externally exposed endpoints
Scan your public attack surface:
- Enumerate subdomains
- Check all HTTP(S) hosts and ports
- Crawl docs portals, Swagger UIs, GraphQL playgrounds, gRPC gateways
- Fingerprint apps and frameworks
- Look for exposed admin panels, debug routes, health checks, metrics endpoints
Useful techniques:
- Passive DNS / certificate transparency logs
- Port scanning of owned assets
- HTTP endpoint probing
- Web crawler against known domains
3) Compare runtime traffic to declared APIs
Shadow APIs often show up in production traffic but not in documentation.
- Analyze API gateway logs
- Reverse proxy logs
- WAF logs
- Service mesh telemetry
- APM traces
- CDN logs
- SIEM/network flow logs
- Mobile app telemetry if applicable
Look for:
- Requests to undocumented paths
- Unexpected methods on known paths
- Rare hosts/subdomains
- Legacy versioned endpoints still receiving traffic
- Internal routes reachable from the edge
4) Inspect application code and infrastructure for hidden routes
Search repos and deployed images for route definitions:
@app.route,router.get/post, Spring@RequestMapping, Express/FastAPI/Django/Flask, Go mux, .NET controllers- gRPC service definitions
- GraphQL schemas and resolvers
- WebSocket handlers
- Serverless functions and API Gateway mappings
- Feature-flagged or environment-specific routes
Also search for:
- “debug”, “test”, “internal”, “admin”, “beta”, “v1”, “legacy”
- hardcoded endpoints
- route registration generated at runtime
5) Check for shadow APIs in non-obvious places
Commonly missed sources:
- Mobile app embedded endpoints
- Old versions of APIs still deployed
- Forgotten sandboxes and staging environments exposed to the internet
- Partner/tenant-specific endpoints
- Shadow IT services outside central management
- API endpoints behind alternate hostnames
- GraphQL introspection and undocumented mutations
- gRPC services exposed via HTTP/JSON transcoding
- Webhooks and callback endpoints that also accept inbound traffic
6) Build an asset-to-route inventory
Create a living inventory with:
- Hostname
- IP / cloud resource
- Service owner
- Auth type
- Protocol
- Path/method
- Data sensitivity
- Exposure level
- Source of discovery
- Last seen in traffic
- Documentation status
Then reconcile:
- Declared APIs
- Observed APIs
- Deployed routes
- External exposure
Anything observed or deployed but undocumented is a candidate shadow API.
7) Automate continuous discovery
Set up continuous monitoring so this doesn’t become a one-time exercise:
- CI checks for new route definitions
- API gateway drift detection
- Traffic anomaly detection for new paths
- Scheduled asset inventory scans
- Alerting on newly exposed subdomains, ports, or hosts
- Spec-to-runtime diffing
8) Validate safely
For anything you discover:
- Confirm with owners
- Test in authorized environments
- Avoid destructive requests
- Record auth requirements and data returned
- Classify whether it is public, partner-only, internal, or deprecated
9) Recommended operating model
A practical approach is:
- Inventory known APIs
- Discover runtime/external endpoints
- Diff against documentation/specs
- Investigate undocumented hits
- Track ownership and exposure
- Continuously monitor for drift
If you want, I can help you build a step-by-step discovery checklist, a spreadsheet schema for API inventory, or a sample script/tooling stack for finding shadow APIs in your environment.