Skip to Content
Asterrr's Handbook
3 · Infrastructure security

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/southEast/west
WhatIn and out of your AWS network: internet, on-premises, partnersBetween VPCs, subnets and workloads inside it
Main risksExploits from outside, exfiltration, C2 callbacksLateral movement after one workload is compromised
ControlsCloudFront + WAF + Shield, Network Firewall or GWLB in a central ingress/egress VPC, DNS Firewall, NATSeparate 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

TierRoute tableTypical contents
Public0.0.0.0/0 to an internet gatewayALBs, NAT gateways, Network Firewall endpoints for ingress
Private0.0.0.0/0 to NAT gateway or firewall endpointApp servers that need outbound internet
IsolatedNo route to the internet at allDatabases, 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 local route 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:AttachInternetGateway outside 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

Scenario
A fintech runs prod and dev VPCs attached to one transit gateway, all using the default transit gateway route table. An auditor flags that dev instances can reach prod databases. Both environments must keep reaching a shared services VPC that hosts DNS and CI runners. What is the most effective change?

Further reading

On this page