DMZ Routing

Published
Length
3 min read

Luis Felipe Dias

All posts

You set up dmz routing by placing public apps in an isolated subnet between two firewalls. You then write strict route tables that control traffic moving from the web to private databases. Network teams often build these perimeter zones to keep external users away from internal data stores. Still, when engineers need to fix live servers, teams often open broad port rules across zones. Overly broad rules let an attacker move from a public web server straight into private backends. How dmz routi

SNI-Based Routing Security: the complete guide

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

Free white paper. No spam. Unsubscribe anytime.

You set up dmz routing by placing public apps in an isolated subnet between two firewalls. You then write strict route tables that control traffic moving from the web to private databases. Network teams often build these perimeter zones to keep external users away from internal data stores. Still, when engineers need to fix live servers, teams often open broad port rules across zones. Overly broad rules let an attacker move from a public web server straight into private backends.

How dmz routing works in practice

A perimeter network sits as a buffer zone between the untrusted public internet and your private network. In a dual-firewall layout, an external firewall faces the internet and filters incoming public requests. This outer firewall forwards allowed web traffic only to specific hosts inside the buffer subnet. Those public-facing hosts handle user requests, run web servers, or process incoming API calls.

An internal firewall sits behind the buffer zone to guard your private data network. The route table in the buffer zone knows only how to reach approved internal ports. For example, a web app in the buffer zone can talk to one database port inside. Direct routes from the public internet to the private network do not exist in the table. Every packet must stop at a host in the buffer zone before moving deeper inside.

Teams also use network address translation to hide private IP addresses from outside callers. Incoming packets hit a public IP address, and the outer router rewrites the destination address. Return traffic follows the reverse path back through the outer firewall to the user. If a host in the buffer zone tries to scan the private subnet, the inner firewall drops it.

Where native network routing falls short

Network routing and firewall rules do a great job of blocking unwanted IP addresses and ports. They stop public scanners from reaching your internal databases or private app servers directly. They also limit which servers can open a network path into your core data zone.

Still, a route table only checks where a packet comes from and where it goes. Once a packet passes the inner firewall on an open port, network rules stop helping. The router cannot tell if an approved connection carries a safe read query or a destructive delete command. It also cannot tell which individual engineer is typing commands over a shared server path.

When developers need to debug a database inside the private zone, teams often poke holes in firewalls. They add temporary source IP rules or allow broad SSH paths through the buffer zone. Those temporary rules pile up over months and weaken the whole perimeter design. Even worse, anyone who compromises a host in the buffer zone can ride those open routes inside. Once inside the database session, raw query results return sensitive fields like emails, phone numbers, and card numbers. Network routing has no way to inspect queries in flight or rewrite sensitive fields in results.

SNI-Based Routing Security: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Steps to tighten perimeter route tables

Start by listing every host that truly needs to accept traffic from the public internet. Move any internal tools or admin dashboards out of the public buffer subnet right away. Next, review your inner firewall rules and remove any broad subnet-to-subnet allowances. Replace wide port ranges with single-port rules tied to specific host IP addresses.

Set your default route policy to drop all traffic that does not match an explicit rule. Block outbound internet access from the buffer zone unless a service needs to call an external API. Log every dropped packet at the inner firewall so your team can spot lateral movement early. Finally, pair your network rules with controls that inspect actual commands and mask sensitive data in results.

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 is the main goal of dmz routing?

The main goal is to isolate public-facing servers from your private internal network. If an attacker compromises a public web server, strict route rules block them from reaching private databases.

Should a database ever sit inside the DMZ subnet?

No, databases that hold private records belong in an internal subnet behind a second firewall. The buffer subnet should only hold stateless web servers or reverse routers that handle public traffic.

Why are firewall rules and route tables not enough for database security?

Routers and firewalls only check IP addresses and port numbers when a connection starts. They cannot inspect individual SQL statements, log user identities, or rewrite sensitive fields like card numbers in results.

Short role checks help teams work fast. Simple rules make each review clear. Good logs keep every team safe. Scoped keys stop bad changes early.

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.