Skip to content

Defense in depth

Defense in depth means protecting a system with several independent layers of controls, so that no single failure exposes it. A phished password is stopped by multi-factor authentication; a compromised service can’t reach the database because the network doesn’t allow it; data stolen anyway is encrypted with keys the attacker doesn’t have; and the whole thing is detected because unusual access raised an alert.

The idea is old and military in origin. What matters in practice is that the layers are independent: two controls that fail for the same reason are one control.

Layers between an attacker and the data1. The edge filters malicious and excessive traffic before it reaches anything. 2. Identity controls require strong authentication and grant only the access needed. 3. Network segmentation limits what a compromised component can reach. 4. The application validates input and checks authorization on every request; the data layer encrypts and minimizes what's stored. 5. Detection spans every layer, so an attacker who gets through some is still noticed and contained. EdgeWAF, DDoS protection IdentityMFA, least privilege Networksegmentation, mTLS Applicationvalidation, authorization Dataencryption, tokenization Detectionlogs, alerts, runbooks12345
Layers between an attacker and the data Each layer assumes the one before it can fail. Detection and response span all of them.
  1. The edge filters malicious and excessive traffic before it reaches anything.
  2. Identity controls require strong authentication and grant only the access needed.
  3. Network segmentation limits what a compromised component can reach.
  4. The application validates input and checks authorization on every request; the data layer encrypts and minimizes what's stored.
  5. Detection spans every layer, so an attacker who gets through some is still noticed and contained.
Layer Controls What it protects against
People and process Training, secure development lifecycle, change control Phishing, unsafe changes
Edge Web application firewall, DDoS protection, rate limiting Common web attacks, floods
Identity MFA, single sign-on, least privilege, just-in-time admin access Stolen passwords, excessive access
Network Segmentation, private endpoints, egress control, mutual TLS Lateral movement, data exfiltration
Workload Hardened images, patching, runtime protection Exploited vulnerabilities
Application Input validation, authorization per request, dependency scanning Injection, broken access control
Data Encryption at rest and in transit, tokenization and masking, backups Data theft, ransomware
Detection and response Central logging, alerts, incident runbooks, tested restores Attacks that get through everything else

Zero trust is one way of applying defense in depth: it removes the assumption that anything inside the network is trusted and checks identity and authorization on every request. A “castle and moat” design, with one strong perimeter and a trusted interior, isn’t defense in depth at all, however strong the moat.

  • Assume breach of each layer in turn, and ask what stops the attacker next. A threat model of the most important data flows is the practical way to do this.
  • Check independence. If one admin account can disable the firewall, delete the logs and read the database, the layers share a single point of failure.
  • Limit the blast radius: separate accounts or subscriptions per environment and workload, separate credentials per service.
  • Protect the protections: logs written where the systems they monitor can’t delete them, backups that the production credentials can’t encrypt or delete.
  • Balance cost and friction. Every layer has a cost to users and teams. Put the strongest layers around the most valuable data.
  • No single mistake or vulnerability leads to a full breach.
  • Time to detect and respond before an attack succeeds.
  • More controls to operate and pay for.
  • Layers can give false comfort if each one is assumed to be someone else’s safety net and none is maintained.
  • Layers that share a failure mode, such as one identity provider with no MFA guarding every control.
  • No detection layer, so attacks that get through are discovered months later.
  • Backups reachable with production credentials, which ransomware deletes first.
  • Strong perimeter, flat interior.

Written and edited by Abhinav Taduka, enterprise software architect.