Linux DMZ

Published
Length
3 min read

Luis Felipe Dias

All posts

You set up a linux dmz by placing public servers on an isolated subnet. Packet filters sit between the public net, this zone, and private hosts. Most teams build this layout with dual firewalls or one multi-port router. This design keeps web and mail hosts away from private data stores. Yet broad host roles inside the zone still create big risks. Once an attacker or user logs in, broad permissions let them run any command. How a native linux dmz architecture works A linux dmz uses network rul

Linux Capabilities Management: 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 a linux dmz by placing public servers on an isolated subnet. Packet filters sit between the public net, this zone, and private hosts. Most teams build this layout with dual firewalls or one multi-port router. This design keeps web and mail hosts away from private data stores. Yet broad host roles inside the zone still create big risks. Once an attacker or user logs in, broad permissions let them run any command.

How a native linux dmz architecture works

A linux dmz uses network rules to split traffic into distinct trust zones. The outer filter takes traffic from the web and sends it to public hosts. These public hosts run web apps, mail relays, or file servers. The inner filter blocks direct traffic from the public net to private subnets. If a public host needs private data, it must use a strict rule. The router checks the source address, target port, and protocol of every packet. Admins also set up local packet filters on each Linux host. They turn on kernel forwarding on the routing box to move packets across ports. Network address translation rewrites public addresses to private ones inside the perimeter subnet. Each interface sits on its own virtual local area network to stop layer two hops.

How host rules work inside the perimeter zone

Network filters are only the first step in a solid zone design. Teams must also lock down the Linux hosts that live inside the subnet. Admins remove extra tools, compilers, and unused apps from every public box. They set up local accounts with minimal roles for each running service. System logs go to a central log box inside the private network. That way, an attacker who breaks into a public host cannot wipe the logs. Admins also use mandatory access tools in the kernel to restrict file reads. When an engineer needs to fix an app, they log in over an encrypted port. They use key files and role switching tools to run root tasks.

What network zones solve and the gap they leave open

This network layout stops outside scanners from reaching your private data stores. If a web server falls, the inner firewall blocks network scans to internal hosts. It sets a clear path for packets moving in and out of your servers. Still, network rules and host roles only decide who can open a session. They do not inspect what individual commands or queries do during that session. An engineer who logs in with a valid key gets a full shell. A compromised web app with a valid database user can still pull all rows by default. Firewall rules see valid ports and let the traffic pass right through. Host logs record that a login happened, not the full context of each action. Static keys and shared admin roles make it hard to trace who ran a bad command. You cannot mask sensitive fields like emails or card numbers with packet filters alone.

Linux Capabilities Management: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

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 runs beside those services as an open-source proxy, a sidecar for your Postgres or API. It inspects requests coming in and results going back on the wire.

Your login details and client tools stay as they are while hoop.dev guardrails refuse bad deletes or drops before they run. On responses, hoop.dev data masking rewrites matched sensitive values 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

Do I need two separate firewalls to build a linux dmz?

No, you can use a single Linux router with three network ports. One port connects to the web, one to the zone, and one to private hosts. Two separate firewalls add extra safety if one box fails or has a bug.

Should databases ever live inside the perimeter subnet?

No, you should keep all primary databases inside the private internal network. Public apps in the zone should only talk to databases over strict firewall rules. Placing data stores in the public zone exposes them if a web host falls.

How do admins safely manage Linux hosts in the zone?

Admins should never open management ports to the public internet. Instead, they log in from the internal network through the inner firewall. Every admin session should check user identity and log every command run on the host.

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.