Network Security In progress
Intermediate 20 min read Network Security
Segmentation and Next-Gen Firewalls
Design the trust boundaries that contain an attacker: VLANs and subnets, east-west filtering, and what next-gen firewalls add beyond port 80/443 luck.
segmentationfirewallVLANNGFWeast-westDMZzones
Introduction
What is this?
Segmentation divides a network into zones (outside, DMZ, internal, management) and enforces who may talk to whom; a next-gen firewall adds app-layer awareness to that enforcement.
Motivation
Why do you need it?
- Containment is how a single exploited host stops being a full-network compromise — the single biggest win in defense.
- Regulators and auditors now inspect east-west flows, not just the perimeter ACL.
- NGFW features (app ID, user ID, TLS decryption) let you filter by what the traffic does, not only its destination port.
Think about it
Mental model
Imagine
One giant office floor
Think of
Fire-doored compartments
A fire in one workshop does not gut the whole building because the compartments are sealed and the doors self-close.
Mechanics
How it works
- Zones are defined by policy intent: e.g. 'web-zone', 'app-zone', 'data-zone', each with its own ACL and routing rules.
- VLANs put zone isolation at layer 2; inter-zone traffic hits the firewall or the ACL-able router/firewall, never a flat bridge.
- NGFWs rebuild application streams (TLS decryption, app-ID) so a rule like 'allow HTTPS to CRM asset' matches an app, not an IP.
- Micro-segmentation (often via workload/service-mesh) applies the same zone principle at container and VM granularity.
A classic zone model
Internetuntrusted ingress/egress
DMZpublic-web + edge proxies
App zonemiddleware only reachable from DMZ per allow rules
Data zoneDBs, vaults — few flows, strictly allowed
Mgmt zoneSSH/admin, severely restricted
Real world
In production
- A bank separates card-processing VLANs from general traffic so a compromised workstation cannot reach the payment pinset.
- An e-commerce site places public web in the DMZ and keeps the order DB two zones deep with only one allow rule.
- A Kubernetes fleet uses network policies as per-namespace zones, blocking all east-west by default.
Guidelines
Best practices
- Make the default deny and the allow list tiny and explicit — document the intent of every rule.
- Split management plane traffic (SSH to appliances) into its own zone with jump-host control.
- Enforce stateful sessions and source/dest verification (uRPF, BCP38) at the edge.
- Review the rule set quarterly; delete rules nobody can explain within a release.
Watch out
Common mistakes
- A 'DMZ' that is really just a VLAN with the same firewall rules as the inside — a naming-only boundary.
- Wide-open east-west: nobody contains the lateral move, so one phished laptop reaches the backups.
- Blocking ports but leaving legacy protocols (SMB, RDP) allowed everywhere because 'apps need them'.
- Treating segmentation as a firewall rule instead of a whole-system discipline (DNS, routes, Wi-Fi too).
When things break
Debugging tips
- Test reachability from inside each zone with nc -vz; map cross-zone paths in a small table.
- When 'the firewall blocks everything' watch state tables — asymmetric routing poisons entries.
- Log dropped traffic during rollout and diff the noise against intended flows before tuning.
Security
Security considerations
- Only test segmentation on your own lab/network; probing others' zones without authorization is illegal.
- Document the compliance stance: zone models back up PCI/SOC/ISO evidence around 'system components'.
- Require an owner per zone; orphaned segments are unmanaged risk.
Interviews
Interview checkpoint
Practice
Hands-on lab
Dockerize Three Zones and Prove the Boundary Holds
45 min · intermediate
Objectives
- Create three separate docker networks simulating zones.
- Place a web 'DMZ' and a 'data' workload on separate zones.
- Demonstrate a default-deny boundary by blocking cross-zone traffic with a firewall-like rule.
Dockerize Three Zones and Prove the Boundary Holds
45 min · intermediate
0/4 steps
0%
sandbox · Linux sandbox
$
Try these commands
Test yourself
Quick quiz
0/2
1
Which placement makes a public web server reachable without exposing the database VPC directly?
2
The first rule of an ordered ACL should be...
Go deeper