0%
Security Engineering for Software Teams
Thinking About Security
Cryptography You Will Actually Use
Identity
Vulnerability Classes
Detection and Response
Network Segmentation and Zero Trust
For decades, network security meant a strong perimeter: a firewall between the internet and the corporate network, with everything inside trusted. That model assumed attackers stayed outside. Modern breaches show the opposite pattern. Attackers get in through a phishing email, a vulnerable web server or a stolen VPN password, then move laterally across a flat internal network to reach the systems that matter. This section explains why the perimeter model fails and what lateral movement looks like.
The castle and moat model
In the perimeter model, the network boundary is the main control. Inside, systems trust each other because they share an address range. Databases accept connections from any internal host, admin interfaces have no authentication beyond network location and file shares are open to everyone on the corporate network. The model is simple to run, which is why it lasted, but it means one compromised machine inside the boundary inherits the trust of every other.
How attackers move laterally
After an initial foothold, attackers discover what the network can reach, often by scanning internal ranges or reading configuration on the compromised host. They look for exposed services, reused credentials, unpatched internal systems and management interfaces. Each new system gives more credentials and more reach. Flat networks make this easy, because every host can talk to every other host on every port, so the attacker only needs one weak system on the path to the target.
Why the perimeter dissolved
The perimeter has blurred for structural reasons. Employees work from home and on mobile devices. Applications run in several clouds and SaaS providers, outside any corporate network. Partners, contractors and vendors need access to specific systems. VPNs extend the internal network to every connected laptop. In this world there is no single inside to protect, and the location of a request says little about whether it should be trusted.
Implicit trust by network location
The core flaw of the perimeter model is implicit trust: granting access because of where a request comes from, rather than who sent it and whether that is allowed. An internal address can belong to a compromised laptop, a misconfigured container or a contractor device. A request from the VPN might come from an attacker with a stolen password. Every control that uses network location as proof of identity is a control an attacker can bypass by getting onto the network.
Common internal weak points
Internal services often receive less hardening than public ones because they are assumed to be safe. Typical findings include admin consoles without authentication, databases and caches with default or no passwords, monitoring dashboards that expose secrets, build servers with stored credentials, file shares holding backups and management protocols open to all hosts. Each of these is an easy step for an attacker who is already inside.
Ransomware and lateral movement
Ransomware incidents illustrate lateral movement at scale. Attackers gain access, spend days or weeks moving across the network to domain controllers and backup servers, then encrypt as many systems as possible at once. The damage scales with how much one foothold can reach. Organisations with segmented networks and separated backups often contain ransomware to one area, while flat networks can lose almost everything in a single night.
Cloud networks are not automatically safe
Cloud virtual networks reproduce the same problem if they are designed like data centres. A single large virtual network with permissive security groups, peering between every account and broad internal routing lets a compromised workload reach everything. Cloud does offer better tools, such as identity aware policies and fine grained security groups, but those tools only help when they are used deliberately.
East west versus north south traffic
North south traffic flows between the internet and the organisation, and it has historically received most attention through firewalls and gateways. East west traffic flows between internal systems, and in modern architectures it is far larger, with services calling each other constantly. Lateral movement happens in east west traffic, so controls must cover it too, not only the boundary.
Defence in depth
Neither segmentation nor any single control prevents all attacks. The goal is layers: a perimeter that blocks obvious threats, segmentation that limits reach, authentication and authorization on every service, monitoring that detects movement and hardening of each system. An attacker must defeat several layers to reach valuable data, and each layer offers a chance to detect them.
Two complementary ideas
This lesson covers two ideas that work together. Network segmentation divides the network into zones and controls traffic between them, limiting how far an attacker can move. Zero trust removes implicit trust entirely, requiring every request to be authenticated and authorized based on identity and context, regardless of network location. Segmentation shrinks the blast radius and zero trust makes every hop require proof.
Measuring exposure
Before changing a network, teams need to know what can reach what. Flow logs, firewall logs and service maps show actual traffic between systems, while reachability analysis shows what traffic would be possible. The gap between the two is excess exposure: paths that nothing uses but an attacker could. Most networks have far more possible paths than used ones, which is the opportunity segmentation exploits.
Internal DNS and service discovery
Service discovery systems tell an attacker exactly what exists. Internal DNS zones, service registries and configuration stores list hostnames such as billing database or admin portal, along with their addresses and ports. In a flat network, reading these is enough to plan the next hop. Discovery data is not secret in itself, but it means obscurity offers no protection, so every service named there needs real access controls rather than relying on attackers not knowing it exists.
Credentials as the bridge
Lateral movement rarely relies on network reach alone. Attackers combine reach with credentials found along the way: passwords in scripts, tokens in environment variables, cached administrator sessions and keys on build servers. A host that can reach a database is only dangerous when it also holds or can obtain credentials for it. This is why segmentation and secrets hygiene support each other, and why removing standing credentials from intermediate systems breaks many attack paths.
Dwell time
Dwell time is the period between initial access and detection. During it, attackers explore, collect credentials and position themselves. Long dwell times in flat networks give attackers time to find the shortest path to valuable systems. Segmentation slows them down by forcing them to cross monitored boundaries, and every denied connection at a boundary is a chance to detect them before they reach the target.
Paths an attacker can reach
Attack path analysis treats the environment as a graph: hosts, identities and data as nodes, and network reach or permissions as edges. Tools can compute the shortest paths from common footholds, such as an employee laptop or a public web server, to sensitive systems. These paths show where a single rule change or a removed credential cuts off many routes, which helps prioritise segmentation work over trying to fix everything at once.
Flat networks let one foothold reach everything, and the perimeter no longer has a single inside. Attackers move east west through weak internal services, reused credentials and broad reachability. Segmentation limits how far they can go, and zero trust removes the trust that network location used to grant.