DMZ Firewall Topology

Published
Length
3 min read

Luis Felipe Dias

All posts

A dmz firewall topology places public servers in a buffer zone between two networks. You set up firewall rules to block direct traffic from the web to private systems. Teams often build this zone to host web servers and public APIs. When firewall rules or roles are too broad, attackers can move into internal databases. A single wide rule can expose private data to the public web. How a dmz firewall topology works in practice Network teams build this buffer zone using either one or two firewal

Firewall Configuration: the complete guide

Architecture patterns, implementation strategies, and security best practices. Delivered to your inbox.

Free white paper. No spam. Unsubscribe anytime.

A dmz firewall topology places public servers in a buffer zone between two networks. You set up firewall rules to block direct traffic from the web to private systems. Teams often build this zone to host web servers and public APIs. When firewall rules or roles are too broad, attackers can move into internal databases. A single wide rule can expose private data to the public web.

How a dmz firewall topology works in practice

Network teams build this buffer zone using either one or two firewalls. In a single firewall design, the device uses three or more network ports. One port faces the public web, and one faces the private network. The third port holds the buffer zone for public servers. All traffic must pass through this single device to move between zones. The firewall checks packet headers against a list of port and IP rules.

In a dual firewall design, teams place two separate firewalls around the buffer zone. The outer firewall filters traffic coming from the public web into the zone. The inner firewall filters traffic moving from the zone into the private network. Many teams use different firewall vendors for the outer and inner barriers. If an attacker finds a flaw in the outer device, the inner wall still holds. Both designs rely on strict port rules and IP lists to control traffic flow.

Choosing between single and dual firewall layouts

A single firewall layout costs less money and takes less time to manage. Small teams often pick this route to keep their network rules in one place. Still, this layout creates a single point of failure for the whole network. If one rule breaks or the hardware fails, the private zone is at risk.

A dual firewall layout separates public rules from internal rules across two devices. The outer team can manage web traffic while the inner team guards databases. This split reduces the chance that one bad rule exposes internal systems. Still, both layouts only check network addresses and ports at the border.

Firewall Configuration: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

What network rules solve and what they miss

A dmz firewall topology stops direct connections from the web to private servers. It forces incoming packets to stop at a public server in the buffer zone. It also limits which network ports can open between the buffer zone and databases. This setup works well to block port scans and basic network attacks.

Still, network firewalls only decide which machine or user can open a session. Once a session opens on an allowed port, the firewall steps back. It does not read the database queries or shell commands inside that session. If an engineer or app logs in with broad database roles, the firewall allows it. A valid session can still drop tables or pull millions of customer emails. Network rules also cannot mask phone numbers, card numbers, or national IDs in results. To control what happens inside a session, teams need controls at the command level.

Add runtime guardrails and masking beside your databases and APIs

Login rules, role grants, and CI checks govern who connects to your stack. Yet any allowed script, engineer, or AI agent still runs commands with the full scope of its role. For workloads on Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes, SSH, or internal HTTP services, hoop.dev sits beside the service as an open-source proxy, a sidecar for your database or API.

Before a query runs, hoop.dev guardrails check the statement against your rules. An AI Analyzer you configure can score intent or hold risky calls for human review. Next, hoop.dev data masking rewrites sensitive fields in responses, and each verdict is logged per listener. Explore the MIT-licensed project on GitHub.

Frequently asked questions

What is the main goal of a DMZ network?

The main goal is to keep public servers separate from your private internal network. If an attacker breaks into a public web server, they cannot reach private databases.

Should databases live inside the DMZ?

No, databases that hold private data should stay inside the internal network zone. Public servers in the buffer zone should only talk to databases over strict port rules.

Why do network firewalls miss bad database queries?

Network firewalls check IP addresses and ports when a connection starts. They do not inspect or block specific SQL statements or shell commands inside encrypted sessions.

Save the open-source gateway.

hoop is MIT-licensed infrastructure for controlling how AI agents reach production data. Star hoophq/hoop so you can inspect it, deploy it, or share it when your team starts governing agent access.