DMZ Forwarding

Published
Length
3 min read

Luis Felipe Dias

All posts

You set up dmz forwarding to send public traffic to a safe middle network zone. This step keeps outside users away from your private servers and data stores. Teams build two walls of network rules to manage this traffic flow. The outer wall takes web packets and sends them to a middle host. The inner wall checks if that middle host can talk to the private backend. When teams make these network rules too broad, attackers can move inside fast. A single open port can expose the whole private zone t

SSH Agent Forwarding 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 forwarding to send public traffic to a safe middle network zone. This step keeps outside users away from your private servers and data stores. Teams build two walls of network rules to manage this traffic flow. The outer wall takes web packets and sends them to a middle host. The inner wall checks if that middle host can talk to the private backend. When teams make these network rules too broad, attackers can move inside fast. A single open port can expose the whole private zone to bad commands.

How dmz forwarding works in a network

A perimeter network sits between the public web and your private internal systems. When an outside client sends a request, the outer router catches the packet first. The router reads the target address and port on that incoming network packet. It then rewrites the destination address to match a server in the middle zone. This step is the core action of dmz forwarding in daily operations.

Public web servers, mail relays, and file hosts often live in this middle zone. These hosts need to talk to outside users and internal databases at once. To make this work, admins write strict port and address rules on two firewalls. The outer firewall allows public requests to reach only specific middle zone hosts. The inner firewall lets those middle hosts send queries to specific private database ports. All other direct traffic from the public web to the private zone gets dropped.

Setting up perimeter rules and route tables

To build this setup, network teams first assign static private addresses to middle hosts. Next, they create address translation rules on the edge firewall for public traffic. Each rule maps one public port to one internal host and port pair. Teams also set up stateful inspection so return traffic can find its way back. The firewall tracks active sessions in a state table and drops unasked packets.

After the outer rules work, the team sets up the internal firewall rules. They open only the exact database or service ports that the middle app needs. They also restrict the source address to the single middle host that needs it. Teams must review these route tables every time an app changes its port. If an engineer adds a new service, someone must update both firewalls by hand.

SSH Agent Forwarding Security: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

What native network rules solve and what they miss

Perimeter routing stops direct network scans against your most sensitive backend servers. Outside attackers cannot ping or reach your private database ports from the public web. If a public web server fails or gets hit, the inner wall holds firm. Network teams get a clear choke point to log packet headers and drop floods. This layout solves basic network isolation and reduces the surface area on the web.

Still, port and address rules only check where a packet comes from. Once a packet passes the firewall, the network rule cannot see what is inside. It decides which host can open a session, not what commands run inside it. If an engineer or app uses a valid path, the firewall lets everything through. It cannot block a bad query or rewrite sensitive fields like card numbers. Network rules also cannot mask emails, phone numbers, or national IDs in flight. Teams still lack visibility into the exact statements and actions that users run.

Govern statements and responses across databases and APIs

Good config and scoped roles are needed setup. They do not check single queries in flight or mask sensitive fields in returned rows. Across Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes APIs, SSH, and internal HTTP endpoints, hoop.dev runs beside each supported service as an open-source proxy, a sidecar for your database or API.

First, hoop.dev guardrails block banned queries before they run. Then hoop.dev data masking rewrites matched sensitive values in responses in memory. The audit trail records every statement and verdict per resource. Furthermore, hoop.dev holds SOC 2 Type II and is open source on GitHub.

Frequently asked questions

What is the difference between port forwarding and a DMZ host?

Port forwarding sends only single ports to an internal machine. A full DMZ host ruleset sends all unmatched public ports to one isolated server. Teams prefer single port rules because opening all ports creates huge security risks.

Why do teams use two firewalls for a perimeter zone?

Two firewalls create separate rule boundaries for public traffic and private backend data. The outer wall blocks public noise, while the inner wall protects private databases. Even if the outer wall fails, the inner wall still stops direct internal reach.

Can dmz forwarding inspect database queries or shell commands?

No, standard network forwarding operates at the network and transport layers of traffic. It checks IP addresses and port numbers, not the actual commands inside the session. You need command-level controls to inspect queries or mask sensitive data fields.

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.