← Concepts

阅读中文版本

Defense in Depth

Defense in depth layers independent preventive, detective, and responsive controls so one failure does not become a breach or outage.

security

Definition

Defense in depth is the practice of combining multiple independent security controls across identity, network, application, data, and operations. The layers are chosen so that a failure or bypass of one control is caught or limited by another. It is not redundancy of the same check; it is diverse controls with different failure modes.

Context and scope

Defense in depth is used in architecture reviews, secure design, and incident response. It matters most where a single control is easy to bypass, such as client-side validation or a network perimeter.

Common misconceptions

  • More controls always mean more security — overlapping controls can add complexity, latency, and false confidence
  • Defense in depth means duplicating the same firewall — identical controls share the same blind spots
  • Detection is optional if prevention is strong — prevention eventually fails; detection and response limit the damage

Anti-patterns

  • Relying on client-side validation as the only input check
  • Trusting a network location instead of authenticating each request
  • Having no logs or alerts when a control fails

Related concepts

Related examples

Authoritative source

https://csrc.nist.gov/pubs/sp/800/53/r5/upd1/final

Layers with different failure modes

A web application might validate input at the edge, validate it again in the service, use parameterized queries, apply least-privilege database credentials, log anomalous queries, and alert on them. Each layer can fail or be bypassed, but not all in the same way. The goal is not to repeat the same check; it is to make a single mistake insufficient for compromise.

Identity: SSO + MFA + short-lived tokens
Network: segmentation + mTLS
Application: authorization + input validation + output encoding
Data: encryption + least-privilege DB roles + backups
Operations: audit logs + alerts + incident response

Prevention, detection, response

Preventive controls stop known attacks. Detective controls reveal failures and attacks in progress. Responsive controls limit damage and restore service. A system with only prevention has no way to know when prevention fails. A system with only detection learns too late. Design all three and test them.

Avoid control theater

Adding a WAF, a scanner, and a policy document does not create depth if they are not tuned, monitored, or independent. Measure whether each control actually blocks the attack it claims to block, and whether its alerts reach someone who can act. Remove controls that add cost without reducing a real risk.

When to use it

Use defense in depth for systems with valuable data, regulated obligations, or a large attack surface. The advantage is resilience against a single control failure; the drawback is complexity and operational cost. Compared to a single perimeter control, layered controls are harder to bypass but require a threat model to choose the right layers.