Why you need it

A database put straight on the internet answers anyone who finds it. Programs scan the whole internet all day for open databases, and thousands have been emptied this way. Most servers never need to talk to strangers at all.

Think of it like this

A guest list at a door. The person at the door does not judge faces: if your name is on the list you come in, and if it is not you stay outside.

Where you’ll find it

  • AWS: Security groups are a list on each server that says which calls may come in. Anything not listed is refused.
  • Google Cloud: VPC firewall rules allow or refuse calls into a private network, with "refuse everything else" by default.
  • Kubernetes: Network policies are the same list for the programs inside a cluster.
  • Linux: nftables is the firewall built into Linux, used on a single server.

What to know first

Inside the network. Servers that can reach each other directly, but cannot be reached from the internet unless a rule lets a call in.

Call. One program asking another for something, like GET /shoes or read users.

How it works

  1. Open by default. On the open internet, anyone can ask the database for every user, and it answers. This is the first beat of the animation.
  2. Put the servers inside. Move the shop and the database inside a network, and put a firewall at its edge. Now every call from outside passes the firewall first.
  3. Only what is on the list. The firewall's list has two rows: allow anyone → shop and refuse everything else. A visitor's call to the shop matches row 1 and gets in. Inside, the shop reaches the database. A call to the database from outside matches only row 2: refused. Real lists name exact ports and address ranges, but the idea is these two rows.
  4. The list checks where, not who. The firewall does not know who is good. It checks where a call goes. A stranger who asks the shop gets in just like a visitor. And anyone who gets inside, through a bug in the shop, is trusted by everything there. That gap is why mTLS and zero trust exists.
  5. How Ben gets in to work. Developers still need to reach servers inside. Instead of opening the list to them, they go through one guarded door, such as a single login server or a company VPN, and prove who they are with a private key. See Public and private keys.

An example

A shop has 1 web server and 1 database. Bots try to reach the database from the internet about 2,000 times a day.

With no firewall, one guessed or empty password is enough, and all 500,000 user records are copied.

With the two-row list, all 2,000 calls are refused at the edge. Only the shop, from inside, can reach the database.

Further reading