A DMZ (demilitarised zone) is a separate slice of your network for the servers the internet has to reach, such as a website or a public API. It sits between the outside world and your private systems, so that if a public server is broken into, the attacker lands in a small, fenced-off area instead of next to your databases.
Why public servers need their own zone
Every network has two kinds of thing in it. Some systems are private: databases, file shares, internal dashboards, build servers, the payroll app. Nobody outside the organisation should ever talk to them directly. Other systems are public on purpose: a web server, a mail server, a DNS server, an API. Their whole job is to answer requests from strangers.
Public servers are the ones most likely to be attacked. They accept input from anyone, they run a lot of code, and a single bug in that code (an unpatched library, an injection flaw, a weak admin password) can hand an attacker control of the machine. If that machine sits on the same flat network as everything else, the attacker can now reach every private system as if they were an employee.
A DMZ fixes the placement problem. Public servers go in their own zone, and firewalls decide exactly which traffic may cross between the internet, the DMZ and the internal network. Other names for the same idea are 'perimeter network' and 'screened subnet'.
How a DMZ is laid out
There are three zones, each with a different level of trust:
- The internet: untrusted. Anyone can be on the other end.
- The DMZ: semi-trusted. It holds the public-facing servers and nothing else.
- The internal network: trusted. It holds the private systems and the people who use them.
The firewalls between them control the doors. There are two common ways to build it.
Two firewalls
The classic layout puts one firewall between the internet and the DMZ, and a second between the DMZ and the internal network. Traffic from outside has to pass the outer firewall to reach the DMZ, and anything leaving the DMZ for the inside has to pass the inner one as well. Some organisations use firewalls from two different vendors here, so that a flaw in one product doesn't open both doors at once.
Wondering how this was made? How we make these