Skip to content
Tech Interview Prep
Technical interview guide

Defense in Depth

Layering multiple independent security controls so no single failure compromises the whole system.

Minutes to read
4
Practice MCQs
25
Interview Q&A
25
Edition
v5
Editorial status
Reviewed

Scope: NIST SP 800-53 Rev. 5 update 1; SP 800-37 Rev. 2; SP 800-160 Vol. 2 Rev. 1; SP 800-207; SP 800-61 Rev. 3; CIS Controls v8/8.1; OWASP ASVS project current 2026-08-31; MITRE ATT&CK current 2026-08-31.

Overview

Curated: · Written: · Reviewed:

Defense in Depth

In one line

Defense in depth stacks controls that each break a different step of an attack or a different failure mode, so one failure does not hand the attacker the asset. Reach for it when asked whether a design is really layered; the answer depends on whether the layers fail independently, not on how many there are.

Key definitions

  • Common-mode failure: one fault (shared policy bug, shared credential, shared rule bundle, shared key) that defeats several layers at once.
  • Independence: a layer fails for reasons that leave the others working. Test it; do not infer it from the diagram.
  • Blast radius: the assets and identities reachable once one layer is defeated.
  • Fail-closed / fail-open: what a control does when its decision source is unreachable. Record it for every layer.
  • Recovery copy: a backup that production credentials cannot delete or alter, and that predates the compromise.

Formulas and complexity

If two layers fail independently, both miss with probability equal to the product of their miss rates. Correlated layers miss together far more often:

P(both miss)=pA⋅pBonly if independentP(\text{both miss}) = p_A \cdot p_B \quad \text{only if independent}

Worked example (hypothetical figures): two WAFs each miss 10% of payloads. Suppose half of each WAF's misses are the same payloads, so 5% of all payloads get past both through the shared gap. The remaining 5% misses per WAF are independent, giving 0.05 × 0.05 = 0.25% more. Total residual: 5.25%. Independence would have given 1%. The second WAF buys about a fifth of the protection the naive product suggests.

How it works

Each layer sits where it breaks one step of the credible attack path. Every step needs a layer whose failure cause differs from its neighbours'.

Internet request Edge WAF: blocks known exploits Gateway: token and scope check Service: object-level authorization Data: row-level security, keys held separately Immutable logs, separate account Locked backup, separate credentials

Walk the path from the initial condition to the impact. For each step, name the layer that interrupts it, the identity, policy source and telemetry it uses, and what it does when that source fails. Then check the sideways paths that skip the diagram: direct service endpoints, management planes, batch jobs and break-glass accounts.

When to use and when not to

SituationAdd a layerDo not add a layer
Same vendor, same rule family, same bundleNo: expect little gainAdds cost and a second place for the same bug
Different control type, separate failure domainYes
Layer shares the admin role of the one it guardsNo: fix the shared root first
Layer adds latency on a hot path with no independent failure modeOnly if impact justifies itConsolidate instead
Recovery copy reachable with production credentialsMove it to a separate account and credential set

Traps interviewers probe

  1. Counting products. Three tools on one identity root are one failure domain. Fix: map each layer to the credential, policy source, rule bundle and telemetry it depends on, and report the shared ones.
  2. Multiplying catch rates. Three layers that each catch 90% reach 99.9% only if their misses are independent. With a shared bundle, the residual can sit near 10%. Fix: test each layer alone and in combination, and report the residual rate for the whole path.
  3. Trusting a header or internal path. The gateway strips a header, but a pod calls the service directly. Fix: enforce the decision where the resource lives, or block direct access with network policy.
  4. Backups under the same credentials. A retention rule that expires the clean copy defeats the copy. Fix: separate account, object lock, and a retention window longer than realistic dwell time.
  5. Silent degradation. A rule stops matching after an update and the dashboard stays green. Fix: probe each layer with known-bad test traffic that must be blocked, on a schedule.

Interview tips

Opening: "Each layer breaks a different step of the attack path and fails for a different reason. I would check the shared dependencies first, then the paths that skip the main request flow."

Expect these follow-ups:

  • Which layers share an identity, policy source, rule bundle or key?
  • When this layer's decision source is down, does it fail open or closed?
  • Can an admin disable one layer without touching the others?
  • What test shows this layer still works?
  • What is the residual risk, and who owns the exception and its expiry date?

30-second outline:

  1. Name the asset and the consequence of losing it.
  2. Trace the attack path and the layer that breaks each step.
  3. Name one common-mode dependency and how you separated it.
  4. State the failure behaviour of the weakest layer.
  5. Say how you test each layer alone and in combination, and which recovery copy survives a destructive compromise.

Feedback on this overview

Log in free to save your progress and keep bookmarks and notes for a quick revision before your interview.