Network Segmentation Policy Template
A template for documenting network security zones, segmentation rules, and traffic controls between environments and tenants.
Overview
A Network Segmentation Policy defines how an organization’s network is divided into isolated zones based on trust levels, data sensitivity, and functional requirements. This template documents the purpose of each zone, the allowed traffic between zones, and the controls that enforce isolation. It supports a zero-trust architecture and compliance with standards like PCI-DSS, HIPAA, and SOC 2. For documenting security findings after segmentation testing, use the penetration test report template. To align segmentation with decommissioning work, see the system decommissioning checklist.
When to Use
- Defining network architecture for a new cloud or data center environment.
- Preparing for a security audit or compliance certification.
- Onboarding a new tenant or business unit that needs isolation.
- After a lateral movement incident or segmentation gap is identified.
- Migrating from a flat network to a zero-trust model.
Skip it for isolated lab networks or single-host proof-of-concepts where a couple of ACL rules cover the whole threat model.
Prerequisites
- An inventory of current subnets, VPCs, and virtual networks.
- A data classification scheme identifying sensitive vs. public data.
- A list of critical systems and their communication patterns.
- Ownership from network, security, and platform engineering teams.
Solution
Template
1. Policy Statement
All production systems, sensitive data, and privileged access paths must reside in network segments separated from public, development, and guest networks. Traffic between segments is allowed only through approved paths, inspected by firewalls, and logged for monitoring.
2. Network Zones
| Zone | Trust Level | Purpose | Examples |
|---|---|---|---|
| Public | Untrusted | Internet-facing entry points | Load balancers, CDN, WAF |
| DMZ | Low | Services that accept public traffic | Web servers, API gateways |
| Application | Medium | Internal business logic | App services, microservices |
| Data | High | Databases and persistent storage | PostgreSQL, S3, caches |
| Management | High | Administrative interfaces | Bastion, VPN, jump hosts |
| Development | Restricted | Engineering and test workloads | CI/CD runners, dev VMs |
| Guest | Untrusted | Visitor or contractor access | Guest Wi-Fi, contractor VPN |
3. Allowed Traffic Matrix
| Source Zone | Destination Zone | Allowed | Protocol / Port | Justification | Control |
|---|---|---|---|---|---|
| Public | DMZ | Yes | HTTPS 443 | Public web traffic | WAF + firewall |
| DMZ | Application | Yes | HTTPS 443 | API requests | Application firewall |
| Application | Data | Yes | DB-specific | Application queries | Database firewall |
| Development | Production | No | Any | Segregation of duties | Default deny |
| Guest | Management | No | Any | Protect admin paths | Default deny |
4. Segmentation Controls
| Control | Implementation | Owner | Frequency |
|---|---|---|---|
| Firewall rules | Cloud security groups / on-prem firewall | Network team | Quarterly review |
| Route tables | Subnet-level routing enforced | Platform team | Per change |
| Network ACLs | Additional stateless filtering | Security team | Quarterly review |
| Microsegmentation | Workload-level policies | Platform team | Per change |
| DNS filtering | Block known malicious domains | Security team | Continuous |
| VPN / Zero-trust | Identity-based access for remote users | IAM team | Per change |
5. Exception Handling
| Exception ID | Description | Risk | Approved By | Expiration | Monitoring |
|---|---|---|---|---|---|
| EX-001 | Dev access to staging DB | Medium | Security lead | 2026-09-30 | Session recording |
| EX-002 | Vendor integration over VPN | Low | Compliance officer | 2026-12-31 | Traffic logs |
6. Roles and Responsibilities
| Role | Responsibility |
|---|---|
| CISO | Owns policy and risk acceptance |
| Network team | Implements firewall and routing rules |
| Security team | Reviews exceptions and validates controls |
| Platform team | Applies microsegmentation and cloud policies |
| Compliance team | Maps policy to frameworks and audits evidence |
Explanation
Segmentation limits the blast radius of a breach by preventing attackers from moving laterally between zones. The policy turns an abstract network architecture into enforceable rules, documented justifications, and accountable owners. Combining coarse segmentation (zone-level firewalls and routing) with microsegmentation (workload-level policies) gives you defense in depth rather than a single perimeter wall.
Watch east-west traffic specifically. Perimeter controls filter north-south traffic — client to server — but most real lateral movement happens east-west: application tier to data tier, service to service, developer laptop to management plane. That’s why the matrix rows between internal zones matter more than the internet-facing ones, and why workload-level policies carry more weight than one big edge firewall. A network that inspects everything at the front door and nothing after it fails quietly for months.
The business case most teams lead with is PCI-DSS: adequate segmentation is what lets you argue that non-cardholder networks are out of scope for assessment — PCI SSC guidance on network segmentation makes this explicit, which is why auditors ask for the traffic matrix and the exception log before anything else. Under zero trust the same logic scales down to the workload: identity, not subnet membership, decides what may talk to what.
Mapping the Policy to Compliance Frameworks
Different consumers read the same sections differently, so it helps to know what each framework pulls from this document:
| Framework | What it wants from this policy |
|---|---|
| PCI-DSS | Proof that CDE-adjacent segments are isolated; segmentation testing evidence at least annually |
| SOC 2 | Documented trust boundaries plus change control on firewall rules (CC6, CC8) |
| HIPAA | Segregation of ePHI-bearing systems and audit logging of access paths |
| Zero trust (NIST SP 800-207) | Per-resource enforcement and continuous verification, not a trusted internal network |
If the policy exists only to satisfy an audit checkbox, write the traffic matrix anyway — it’s the artifact that survives framework changes, because every framework ultimately asks the same question: who can reach what, and how do you know?
Adopting the Policy
A segmentation policy that goes straight from document to firewall rules usually breaks something loud on a Friday. Roll it out in stages:
- Inventory and classify. Map every subnet, VPC, and workload to a candidate zone and a data classification. The discovery gap you find here is the real problem the policy exists to fix.
- Capture actual flows. Export flow logs (VPC Flow Logs, firewall logs, service mesh telemetry) for two to four weeks. The traffic matrix should describe observed flows, not hoped-for ones.
- Publish the matrix for review. Have each service owner sign off on the flows their zone needs; every approved row gets a justification, everything else becomes a candidate for deny.
- Enforce in monitor mode first. Apply the controls in log-only or dry-run mode — security group auditing, Calico staged policies — and watch what would have been denied.
- Cut over by zone, not all at once. Start with the lowest-risk boundary (guest or dev isolation), verify for a week, then move inward toward the data zone.
- Handle exceptions before they become permanent. Every exception enters the register with an owner and an expiration date on day one.
- Review on a cadence. Quarterly for the matrix and the exception register, per-change for rules, and annually for full segmentation testing.
Expect step 2 to surface flows nobody can explain — a forgotten monitoring agent polling production, a contractor VPN route nobody removed, a service hardcoded to a public IP instead of the internal DNS name. Those shadow flows are the policy working as intended before a single rule is written. Resist the urge to legitimize them by adding rows to the matrix: investigate each one, fix the ones that shouldn’t exist, and only then document what remains. A traffic matrix that rubber-stamps whatever was already happening isn’t a policy; it’s an incident report waiting for a timestamp. The same discipline applies to the exceptions register — if a flow can’t name an owner and a reason, it doesn’t get a row, it gets a ticket.
Denied traffic is also free telemetry. Route deny logs somewhere searchable and alert on repeated attempts — a service retrying a blocked port every thirty seconds is either a misconfiguration you just created or an attacker probing the boundary you just built.
Filled Example
This is what the policy looks like partially filled in for a small SaaS on AWS — a three-tier app with a compliance driver:
## Network Zones (extract)
| Zone | Trust | Implementation | Members |
|------|-------|----------------|---------|
| dmz | Low | Public subnet + ALB SG | prod-alb, prod-waf |
| app | Medium | Private subnet + app SG | api-service, worker-fleet |
| data | High | Private subnet + db SG | postgres-main, redis-sessions |
| mgmt | High | Bastion SG + SSM | bastion-01 |
## Traffic Matrix (extract)
| Source | Dest | Allowed | Port | Justification | Control |
|--------|------|---------|------|---------------|---------|
| app | data | Yes | 5432 | ORM and session store | db SG ingress |
| mgmt | app | Yes | 22 | Break-glass SSH (SSM preferred) | app SG ingress |
| ci-runner | app | No | Any | Deploys go through SSM only | Default deny |
## Exceptions (extract)
| ID | Description | Risk | Approved | Expires | Monitoring |
|----|-------------|------|----------|---------|------------|
| EX-003 | Data team read-replica access for debugging | Medium | CISO | 2026-11-30 | Session logs + query audit |
Two details worth copying from this example. The deny rows have a justification too — “Deploys go through SSM only” is the kind of line that prevents the next person from reopening the path casually. And the exception carries both an owner and an expiry: EX-003 will either be renewed with evidence or die on its date, not linger as permanent shadow access.
Variants
- Cloud-native segmentation policy: Uses VPCs, security groups, and IAM-based network controls in AWS, Azure, or GCP — the natural fit when the whole footprint lives in one provider.
- Container network policy: Focuses on Kubernetes NetworkPolicy, service meshes, and namespace isolation for clusters that host many tenants side by side.
- Multi-tenant segmentation: Defines isolation between customers, business units, or environments in a shared platform, where a breach in one tenant must never reach another.
- Critical-system air gap: Documents fully isolated segments for industrial control or high-sensitivity systems that accept a physical or logical gap instead of any routable path.
What Works
- Start with a default-deny posture and explicitly allow required traffic.
- Document business justification for every cross-zone flow — including the denies.
- Avoid overly broad rules that span several zones.
- Automate rule validation using network reachability tests.
- Review firewall rules quarterly and after architecture changes.
- Log and monitor denied traffic for attack indicators.
- Map policy requirements to compliance controls.
Common Mistakes
- Leaving production and development in the same network segment.
- Creating firewall rules without documenting their purpose.
- Allowing broad IP ranges instead of specific workloads.
- Not reviewing exceptions and letting them expire.
- Ignoring east-west traffic between application services.
- Relying only on perimeter firewalls without internal segmentation.
Advanced Solutions
Automated network reachability testing with AWS
Verify that segmentation rules are actually enforced by testing reachability between zones:
import time
import boto3
from dataclasses import dataclass
from typing import List, Tuple
@dataclass
class ReachabilityTest:
source_instance: str
destination_ip: str
destination_port: int
expected_result: str # "allow" or "deny"
zone_pair: str # e.g., "DMZ -> Application"
class NetworkReachabilityValidator:
def __init__(self, region: str = "us-east-1"):
self.ssm = boto3.client("ssm", region_name=region)
def run_test(self, test: ReachabilityTest) -> Tuple[bool, str]:
"""Run a single reachability test via SSM."""
try:
response = self.ssm.send_command(
InstanceIds=[test.source_instance],
DocumentName="AWS-RunShellScript",
Parameters={
"commands": [
f"timeout 5 bash -c 'echo > /dev/tcp/{test.destination_ip}/{test.destination_port}' "
f"2>/dev/null && echo 'REACHABLE' || echo 'UNREACHABLE'"
]
},
)
command_id = response["Command"]["CommandId"]
time.sleep(5)
output = self.ssm.get_command_invocation(
CommandId=command_id,
InstanceId=test.source_instance,
)
actual = "allow" if "REACHABLE" in output.get("StandardOutputContent", "") else "deny"
passed = actual == test.expected_result
status = "PASS" if passed else "FAIL"
message = f"{status}: {test.zone_pair} - Expected {test.expected_result}, got {actual}"
return passed, message
except Exception as e:
return False, f"ERROR: {test.zone_pair} - {str(e)}"
def validate_segmentation(self, tests: List[ReachabilityTest]) -> None:
"""Run all reachability tests and report results."""
passed = 0
failed = 0
for test in tests:
ok, msg = self.run_test(test)
print(msg)
if ok:
passed += 1
else:
failed += 1
print(f"\nResults: {passed} passed, {failed} failed out of {len(tests)} tests")
# Example usage
tests = [
ReachabilityTest("i-dmz001", "10.0.2.10", 443, "allow", "DMZ -> Application"),
ReachabilityTest("i-dmz001", "10.0.3.10", 5432, "deny", "DMZ -> Data"),
ReachabilityTest("i-app001", "10.0.3.10", 5432, "allow", "Application -> Data"),
ReachabilityTest("i-dev001", "10.0.3.10", 5432, "deny", "Development -> Data"),
]
validator = NetworkReachabilityValidator(region="us-east-1")
validator.validate_segmentation(tests)
A fixed five-second sleep is enough for a smoke test, but for a scheduled validation job prefer polling list_command_invocations until status is Success/Failed — SSM delivery can take longer under load.
Kubernetes microsegmentation with Calico network policies
Define fine-grained east-west traffic controls between Kubernetes workloads:
# calico-default-deny.yaml
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: default-deny-all-namespaces
namespace: kube-system
spec:
podSelector: {}
policyTypes:
- Ingress
- Egress
---
# calico-allow-payment-flow.yaml
apiVersion: projectcalico.org/v3
kind: NetworkPolicy
metadata:
name: allow-payment-to-database
namespace: payment
spec:
selector: app == "payment-service"
types:
- Egress
egress:
- action: Allow
destination:
selector: app == "postgres"
namespaceSelector: name == "database"
protocol: TCP
destinationPorts:
- 5432
- action: Deny
destination:
selector: all()
The first manifest is a stock Kubernetes NetworkPolicy (works on any CNI that enforces them); the second uses Calico’s richer projectcalico.org/v3 API, which adds ordered rules, named selectors, and global policies that span namespaces.
Terraform for enforcing segmentation as code
Define and enforce network segmentation using infrastructure-as-code:
# modules/segmentation/main.tf
variable "vpc_id" {
type = string
description = "VPC where the segment security group is created"
}
variable "environment" {
type = string
description = "Environment name (prod, staging, dev)"
}
variable "allowed_ingress" {
type = list(object({
source_cidr = string
port = number
description = string
}))
default = []
}
variable "allowed_egress" {
type = list(object({
destination_cidr = string
port = number
description = string
}))
default = [
{ destination_cidr = "0.0.0.0/0", port = 443, description = "Outbound HTTPS" }
]
}
# AWS security groups deny everything by default — rules only add allows.
resource "aws_security_group" "segment" {
name = "${var.environment}-segment-sg"
description = "Security group for ${var.environment} network segment"
vpc_id = var.vpc_id
dynamic "ingress" {
for_each = var.allowed_ingress
content {
description = ingress.value.description
from_port = ingress.value.port
to_port = ingress.value.port
protocol = "tcp"
cidr_blocks = [ingress.value.source_cidr]
}
}
dynamic "egress" {
for_each = var.allowed_egress
content {
description = egress.value.description
from_port = egress.value.port
to_port = egress.value.port
protocol = "tcp"
cidr_blocks = [egress.value.destination_cidr]
}
}
tags = {
Environment = var.environment
ManagedBy = "terraform"
Policy = "segmentation"
}
}
# Example usage for production segment
module "prod_segment" {
source = "./modules/segmentation"
environment = "prod"
vpc_id = aws_vpc.main.id
allowed_ingress = [
{ source_cidr = "10.0.1.0/24", port = 443, description = "DMZ to Application" },
{ source_cidr = "10.0.4.0/24", port = 22, description = "Management SSH" },
]
}
The allow-list is a variable, so the traffic matrix and the code stay in one place — when a flow gets approved it becomes a variable entry with the same justification the policy demands. The Terraform module, the Calico manifests, and the Python validator are published as files in the companion repository along with a blank, fillable version of the policy.
Further Reading
- NIST SP 800-207 — Zero Trust Architecture: the reference model this policy’s trust levels implement.
- Kubernetes docs — Network Policies: the stock
NetworkPolicysemantics the first Calico manifest uses. - Calico docs — NetworkPolicy: the extended
projectcalico.org/v3API in the second manifest. - AWS docs — Run Command: what the Python validator uses to probe reachability.
- PCI SSC — Scoping and Segmentation Guidance: why segmentation evidence is the first thing a QSA asks for.
Frequently Asked Questions
What is the difference between a VLAN and microsegmentation?
A VLAN is a layer-2 boundary, typically coarse and subnet-based. Microsegmentation applies policies to individual workloads or identities, often using software-defined networking, regardless of subnet.
Does segmentation replace a firewall?
No. Segmentation defines the architecture; firewalls, ACLs, and network policies are the controls that enforce it. They work together.
How do we prove segmentation to an auditor?
Provide network diagrams, firewall rule inventories, traffic matrices, exception logs, and evidence of periodic reviews. Automated reachability tests add strong technical evidence.
How do we handle segmentation for serverless functions?
Use VPC configuration for Lambda functions to place them in private subnets. Restrict egress through NAT gateways with route table filters. For API Gateway, use resource policies to restrict source IPs. For Step Functions, use private endpoints for service-to-service communication. Apply the same default-deny principle at the function level.
What tools can automate segmentation policy validation?
Cloud-native tools like AWS Network Manager, Azure Network Watcher, or GCP Network Intelligence Center cover reachability analysis. For Kubernetes, Calico's policy tester or Cilium's connectivity tests validate workload rules. For multi-cloud, tools like Tufin or GuardiCore provide cross-platform segmentation visibility and validation.
What is the difference between a security group and a network ACL?
A security group is stateful — return traffic of an allowed connection is permitted automatically — and attaches to an instance or ENI. A network ACL is stateless, applies to the whole subnet, and evaluates allow/deny rules in number order; return traffic needs its own rule. Most policies enforce day-to-day control through security groups and keep ACLs as a coarse outer layer.
Related Resources
Container Security Baseline Template
A baseline template for hardening container images, runtimes, and orchestration configurations across environments.
DocRBAC Policy Template: Roles, Permissions & Reviews
A copy-ready template for defining role-based access control policies: role definitions, assignment rules, approval workflow, review cadence, and break-glass handling.
RecipeConfigure iptables Firewall Rules with Bash
Set up a hardened iptables firewall with bash: SSH-safe rules, NAT port forwarding, IP blocking and reboot-proof persistence.
DocCompliance Gap Analysis Template
A template for mapping current security controls to compliance frameworks like SOC 2, ISO 27001, and PCI-DSS.
DocEndpoint Device Security Checklist Template
A checklist template for hardening laptops, workstations, and mobile devices that access corporate data and systems.
DocPenetration Test Scope Template
A template for defining the boundaries, targets, rules, and deliverables for a penetration testing engagement.