Attack surface definition
Attack surface is every point where an attacker can try to get into a system, make it do something, or take data out of it. NIST defines it as the set of points on the boundary of a system, a system element, or an environment where an attacker can try to enter, cause an effect on, or extract data from it.
The word “try” matters. A server with no known flaw is still attack surface, because it is reachable, and the next flaw found in it will be reachable too. Google’s threat intelligence team measured the average time between a vulnerability being disclosed and being exploited at five days in 2023, down from 32 days in 2021 and 2022. When exploitation follows disclosure that quickly, everything you expose is effectively one bad week away from being a way in.
Attack surface components
Anything an attacker can reach or use counts as attack surface: network services, software, credentials, people and physical access. In practice it falls into a few groups:
- Network exposure. Public IP addresses, open ports, domains and subdomains, VPN endpoints, remote desktop, admin panels and every device that answers from the internet.
- Applications and APIs. Websites, login pages, mobile app backends, webhooks and any endpoint that accepts input.
- Credentials. Passwords, API keys, tokens and certificates. Each one is a way in for whoever holds it, and a long-lived key copied into code, CI systems and laptops spreads that way in to every place it is stored.
- Third parties and supply chain. Libraries, SaaS integrations, cloud providers and anything that runs with your permissions.
- People. Staff who can be phished, and support desks that can be talked into resetting an account.
- AI agents and tools. The content an agent reads, the tools it can call and the keys those tools hold. OWASP’s 2025 Top 10 for LLM applications lists prompt injection and excessive agency among the top risks. Are AI agents a security risk for businesses? covers this in detail.
- Physical and radio access. Ports on a device, and wireless links within range.
Attack surface mapping
Mapping attack surface starts from the outside and works in, because that is how an attacker starts.
- List what the internet can reach. Every public IP address, domain, open port and cloud service with a public endpoint. Include the forgotten ones: staging sites, old marketing pages, test APIs and devices someone put on a public address years ago.
- List every credential that grants access. API keys, service accounts, deploy keys, shared passwords and tokens held by integrations and agents. Note how long each lives and how widely it is copied.
- List what each exposed thing can reach. A web server that can talk to the production database puts the database one step behind the website.
- Track the count. The total number of exposed services and live credentials is a useful number to watch. If it only ever grows, the attack surface is growing faster than anyone is reviewing it.
Attack surface reduction
Reducing attack surface means removing exposure first, then hardening what has to stay. Hardening a service you did not need to expose is work spent defending a door you could have bricked up.
- Take things off the internet. CISA’s first mitigation for operational technology is to remove its connections to the public internet, because those devices are easy targets when connected. The same reasoning applies to cameras, controllers, printers and internal tools.
- Funnel what remains through fewer doors. NIST’s control SC-7(3) says to limit the number of external network connections to a system, which makes the traffic that does cross easier to watch. How does a single gateway reduce attack surface? explains the pattern.
- Cut and shorten credentials. Delete keys nobody uses, scope the rest to one job, and prefer credentials that expire on their own.
- Patch what stays exposed, fast. A five-day average time-to-exploit leaves no room for a monthly patch cycle on internet-facing systems.
- Give tools and agents only what the task needs. Every permission an agent holds is reachable by anyone who can steer it.
Local networks and attack surface
Local coordination removes a whole category of exposure outright. When devices find, authenticate and talk to each other on a local network or over a short-range radio, they do not need to be reachable from the internet at all. An attacker on the other side of the world cannot scan for them, cannot reach their services, and cannot try a stolen password against them. To touch the fleet, an attacker has to be in radio range or already hold a foothold on a device inside.
That is the design Offline Protocol has been building. Devices generate their own Ed25519 identity keys and derive their addresses from them, so two devices verify each other directly with nothing to look up. Messages and groups are end-to-end encrypted with MLS. Discovery, messaging, shared documents and service calls run over Bluetooth LE, Wi-Fi and local IP, and a local mesh needs no portal account and no API key. The internet is an extra path, through a relay or a gateway you provision against a defined contract, not a requirement. The result is a fleet whose internet-facing attack surface is one gateway you chose and hardened, instead of every device you own.