Every internet-facing service will eventually be attacked, and the DMZ decides whether that attack stops at the edge or reaches the internal network. A demilitarised zone, also called a screened subnet or perimeter network, is a separate network segment for systems that must accept connections from the internet, with firewall policy on both its internet side and its internal side. This guide is for network architects designing or reviewing that segment: the main design patterns, what should and should not sit in it, a traffic rule matrix, how to manage DMZ hosts without opening a path inwards, and how the same thinking maps to public cloud and zero trust. Wider zone design and east-west policy are covered in the Network Segmentation Guide; this page goes deeper on the internet edge only.
Key takeaways
- Terminate, inspect, re-originate. Internet connections should end on a DMZ proxy or gateway, which then opens a new, filtered connection to a named back end, never a straight port-forward to an internal server.
- Deny by default in all three directions. Internet to DMZ, DMZ to internal and DMZ to internet each need an explicit allow list; outbound from the DMZ is the direction most often left open.
- Assume DMZ hosts will be compromised. Keep credentials, directory trust and management paths off them so a compromise stays contained.
- Management traffic never enters from the internet side. Administer DMZ hosts from a dedicated management network or jump service, with its own authentication and logging.
- The pattern survives in cloud and zero trust. Public subnets, load balancers and per-request access checks are today's screened subnet; the principle of no implicit trust from network position is the same.
What a DMZ is
NIST SP 800-41 Rev. 1, Guidelines on Firewalls and Firewall Policy, notes that there is no single technical definition of a DMZ. In practice a DMZ is a firewall interface or segment for hosts that are reachable from outside, where traffic between the DMZ and the protected network still passes through the firewall and is subject to its policy. The same publication observes that public-facing servers such as web and email servers are commonly placed there, and recommends that firewalls block all inbound and outbound traffic not expressly permitted.
NIST SP 800-53 Rev. 5 control SC-7 Boundary Protection asks organisations to implement subnetworks for publicly accessible system components that are physically or logically separated from internal networks. SC-7(5) Deny by Default, Allow by Exception sets the rule posture. In MITRE ATT&CK v20 terms, the DMZ limits what follows T1190 Exploit Public-Facing Application and T1133 External Remote Services, and it implements mitigation M1030 Network Segmentation (D3FEND D3-NI Network Isolation).
Design patterns (single, dual firewall, three-legged)
| Pattern | How it works | Strengths | Trade-offs | Fits |
|---|---|---|---|---|
| Three-legged (single firewall) | One firewall with three interfaces: internet, DMZ, internal. Policy on the firewall controls every pair | Simple, one rule base, low cost | The firewall is a single point of failure and a single point of compromise; one misconfiguration can expose both zones | Small and mid-sized sites, branch offices |
| Dual firewall (back-to-back) | An outer firewall between internet and DMZ, an inner firewall between DMZ and internal network. Often different products or rule owners | Defence in depth: compromising the outer layer does not open the inner one; separate change control per boundary | Two rule bases to keep coordinated (SP 800-41 warns inner and outer policies must be aligned); more cost and operations | Regulated environments, data centres, high-value services |
| Multiple DMZs | Separate DMZ segments by function or trust: public web, partner/B2B, mail, remote access | A breach of one service does not reach the others; rules stay readable | More segments to route and monitor | Large estates with several classes of external user |
| Reverse proxy only | A proxy or application delivery tier in the DMZ; application servers stay internal and accept connections only from the proxy | The smallest DMZ footprint; WAF and TLS inspection in one place | The proxy becomes a high-value target; must be patched quickly | Web and API publishing |
Choosing: a three-legged design is reasonable where there is one firewall team, a short list of services and good rule review. Move to dual firewalls when an outer-layer compromise would have high impact, when different teams own the edge and the core, or when a regulator or assessor expects layered boundaries. Add separate DMZs once you publish services to distinct audiences, such as customers and partners. Small organisations often gain more from a managed reverse proxy or content delivery service in front of a minimal DMZ than from a second firewall.
What belongs in the DMZ
| Belongs in the DMZ | Stays internal | Why |
|---|---|---|
| Reverse proxies, load balancers, WAF | Application servers behind them | The proxy terminates internet sessions; the app server only sees filtered traffic from a known source |
| Mail relay or secure email gateway | Mailbox servers | The relay accepts SMTP (TCP 25) from the internet and forwards to the internal mail system |
| External DNS (authoritative for public zones) | Internal DNS and directory-integrated DNS | Public records only; never expose internal zone data |
| Remote access gateways (VPN, VDI, ZTNA connectors where applicable) | Directory and identity providers | Gateways authenticate against back ends over tightly scoped ports |
| Public file transfer front ends | File stores and processing systems | Files are scanned and passed inwards by a controlled process |
| Nothing | Databases, domain controllers, management consoles, backup servers | These hold the data and credentials an attacker wants next |
Hosts in the DMZ should not be joined to the production directory forest and should not hold reusable privileged credentials. Edge appliances are identity systems in their own right: in the Ivanti Connect Secure exploitation, attackers harvested user passwords and service account credentials stored on internet-facing VPN gateways, and CISA advised treating those stored credentials as compromised. Inventory every secret held on a DMZ device and be ready to rotate it.
Traffic rules and management access
Write rules as a matrix and review each cell. The examples below are typical defaults to adapt, not a complete rule base.
| Source to destination | Default | Typical allowed exceptions | Notes |
|---|---|---|---|
| Internet to DMZ | Deny | TCP 443 (and 80 for redirect) to the proxy; TCP 25 to the mail relay; UDP and TCP 53 to external DNS; the VPN gateway's published ports | Publish by destination address and port only; rate-limit and use DDoS protection upstream |
| DMZ to internal | Deny | Named proxy to named app server on the application port; mail relay to mailbox server on SMTP; gateway to identity provider on its documented ports | The most important cell: one source, one destination, one port per rule; no "any" in any field |
| Internal to DMZ | Deny | Management network to DMZ hosts on SSH (22) or RDP (3389) or agent ports; monitoring and log collection | Only from the management segment, never from user networks |
| DMZ to internet | Deny | Update repositories, certificate revocation and ACME endpoints, mail relay outbound SMTP | Egress filtering stops reverse shells and data exfiltration from a compromised host; SP 800-41 also recommends blocking outbound traffic with invalid source addresses |
| DMZ host to DMZ host | Deny | Load balancer to its pool members | Use host firewalls or private VLANs so one compromised host cannot scan its neighbours |
| Internet to internal | Deny, no exceptions | None | Any rule here bypasses the DMZ; treat it as a finding |
Jump host and management plane
- Separate management interfaces: put DMZ host and firewall management interfaces on an out-of-band or management VLAN that is not routable from the DMZ data plane or the internet.
- Jump service: administrators connect to a hardened jump host or a brokered access service in the management zone, authenticated with phishing-resistant MFA, and from there to DMZ hosts. Record sessions. See If your jump host and bastion is compromised for the response side.
- No inbound admin from the internet: SSH and RDP are never published to the internet. Remote administrators come in through the remote access service first, then the jump host.
- Machine credentials: deployment pipelines and monitoring agents that reach DMZ hosts use their own scoped, rotated credentials, held in a secrets manager rather than on the hosts.
- Change control: SP 800-41 recommends managing rule sets through formal change management and reviewing them periodically. See the Firewall Management Guide and the Firewall Rule Review Checklist.
Cloud equivalents
Cloud networks do not have a physical DMZ, but the screened subnet maps cleanly onto provider building blocks. Providers are listed alphabetically; each row describes customer-side configuration from the provider's documentation.
| Provider | Screened subnet building blocks | Management access without public admin ports |
|---|---|---|
| Amazon Web Services | A public subnet has a direct route to an internet gateway; a private subnet does not and uses a NAT device for outbound access. Put load balancers in public subnets and instances in private subnets; security groups allow traffic per resource and network ACLs add subnet-level allow and deny rules (the default network ACL allows all traffic, so set your own) | Systems Manager Session Manager reaches managed nodes without open inbound ports, bastion hosts or SSH keys, with IAM-controlled access and session logging to CloudWatch Logs or S3 |
| Google Cloud | External load balancers in front of VMs that have no external IP address; VPC firewall rules restrict ingress to load balancer and health check ranges | Identity-Aware Proxy TCP forwarding tunnels SSH and RDP to VMs without external IPs; allow ingress only from 35.235.240.0/20 on the needed ports and grant roles/iap.tunnelResourceAccessor |
| Microsoft Azure | Hub-spoke topology with a perimeter network firewall in the hub; Azure Firewall in AzureFirewallSubnet (a /26 subnet) inspects traffic, and user-defined routes send spoke traffic through it. Inbound web traffic can terminate on a reverse proxy such as Application Gateway or Front Door, passing the client address in X-Forwarded-For | Azure Bastion in AzureBastionSubnet provides RDP and SSH over TLS on port 443 to VMs that have no public IP address |
The common thread: only the load balancer or proxy tier is internet-reachable, workloads stay private, and admin access goes through an identity-checked broker. Egress still needs filtering; see Cloud Egress Filtering. For the web tier itself, see the Load Balancer Security Guide and the Web Application Firewall Guide.
Where zero trust fits
NIST SP 800-207 rejects implicit trust based on network location: every access request is authenticated and authorised on its own merits. That does not remove the DMZ. It changes what the DMZ is trusted for. Keep the screened subnet as a containment boundary for exposed systems, and add per-request identity checks on the connections that cross it, for example mutual TLS between proxy and back end, or access brokers in place of broad VPN reach. See the NIST SP 800-207 Zero Trust Architecture Guide and Microsegmentation vs ZTNA.
Rolling out or redesigning a DMZ
- Inventory exposure: list every public IP, published port and DNS record, and map each to a host and owner. Compare with an external scan.
- Classify services: decide which belong in the DMZ, which can move behind a reverse proxy, and which should not be exposed at all.
- Build the matrix: write the six-cell rule matrix above for each service before changing anything.
- Stand up the new segment in parallel: deploy the DMZ and management paths, move one low-risk service, and test with logging-only egress rules first.
- Migrate in waves: move services one at a time behind the proxy, switch DNS, and keep the old path available for quick rollback until monitoring is clean.
- Enforce egress: after a week or two of logging, turn outbound rules from log to deny.
- Remove old paths: delete legacy port-forwards and any internet-to-internal rules, then rescan from outside.
Detection and measurement
- Log: firewall allow and deny events for every DMZ boundary, proxy and WAF logs, and authentication logs from DMZ hosts and the jump service.
- Alert on: any new connection from a DMZ host to an internal address outside the allow list; DMZ hosts initiating outbound connections to unknown destinations; admin logins that did not come through the jump service.
- Metrics: number of internet-to-internal rules (target zero); share of DMZ-to-internal rules with a single source, destination and port; count of DMZ hosts with unrestricted egress; mean time to patch internet-facing systems; share of admin sessions brokered and recorded.
Common failure patterns
- Port-forwarding to internal servers: a NAT rule from the internet straight to an internal host means the DMZ is decorative.
- Open egress: DMZ hosts allowed to reach any internet address make it easy to download tooling and exfiltrate data after a compromise.
- Domain-joined DMZ hosts: a compromised web server with a computer account or cached admin credentials gives an attacker a foothold in the directory.
- Credentials stored on edge devices: service account passwords and keys on VPN or proxy appliances become an attacker's next step, as the Ivanti case showed.
- Management on the data plane: SSH or appliance admin consoles reachable from the DMZ or the internet.
- Rule drift: temporary "any" rules added during incidents or migrations and never removed; review against the matrix on a schedule.
Framework mapping
| Framework | Reference | How this page applies |
|---|---|---|
| NIST SP 800-53 Rev. 5 | SC-7, SC-7(5), SC-7(21) | Separated subnetworks for public components, deny by default, isolation of components |
| NIST SP 800-53 Rev. 5 | AC-17, AC-17(3) | Remote and administrative access through managed access control points |
| NIST CSF 2.0 | PR.IR-01 | Networks and environments protected from unauthorised logical access |
| CIS Controls v8.1 | Control 12 Network Infrastructure Management | Establish, implement and actively manage network devices |
| MITRE ATT&CK v20 and D3FEND | T1190, T1133, M1030, D3-NI | Containing exploitation of exposed services through segmentation |
Practitioner checklist
- Inventory every internet-facing address, port and DNS record with an owner.
- Place only proxies, gateways, relays and public DNS in the DMZ; keep data and identity systems internal.
- Write and review the six-cell rule matrix; no "any" in DMZ-to-internal rules.
- Remove every internet-to-internal rule and port-forward.
- Filter DMZ egress to named destinations.
- Keep DMZ hosts out of the production directory and free of reusable privileged credentials.
- Manage DMZ hosts only from a management network through a jump service with MFA and session recording.
- In cloud, keep workloads in private subnets and use brokered admin access instead of public SSH or RDP.
- Patch internet-facing systems on an accelerated schedule and rescan from outside after changes.
Standards and references
- NIST: SP 800-41 Rev. 1 Guidelines on Firewalls and Firewall Policy
- NIST: SP 800-207 Zero Trust Architecture
- NIST: SP 800-53 Rev. 5 Security and Privacy Controls
- CIS: Control 12 Network Infrastructure Management
- MITRE ATT&CK: M1030 Network Segmentation
- AWS: Subnets for your VPC
- Google Cloud: Using IAP for TCP forwarding
- Microsoft Learn: Hub-spoke network topology in Azure
Related NHI Mgmt Group resources: Network Segmentation Guide · Firewall Management Guide · Web Application Firewall Guide · NIST SP 800-207 Zero Trust Architecture Guide