Limiting Lateral Movement with Network Segmentation
This lesson explains how network segmentation limits how far an attacker can move after gaining a foothold, applied on AWS at several layers from separate accounts down to rules between individual services.
Learning outcomes
After completing this lesson, you will be able to:
- Identify the layers at which segmentation is applied.
- Distinguish north-south from east-west traffic and their controls.
- Explain why removing network paths is stronger than filtering them.
Layers of segmentation
Segmentation divides an environment into zones so that a compromise in one zone cannot spread freely to others. It limits the blast radius of an incident and makes access between zones explicit and auditable. On AWS, segmentation applies at several layers, from separate accounts, the strongest boundary, through VPCs and subnets, down to security groups that control traffic between individual resources. The following list describes these layers.
- Separate accounts and VPCs per environment or workload.
- Public, private and isolated subnets (no route to an internet or NAT gateway; AWS services through VPC endpoints).
- Transit gateway route tables controlling which VPCs can communicate.
- Security groups referencing each other between tiers.
- VPC Lattice service networks with IAM auth policies for service-to-service access.
- VPC Block Public Access, which blocks internet gateway traffic for VPCs or subnets and can be enforced with declarative policies.
The following diagram shows the tiers of an application and its isolated database subnets.

From the strongest boundary to the finest
Traffic directions
Network traffic is described by its direction, and each direction calls for different controls. North-south traffic enters or leaves your network, to and from the internet or on premises. It is controlled at the perimeter with AWS WAF for web applications, AWS Network Firewall, or third-party appliances deployed behind a Gateway Load Balancer. East-west traffic flows inside your environment, between VPCs, subnets or services. It is controlled by routing, which decides which networks can reach each other at all, by security groups and by internal inspection, so that an attacker who compromises one workload cannot move freely to others. The following table summarises the two directions.
| Direction | Meaning | Controls |
|---|---|---|
| North-south | Entering or leaving your network (internet, on premises) | WAF, Network Firewall, appliances behind Gateway Load Balancer |
| East-west | Between VPCs, subnets or services | Routing, security groups, internal inspection |
North-south or east-west?
Reducing network access
The strongest segmentation removes network paths altogether rather than filtering them. Each broad route that is removed is one less path an attacker can use. Administrative access through Session Manager replaces SSH and RDP access through bastion hosts. Application access through Verified Access replaces VPN access to whole networks. AWS service access through VPC endpoints replaces routes to the internet. In each case a broad network route is replaced by a narrow, authenticated path that is authorised per request and logged.
Removing broad paths
An isolated database tier
A payments application's database must have no route to the internet at all, while still using Secrets Manager and KMS. The architect places it in isolated subnets whose route table contains only the local route, and adds interface endpoints for the services it needs:
aws ec2 create-vpc-endpoint --vpc-id vpc-0pay --vpc-endpoint-type Interface \
--service-name com.amazonaws.eu-west-1.secretsmanager \
--subnet-ids subnet-0db1 subnet-0db2 --security-group-ids sg-0endpoints --private-dns-enabled
aws ec2 create-vpc-endpoint --vpc-id vpc-0pay --vpc-endpoint-type Interface \
--service-name com.amazonaws.eu-west-1.kms \
--subnet-ids subnet-0db1 subnet-0db2 --security-group-ids sg-0endpoints --private-dns-enabledThe database security group allows only the application tier's security group on the database port. VPC Block Public Access is enabled for the VPC with an exclusion only for the public load balancer subnets, so no future change can attach the database tier to an internet gateway.
How can internet access be blocked for a whole VPC centrally?
Show answer
With VPC Block Public Access.
Exam Tips
Remember for the exam
- To block internet access for a whole VPC centrally, use VPC Block Public Access.
- A database tier with no route to the internet belongs in an isolated subnet with VPC endpoints.
- When production and development VPCs on one transit gateway must not talk, use separate route tables.
- For authenticated service-to-service access, use VPC Lattice auth policies.
- Separate accounts and VPCs per environment are the strongest boundaries.