DMZ Concept

Published
Length
3 min read

Luis Felipe Dias

All posts

You apply the dmz concept by placing public servers in an isolated perimeter subnet. Firewalls sit on both sides of this buffer zone to filter all network packets. Teams build this setup to keep external users away from private internal systems. Yet broad firewall rules or shared roles inside the network still expose backend data. How the dmz concept works in network architecture A demilitarized zone acts as a neutral network segment between two distinct zones. It sits between the public inte

Concept: the complete guide

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

Free white paper. No spam. Unsubscribe anytime.

You apply the dmz concept by placing public servers in an isolated perimeter subnet. Firewalls sit on both sides of this buffer zone to filter all network packets. Teams build this setup to keep external users away from private internal systems. Yet broad firewall rules or shared roles inside the network still expose backend data.

How the dmz concept works in network architecture

A demilitarized zone acts as a neutral network segment between two distinct zones. It sits between the public internet and your private internal network. Public web servers, mail relays, and DNS servers live inside this middle subnet. Outside users can reach the services in this zone to load web pages. They cannot cross directly into the private network where sensitive databases run.

Engineers set up this layout using either one firewall or two separate firewalls. In a single firewall design, the device uses three separate network interfaces. One port connects to the internet, one feeds the buffer zone, and one guards the private network. In a dual firewall design, an outer firewall filters traffic from the public internet. An inner firewall then blocks unauthorized traffic from moving into the private zone.

When a public request arrives, the outer firewall checks the destination port and address. It sends valid traffic to the web server inside the perimeter subnet. If that web app needs data, it opens a session to the internal database. The inner firewall checks that request against strict rules before allowing it through. If an attacker breaks into the web server, the inner firewall blocks lateral movement.

What perimeter zones solve and what they miss

This network layout stops external attackers from scanning your private servers directly. It limits the blast radius when a public web server gets compromised. Network engineers can monitor traffic crossing between zones and drop bad packets early. This separation forms a core layer of defense for any modern cloud setup.

Still, network zones only control which machines can open a socket to each other. Once a developer or app crosses the firewall, the network stops inspecting actions. Engineers still need direct access to internal databases and servers to fix issues. Teams often open VPN paths or firewall ports for these daily support tasks.

Concept: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

A firewall rule decides who connects, not what commands run inside the session. An engineer with a valid database role can still run a bad query. They might drop a table by mistake or read raw customer emails and card numbers. Network logs show that a packet passed through the configured port at a certain time. They do not show the exact SQL query or command that ran. Relying on network zones alone leaves a major gap in day-to-day data security.

Moving from network zones to command-level control

Modern cloud setups need controls that work inside the session, not just at the border. Teams should pair network isolation with fine-grained rules for every query and command. When an engineer queries a database, the system should check the exact statement first. Data masking can rewrite matched fields like phone numbers or national IDs in results. This approach keeps sensitive records safe even when a user has network access.

Check database and API queries on the wire

Identity tools, roles, and network rules decide who opens a session. Setup alone cannot check what each query does or mask sensitive values in a response once a session starts. When workflows touch Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes APIs, SSH, or internal HTTP APIs, hoop.dev sits inline in the wire protocol beside those services as an open-source proxy, a sidecar for your Postgres or API. On every query an AI agent or engineer runs against production, hoop.dev decides to pass, mask, block, or hold it for human review.

Your login details and client tools stay as they are while hoop.dev guardrails refuse bad deletes or drops before they run, and hoop.dev data masking rewrites matched sensitive values in responses in memory. Furthermore, hoop.dev holds SOC 2 Type II, is MIT licensed, and writes every query and decision to an audit trail that generates evidence for HIPAA, GDPR, and PCI DSS. See the source on GitHub.

Frequently asked questions

What services belong inside a DMZ subnet?

Any server that accepts traffic from the public internet belongs in this zone. Common examples include web servers, API endpoints, email relays, and public DNS resolvers. Databases and internal business tools must stay inside the private network zone.

Why use two firewalls instead of one for a DMZ?

Two firewalls from different vendors prevent a single software flaw from exposing your private network. If an attacker bypasses the outer firewall, they still face a different inner firewall. One firewall with three ports costs less and is easier to manage.

Does a DMZ protect against internal database mistakes?

No, a perimeter subnet only filters network traffic between public and private zones. Once an authorized user logs into an internal database, the firewall cannot inspect queries. You need command-level rules and data masking to stop risky queries inside the session.

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.