Nmap for Authorized Infrastructure Validation (Not Hacking)
Every deploy makes a promise about the network: "this box only exposes SSH and HTTPS," "the database is never reachable from outside the app tier." Nmap is how you turn that promise into a test that either passes or fails. Nobody has to take the security group's word for it. One rule before anything else: only scan systems you own or are explicitly authorized to assess. Point Nmap at a lab, a VM…
Nmap is a tool used to validate authorized infrastructure by confirming that observed network behavior matches the declared configuration. To perform authorized infrastructure validation, only scan systems that you own or have explicit authorization to assess. The most basic run is a host scan, using nmap <IP address>, which performs host discovery and a default TCP scan of common ports.
Open ports indicate something is accepting connections, while filtered ports usually mean a firewall or security group is blocking the packets. Narrowing the scan to the expected ports keeps the scan fast and the output readable. Service and version detection can be added to open ports using nmap -sV -p <ports> <IP address> to identify the service and version running on each port.
Running Nmap as a pipeline can turn it into a regression test for network posture. The loop for network validation involves declared configuration, expected exposure, observed exposure, comparison, correction, and retesting. A concrete finding might be an unexpected open port that wasn't declared in the configuration, such as MySQL on port 3306 when only SSH and HTTPS were expected.
Correct the issue and retest to ensure the finding is resolved. Nmap's discipline of Declared → Observed → Retest is the core of network validation, turning it into a repeatable post-deploy check.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — it may contain errors, so check the original before relying on it.