An organisation’s attack surface includes the points through which its systems can be reached. Mapping it helps identify exposed services, forgotten assets and dependencies that deserve risk analysis. The map remains an inventory; it must then be connected to each asset’s role in the business.
What is the attack surface?
The attack surface encompasses all exposed digital assets of an organization that can be reached by an attacker. This includes external assets (visible from the Internet) and internal assets (accessible from the internal network). Typical components of the external attack surface include domains and subdomains, public IP addresses, open ports and exposed services, web applications and APIs, cloud storage buckets (S3, Azure Blob, GCS), SSL/TLS certificates, DNS records, and SaaS services used by the organization.
The internal attack surface includes servers and workstations, the network (segments, VLANs, firewall rules), internal services (Active Directory, email, intranet), file shares, and partner interconnections. The distinction is important because mapping techniques differ between the two, and the threats targeting them are different.
Why most organizations underestimate their attack surface
These forgotten assets are often the most vulnerable because they are not included in update and patching cycles, they are not covered by security audits, and they may use default configurations or weak credentials. This is precisely what makes them attractive to attackers, who systematically scan the Internet looking for these weak points.
Attack surface mapping techniques
Subdomain enumeration
Subdomain enumeration is the first step of any mapping exercise. It consists of discovering all subdomains associated with the organization's main domains. Techniques include querying certificate databases (Certificate Transparency logs), DNS queries (zone transfers, brute force), analysis of search engines and web caches, use of OSINT (Open Source Intelligence) sources, and analysis of SPF, DKIM, and DMARC records that can reveal third-party services. Commonly used tools include Subfinder, Amass, and APIs from services like SecurityTrails or Censys.
Port and service scanning
Once authorised addresses are identified, examining ports and services clarifies what is exposed. Scan depth depends on the mandate and operational constraints. An open port is only a signal; the service, configuration, role and exposure determine which risk should be investigated.
API discovery
APIs have become the primary attack surface of modern applications. API discovery includes analysis of specification files (OpenAPI/Swagger, GraphQL introspection), intelligent crawling of web applications to identify API calls, analysis of frontend JavaScript code that can reveal undocumented endpoints, and use of Wayback Machine and web archives to find old API versions that might still be active. Undocumented or "shadow APIs" are particularly dangerous because they escape security controls.
Cloud asset discovery
Migration to the cloud has considerably expanded organizations' attack surfaces. Cloud asset discovery includes identifying public or misconfigured storage buckets, searching for exposed serverless functions, detecting accessible cloud databases (MongoDB, Elasticsearch), analyzing security groups and access policies, and verifying PaaS and SaaS service configurations. Cloud misconfiguration is one of the most frequent causes of data breaches.
Continuous attack surface monitoring
One-time mapping is not enough. The attack surface evolves constantly: new services are deployed, configurations change, new vulnerabilities are published. Continuous monitoring is essential to maintain up-to-date visibility.
Review frequency depends on how quickly the environment changes and how critical the assets are. The aim is to identify new services, exposure changes and components affected by a known vulnerability, then decide which require investigation.
Attack surface reduction strategies
Attack surface reduction is a proactive defense strategy. Instead of focusing solely on protecting existing assets, it aims to eliminate unnecessary entry points.
First actions: inventory and decommission unused assets (abandoned subdomains, test servers, old API versions). Consolidate entry points by using reverse proxies and API gateways to centralize access. Minimize exposed services: every exposed service is a potential entry point, only expose what is strictly necessary. Apply the principle of least privilege to network and cloud configurations.
Continuous actions: integrate attack surface management into change management processes so that each new deployment is evaluated in terms of exposure. Automate detection of assets that don't comply with the security policy. Train development and operations teams in cloud security best practices and service exposure.
Attack surface and compliance
Frequently asked questions
How often should you map your attack surface?
There is no universal frequency. Review the map after material changes and at a pace suited to asset exposure. Organisations that deploy frequently can include the check in their change process.
How to manage shadow IT in the attack surface?
Shadow IT is one of the major challenges. Implement a regular discovery process that identifies unapproved cloud services, undocumented subdomains, and applications deployed by business teams. Combine this with a clear cloud service usage policy and team training.
Is attack surface mapping a pentest?
No, it's the first step of a pentest. Mapping identifies what is exposed, the pentest tests whether what is exposed is vulnerable and exploitable. Both are complementary and are part of the complete offensive security pipeline.
What tools should be used for attack surface mapping?
Choose tools according to the scope, authorised sources and required depth. Mapping quality depends mainly on traceability, context and its ability to inform risk scenarios.
Jordan Fredj, Founder of Hacksessible -
Map your attack surface
Connect exposed assets to the activities they support, then choose which scenarios deserve testing.