Attackers don’t need much. They scan. They find open ports. They test defaults. Tools like Nmap make it trivial to map your infrastructure. If your AWS RDS or EC2-hosted database listens on the public network, it becomes a magnet for probes. You won’t see the knock until they’re already at the door. By then, it’s too late.
Securing AWS database access starts with visibility. You must know exactly which ports are exposed, and to whom. AWS security groups and network ACLs control access, but they’re not bulletproof without strict rules. The first step: lock inbound database ports like 3306, 5432, or 1433 to specific source IPs only. Never use 0.0.0.0/0 unless there’s no alternative, and even then, question why.
Nmap matters here because it’s what your adversaries use. It's also what you should use. Schedule regular internal scans of your AWS environments. Start with:
nmap -p 3306,5432,1433 your-database-endpoint
Run it from outside your VPC and see what responds. If a database answers, it’s exposed to the open network. This is the simplest, fastest way to validate AWS firewall rules. Combine this with CloudTrail logs to trace connection attempts, and enable encryption in transit to block packet sniffing.