Network Security
The CIA triad, common network attacks (DDoS, MITM, spoofing, DNS attacks, replay), defences (firewalls, security groups, WAF, IDS/IPS, VPNs, bastions), network segmentation, and zero-trust architecture.
Security goals
| Goal | Meaning | Network mechanisms |
|---|---|---|
| Confidentiality | only authorised parties read data | TLS, VPNs, encryption at rest |
| Integrity | data isn't altered undetected | MACs/AEAD, signatures, checksums |
| Availability | service stays up | DDoS protection, redundancy, rate limits |
| Authentication | prove identity | certificates, tokens, mTLS |
| Authorization | enforce permissions | policies, security groups, IAM |
| Non-repudiation / audit | prove who did what | signatures, logs |
Common attacks
| Attack | Layer | How it works | Defence |
|---|---|---|---|
| Volumetric DDoS / amplification | L3/L4 | flood bandwidth using reflectors (DNS, NTP, memcached) | anycast scrubbing, upstream filtering, BCP 38 (anti-spoofing) |
| SYN flood | L4 | exhaust half-open connection table | SYN cookies, backlog tuning |
| HTTP flood, Slowloris | L7 | expensive or slow requests | WAF, rate limits, timeouts, caching, challenges |
| IP spoofing | L3 | forged source addresses | ingress filtering, TCP handshake, auth |
| ARP spoofing | L2 | poison ARP caches to intercept LAN traffic | dynamic ARP inspection, TLS |
| DNS spoofing / cache poisoning | L7 | forged DNS answers | DNSSEC, randomised ports/IDs, DoH/DoT |
| BGP hijack | L3 (inter-domain) | announce someone else's prefixes | RPKI route origin validation, monitoring |
| MITM / SSL stripping | L5–7 | intercept or downgrade connections | TLS + HSTS preload, cert validation |
| Replay | L7 | resend captured valid messages | nonces, timestamps, idempotency keys |
| Port scanning / recon | L4 | discover exposed services | minimal exposure, firewalls, IDS alerts |
| SSRF | L7 | trick a server into requesting internal URLs (e.g. cloud metadata) | URL allow-lists, block private ranges, IMDSv2 |
Defensive building blocks
| Control | What it does |
|---|---|
| Firewall (stateful/stateless) | allow/deny by IP, port, protocol |
| Security groups / NACLs | cloud-native firewalls per instance / subnet |
| WAF | L7 rules against injection, XSS, bots |
| IDS / IPS | detect / block suspicious traffic patterns (Suricata, cloud GuardDuty) |
| VPN (IPsec, WireGuard) | encrypted tunnel between networks or for remote users |
| Bastion / identity-aware proxy | controlled admin access with MFA and audit |
| Network segmentation / micro-segmentation | limit blast radius and lateral movement |
| Private endpoints | reach managed services without public internet |
| Egress control | restrict outbound traffic (stops data exfiltration and SSRF pivoting) |
Zero trust vs perimeter security
| Perimeter ("castle and moat") | Zero trust |
|---|---|
| trust anything inside the network | trust nothing by default |
| VPN gives broad access | per-application, per-request access |
| long-lived credentials | short-lived, identity-bound credentials |
| east-west traffic often plaintext | mTLS everywhere |
| breach → lateral movement | breach → contained |
Interview questions
Answer out loud first, then open the model answer. Mark a question confident only when you could explain it to an interviewer without notes.