Network Security
Reduce attack surface with segmentation, firewalls, and zero-trust networking.
Theory
Network security shrinks attack surface and limits lateral movement if an attacker gets in. Core techniques:
- Segmentation — split networks into zones (public/private subnets, tiers) so a breach in one doesn’t reach everything
- Firewalls / security groups — allow only required ports and sources; default deny
- Private connectivity — keep databases/internal services off the public internet
- TLS everywhere — encrypt traffic in transit
- Zero trust — never trust based on network location; authenticate and authorize every request, even internal ones
The old “hard shell, soft center” perimeter model fails once an attacker is inside — zero trust assumes breach and verifies continuously.
Real-World Example
Defense in depth for a web app:
Public subnet: load balancer only (443)
Private subnet: app servers (reachable only from the LB)
Private subnet: database (reachable only from app, no public route)
Security groups: default deny; allow LB→app:8080, app→db:5432
All traffic over TLS; internal calls authenticated (zero trust) Hands-On Exercise
- Explain network segmentation and how it limits lateral movement.
- Write security-group rules (in words) for a three-tier web app.
- Contrast the perimeter model with zero trust.
- Why should databases never have a public route?
Cheat Sheet▾
| Technique | Purpose |
|---|---|
| Segmentation | Isolate zones/tiers |
| Default deny | Block all, allow by exception |
| Private subnets | Keep services off internet |
| TLS everywhere | Encrypt in transit |
| Zero trust | Verify every request |
| Defense in depth | Multiple layers |
Common Interview Questions▾
What is network segmentation and why does it help?
Dividing a network into isolated zones so a compromise in one segment can’t freely reach others — it limits lateral movement and contains breaches.
What is the zero-trust model?
Never trusting a request based on network location. Every request — even internal — is authenticated and authorized, assuming the network may already be breached.
Official Documentation
📝 My notes on this topic
Auto-saves as you type