How to Configure DMZ Setup
A dmz setup places public servers in a buffer zone between the internet and private networks. You build it by placing firewalls around edge hosts and blocking direct traffic to internal systems. This boundary lets external users reach web apps while keeping backend databases safe from outside attacks. Teams use this layout to contain breaches if an internet-facing server takes damage. How a dmz setup works and safe defaults A demilitarized zone acts as a neutral subnet that sits outside your
Your coding agents run with your access.
Claude Code reaches prod with a developer's credentials, and approval prompts get clicked through. hoop.dev checks every query, masks sensitive data, and holds risky changes for a human.
A dmz setup places public servers in a buffer zone between the internet and private networks. You build it by placing firewalls around edge hosts and blocking direct traffic to internal systems.
This boundary lets external users reach web apps while keeping backend databases safe from outside attacks. Teams use this layout to contain breaches if an internet-facing server takes damage.
How a dmz setup works and safe defaults
A demilitarized zone acts as a neutral subnet that sits outside your core private network. Outside users can reach hosts in this zone, such as web, mail, or DNS servers. Still, hosts in this zone cannot start new network sessions into your private local network.
Two main designs exist for this network layout. A single firewall design uses one device with at least three separate network ports. One port faces the public internet, one serves the private network, and one holds the buffer subnet. This option costs less, but it creates a single point of failure for your team.
A dual firewall design offers stronger safety for high-value systems and sensitive data. The outer firewall filters traffic moving from the public internet into the buffer subnet. The inner firewall filters traffic moving from the buffer subnet into the private network. Using two different firewall vendors stops a single software bug from opening both barriers.
Your config must start with a default deny rule on every firewall interface. Open only the exact ports and protocols required for public web or mail traffic. Never store sensitive customer records or raw database files on hosts inside the perimeter zone.
Routing rules and host hardening in the perimeter
Traffic flow rules decide if your perimeter zone will hold up during an attack. Allow external clients to talk to public hosts only on required service ports. If a public web app needs data from an internal database, limit that path strictly. Configure the inner firewall to accept traffic only on the exact database port and host IP.
Even better, have internal systems pull data from the perimeter zone when possible. You can also place message queues between zones to avoid direct database exposure. Every server in the buffer zone needs strict host hardening before going live.
End-to-End Encryption: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
Remove unused software packages, shut down extra background services, and apply security patches often. Segment the buffer zone further with virtual networks so compromised web servers cannot reach mail servers.
Auditing network rules and what static firewalls miss
Once your perimeter is live, you must test and audit the rules on a regular schedule. Run port scans from outside your network to confirm that only expected ports answer requests. Run tests from a host inside the perimeter zone to confirm the inner firewall blocks private networks.
Send all firewall traffic logs and host event logs to a central log server right away. Watch for blocked outbound requests from perimeter hosts, as these often point to an active breach. Review your firewall rule tables every quarter to remove old routes for retired apps.
While network firewalls block bad ports, they leave large gaps once a user logs in. Static firewall rules only check IP addresses and port numbers at the start of a session. They cannot inspect individual database queries or commands sent inside an allowed admin session. If an engineer logs into an internal server for maintenance, the firewall sees normal traffic. Network boundaries also cannot mask sensitive fields like emails, phone numbers, or card numbers in query results.
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
Should a database server ever sit inside the DMZ?
No, you should keep all primary database servers inside your private internal network. Web apps in the perimeter zone should talk to internal databases through tight inner firewall rules.
Is one firewall enough for a small team dmz setup?
A single firewall with three separate network ports can work for low-risk testing workloads. Production systems that handle customer data should use dual firewalls to stop single-point failures.
How do admins update servers inside the perimeter zone safely?
Admins should originate management sessions from the private internal network into the perimeter zone. Never expose admin ports to the public internet, and require strong multi-factor login checks.
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.
Related guides
In this post