Foundations

Defense in Depth

A security strategy that stacks independent layers of controls so that when one fails, as it eventually will, another still stops or reveals the attack.

Defense in depth is the practice of protecting a system with several independent layers of controls (people, process and technology) so that an attacker who gets past one still has to get past the next, and is likely to be noticed along the way. It starts from the assumption that every individual control will fail at some point. The idea comes from military doctrine and nuclear safety; NIST describes it as layering safeguards so that a threat slipping past one is caught by another.

The Swiss cheese model

The clearest picture comes from safety engineering. In James Reason’s Swiss cheese model, every layer of defense is a slice with holes in it: bugs, misconfigurations, people having a bad day. An incident only happens when the holes in every slice line up. You don’t need a perfect slice; you need enough slices whose holes are in different places.

That last part is the easy one to get wrong. Layers have to be independent. Two controls that share a dependency, like the same credential, the same agent or the same blind spot, fail together and count as a single layer.

Typical layers

LayerWhat it limitsExamples
Identity and accesswho can act at allMFA, Least Privilege
Network and isolationwhere an attacker can reachsegmentation, sandboxes, containers
Host and applicationwhat code can run and what it can dopatching, allowlisting, input validation
Datawhat’s worth stealingencryption, minimization
Detection and responsehow long an attacker goes unnoticedlogging, EDR, Sigma Rules

Why it matters for defense

Defense in depth swaps the question “is this control good enough?” for “what happens when it fails?” A mail filter will eventually miss a phishing email; MFA limits what a stolen password is worth; least privilege limits what a compromised account can touch; detection limits how long any of it goes unnoticed.

It’s also why detection can’t be an afterthought. Techniques like LOLBins abuse tools that prevention allows by design, so only the monitoring layer sees them.

In practice

Industrial (OT) security formalizes it in ISA/IEC 62443 as zones and conduits: the plant is split into zones with their own security level, and every path between them is a controlled conduit.

AI agents are the newest place where it applies. No single control stops prompt injection reliably, so the defenses discussed at Ekoparty 2026 were layered by design: normalize each agent action, check it against a default-deny policy, require human approval for anything sensitive and write it to an append-only log, failing closed if any step breaks. On top of that sits behavioral monitoring of the whole agent fleet, because attacks built from individually legitimate actions only show up as a pattern.

Common misconceptions

  • “More tools means more depth.” Five products that all depend on the same console or admin account are one layer with five invoices.
  • “With enough layers, each one can be weaker.” The model works because each slice still stops most attacks. Weak layers just make the holes line up more often.
  • “It’s all about prevention.” Detection and response are layers too, and often the ones that decide how bad an incident gets.

Retrieval prompts

Test recall before peeking. Spaced repetition beats re-reading.

What makes two layers of defense independent, and why does it matter?

They fail for different reasons: different mechanisms, data sources or owners. Two controls that share a dependency (the same credential, the same agent, the same blind spot) fail together, so they count as one layer.

Map the Swiss cheese model onto defense in depth.

Each slice is a layer of controls and each hole is a weakness in it. An incident needs the holes in every slice to line up. Adding slices or shrinking holes makes that alignment less likely, and no slice has to be perfect.

Why is detection a necessary layer even with strong prevention?

Because prevention fails silently, and some techniques get through it by design: LOLBins abuse trusted tools that allowlisting permits. Logging and detection are the layer that notices the misuse and bounds how long it lasts.