Network segmentation
North/south and east/west traffic, public, private and isolated subnet tiers, and Transit Gateway route tables that keep environments apart.
Exam tasks: 3.3 (segmentation for north/south and east/west traffic, isolated subnets)
The decision: which workloads must never talk to each other or to the internet, where do you enforce that (routing, firewall, security group), and how do you prove the rule holds as the network changes?
Segmentation decides which flows can exist at all. Routing removes paths, firewalls inspect the paths that remain, and security groups narrow them per workload.
| North/south | East/west | |
|---|---|---|
| What | In and out of your AWS network: internet, on-premises, partners | Between VPCs, subnets and workloads inside it |
| Main risks | Exploits from outside, exfiltration, C2 callbacks | Lateral movement after one workload is compromised |
| Controls | CloudFront + WAF + Shield, Network Firewall or GWLB in a central ingress/egress VPC, DNS Firewall, NAT | Separate VPCs, transit gateway route tables, security groups referencing security groups, Network Firewall between segments, VPC Lattice auth policies |
Exam signal
"Limit the blast radius if one application is compromised" or "prevent lateral movement" is an east/west question: separate route domains plus tight security groups, and inspection between segments if required. "Inspect all traffic to and from the internet in one place" is north/south: a centralized inspection VPC.
Subnet tiers
| Tier | Route table | Typical contents |
|---|---|---|
| Public | 0.0.0.0/0 to an internet gateway | ALBs, NAT gateways, Network Firewall endpoints for ingress |
| Private | 0.0.0.0/0 to NAT gateway or firewall endpoint | App servers that need outbound internet |
| Isolated | No route to the internet at all | Databases, regulated data processing. Reaches AWS through VPC endpoints only |
- An isolated subnet is the strongest egress control there is: nothing to filter, because there's no path. Confirm the workload's dependencies (package repos, licence servers, SaaS APIs) have a VPC endpoint or an internal mirror first.
- Use separate VPCs, not just separate subnets, for workloads with different trust levels. Inside one VPC,
every subnet has a
localroute to every other subnet, so only security groups and NACLs separate them. - Block direct internet exposure at the organization level with VPC Block Public Access (blocks IGW traffic
in either direction, with exclusions) and SCPs that deny
ec2:AttachInternetGatewayoutside network accounts.
Transit Gateway route tables for segmentation
- Each attachment is associated with exactly one transit gateway route table (which table it uses to look up destinations) and can propagate its routes into any number of tables (who can reach it).
- A typical pattern:
- A prod table that holds propagations from prod and shared services.
- A dev table that holds propagations from dev and shared services.
- A shared table that holds propagations from everything.
- Prod and dev never learn each other's routes, so there's no path between them, even if a security group is wide open. Add a blackhole route to be explicit.
- To inspect east/west traffic too, point the spoke tables' default route at the inspection attachment (a Network Firewall attachment or an inspection VPC) and enable appliance mode for symmetric flows.
- AWS Cloud WAN does the same with named segments and a central network policy, across Regions.
Disabling default route table propagation
A transit gateway created with default association and propagation turned on puts every new attachment in one table where everything can reach everything. For segmentation, turn both defaults off and associate each attachment deliberately.
Scenarios
Separate route tables remove the path entirely while keeping both environments connected to shared services. NACL denies work but are per subnet and easy to miss as the network grows. Moving Regions is a large migration and still leaves a path if the transit gateways are peered. Appliance mode only keeps flows symmetric through an inspection appliance.
Related
- Network Access Analyzer and Reachability Analyzer proves the segmentation holds.
- AWS Network Firewall
- VPC network controls
- Egress filtering
Further reading
Egress Filtering and Domain Allow Lists
Restrict outbound traffic to approved domains with Network Firewall, Route 53 Resolver DNS Firewall, or a self-managed proxy.
Network Access Analyzer and Reachability Analyzer
Two static VPC analysis tools. One finds unintended access, the other explains why a specific path is blocked.