Attack surface
Attack surface is the set of points where an attacker can try to enter a system, affect it or extract data from it. On a VPS that means open ports, public hostnames, web pages and files, login forms, APIs and the accounts and services around them. You cannot defend what you have not listed, so reducing and watching it is a core security habit.
What the standards say
The NIST glossary gives definitions from SP 800-53 Rev. 5 and SP 800-160. They describe the set of points on the boundary of a system, a system element or an environment where an attacker can try to enter, affect or extract data. The OWASP Attack Surface Analysis Cheat Sheet puts it in similar words: all of the different points where an attacker could get into a system, and where data can get out, together with the code that protects those paths and the valuable data they handle.
Two ideas follow from this. First, the surface is made of many kinds of points, not only network ports. Second, it is about opportunity, not about a known flaw. A login page that has no known bug is still part of the surface, because it is a place an attacker can try. Size and exposure matter, and a smaller surface gives fewer places to look and fewer places to defend.
What it contains on a small VPS
For an owner of a VPS, it helps to list the surface in layers:
- Network: every port that answers from the internet, such as SSH, web, mail and a database someone forgot to close. See port scanning.
- Names: the main domain plus every subdomain, including old test and staging names, as described under subdomain enumeration.
- Web: pages, admin panels, APIs and files that should not be public, such as a
.envfile, covered in exposed .env and .git files. - Access: login forms, SSH keys, API tokens and the people who hold them.
- Third parties: scripts you load, hosted services and accounts at your DNS or hosting provider.
The OWASP cheat sheet also gives a separate section on microservice and cloud native applications, where the number of entry points grows quickly.
How to map it and make it smaller
OWASP structures the work as identify and map, measure and assess, then manage. A practical order for a small server:
- List what is reachable from outside. Scan your own addresses from another machine and compare the result with what you expect to be public.
- List every hostname you own, then remove DNS records that point nowhere or to services you no longer run.
- Close what you do not use. The cheat sheet recommends turning off unused features and interfaces and removing old versions and backups. A default-deny policy on the firewall does the same for ports.
- Protect the rest with fewer roles, limited permissions and operational controls such as a web application firewall (WAF), which the cheat sheet names as one.
- Repeat after every change. The cheat sheet says that changes to the surface should trigger a fresh review.
A tool such as Nuclei then checks the exposed parts for known problems. The steps in order are in the VPS security checklist.
What attack surface does not tell you
The surface is a map, not a score. A small surface can still hold one critical hole, and a large one can be well defended, so do not use the number of open ports as a measure of safety. Shrinking the surface lowers opportunity but does not fix a vulnerability in something you must keep exposed, which still needs patching.
Any list is incomplete the day you make it. Forgotten subdomains, an old staging server, a test container started by a colleague and a new third-party script all enter the surface without anyone deciding to add them. Scans find only what they can reach and recognise, and a point behind a login or on a private network may be missed by an outside view.
Finally, the NIST wording extends to a system element and its environment, which includes services, accounts and people around the server. Technical tools show part of that. Keep a short written inventory, assign an owner to each item and review it on a schedule.
Related terms: Port scanning, Subdomain enumeration, Default-deny policy, Firewall, Nuclei.
Frequently asked questions
What is an attack surface in simple terms?
It is every place where an attacker could try to get in or pull data out: open ports, public hostnames, web pages, login forms, APIs and the accounts around them.
What does the NIST definition of attack surface say?
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, affect or extract data.
How do I reduce the attack surface of my VPS?
Close unused ports with a default-deny firewall, delete unused subdomains and services, remove old versions and backups from the web root, and keep the rest patched and behind a login.
Is a smaller attack surface always safer?
It usually means fewer opportunities, but it is not a guarantee. One exposed, unpatched service can still be critical, so surface size is not a security score.
How often should I review my attack surface?
After every change, such as a new service, subdomain or deploy, and on a regular schedule. OWASP says changes to the surface should trigger a fresh review.
Want to see where your own server stands?
Run the free, read-only server check, or open the Security Lab and watch the detect, contain, recover, verify loop in action.
Get your free server checkOpen the Security Lab