Skip to content
Français
Sync not enabled: your progress stays in this browser My learning
Select theme
Français

Defence in depth: securing in layers

By updated

Improve this page

Defence in depth means stacking several independent security barriers, from the edge of the network to the data, so that no single flaw is enough to compromise everything. If one layer gives way, the next one slows the attacker down and leaves time to react. This lesson explains what a security layer is, how the firewall, segmentation, hardening, application controls and encryption fit together, and why a single protection is never enough. It needs no prerequisite other than the notion of a cyberattack.

What you will learn

This concept is one of the pillars of defensive security. It extends least privilege, which limits rights at every layer, and reducing the attack surface, which shrinks what there is to protect even before stacking layers.

  • Define defence in depth and the idea of stacking layers.
  • Recognise each layer, from the perimeter to the data, and what it is for.
  • Explain why a single barrier always ends up falling.
  • Spot the common traps that give a false sense of security.
  • Situate defence in depth as the principle that assembles the others, with the security control types (in French) that each layer combines.
  • Link this principle to the Zero Trust model (in French) and to the SOCLE threat model (in French), which say what these layers protect against.

What is defence in depth?

Defence in depth is a strategy that never bets everything on a single protection: you place several layers of security one behind the other. A layer is a mechanism that filters, controls or protects at a specific point of the system, and each works on its own, without depending on the others.

The classic image is the castle. To reach the treasure in the keep, an attacker must cross the moat, climb the walls, cross a guarded courtyard, then force a second wall. Each obstacle is autonomous: crossing the moat says nothing about the next wall. And at each step, the guards have a chance to spot the intruder.

In practice, the attacker who gets around the firewall runs into network segmentation, then a hardened server, then an application that checks their rights, then encrypted data. Each layer can be crossed on its own; stacking them forces the attacker to cross all of them, which multiplies the time spent and the traces left. The founding principle is there: no protection is infallible.

What are the layers, from the perimeter to the data?

A well-defended system stacks layers from the most external to the most intimate, and each can raise an alert when it is solicited abnormally. The diagram orders them; each technical term is defined below at its first appearance.

The layers of defence in depth crossed by an attacker: perimeter (firewall, WAF), internal network (segmentation), system (hardening, patches), application (input, authentication, rights) and data (encryption), each layer able to trigger a detection alert.AttackerPerimeterfirewall, WAFInternal networksegmentationSystemhardening, patchesApplicationinput, authentication, rightsDataencryptionDetectionan alert at every layer
Source · SVG
Esc to close, + and − to zoom, scroll to move around. 100 %

The perimeter layer is the first line, at the border between the Internet and your network. It holds the firewall, a filter that lets traffic through or blocks it according to rules (address, port, protocol), and often a WAF (Web Application Firewall, a firewall that inspects web requests to spot attacks against a site). This layer mostly stops automated attacks and opportunistic ones, not a patient attacker who will look for another way.

The internal network layer comes into play once the border is crossed: it prevents the intruder from moving freely. The key technique is network segmentation, which cuts the network into siloed zones (production, development, administration) that only communicate when strictly needed. Micro-segmentation even controls exchanges between applications. The goal: limit lateral movement, an attacker bouncing from a compromised machine to another.

The system layer protects each machine on its own. The central gesture is hardening: disable unneeded services, close unnecessary ports and apply the updates that fix known flaws. A properly hardened server holds even if the network around it is already compromised.

The application layer concerns the software itself, which must never blindly trust what it receives. Three controls define it: input validation (check any data received before using it), authentication (prove who you are, strengthened by MFA, multi-factor authentication) and authorisation (check, for every action, that the person is allowed to do it).

The data layer is the last bulwark, the one that protects the information itself. It relies on encryption, which makes data unreadable without a secret key, at rest (on disk) as well as in transit (while it travels, through the TLS protocol). Even if every other layer falls and files are stolen, they remain unusable without the key.

Why is a single barrier not enough?

The most widespread mistake is trusting a single protection: "we have a firewall, the network is protected", "the data is encrypted, a leak is no big deal". Each statement is partly true but dangerously incomplete.

A misconfigured firewall lets malicious traffic through. Authentication can be bypassed if a password leaks through phishing. Encryption protects nothing anymore if the keys are stolen. Every barrier, however robust, has a failure mode: bug, misconfiguration, unknown flaw, human error.

Defence in depth accepts this reality. By placing several independent layers, you turn a fatal flaw into a mere delay: the attacker who crosses a layer hits the next one, which multiplies the chances of detecting them. This is why detection matters as much as prevention.

Defence in depth is the principle that assembles the others: each layer combines different security control types (in French), preventive (the firewall), detective (the alerts) and corrective (the restorable backup). The neighbouring principles supply the building blocks: security by default (in French) closes each layer from installation, privilege separation (in French) partitions roles between them, and minimisation (in French) reduces what each layer has to defend. Together, they protect the three pillars of the CIA triad (in French).

A concrete scenario

Take a web application exposed on the Internet, in which a critical flaw is found in a third-party component. It allows remote code execution: an attacker can run their own commands on the server. The perimeter layer has given way. Let's see what the next layers do.

First, the application runs in a container, an isolated environment that wraps it without giving it access to the whole machine. The attacker's code runs, but locked in, without reaching the host system.

Next, the application connects to its database with a service account that has least privilege, strictly minimal rights. The attacker can only read a limited subset of data, not the whole database: the application layer has reduced the impact.

Finally, sensitive data is encrypted with keys this account does not hold, and abnormal queries trigger an alert. The team applies the fix while monitoring contains the incident. The flaw was not prevented, but its impact stayed contained: limited access, quickly detected, instead of a full leak.

Which traps should you avoid?

Badly applied, defence in depth gives a false sense of security. Four mistakes keep coming back; knowing them avoids building layers that are not layers.

Stacking redundant tools. Three products doing the same thing in the same place do not make three layers: they make a single costly layer and a false sense of robustness. A real layer protects a distinct level (network, system, application, data).

The empty fortress. Investing heavily in the perimeter (firewall, WAF) while neglecting the inside: once the border is crossed, the attacker walks around freely, for lack of internal segmentation.

Layers that are not independent. If all protections rely on the same mechanism, for example the same identity directory, a single compromise brings them down in cascade. A layer is only truly a layer if it can be attacked separately.

Stacking without detecting. Multiplying preventive barriers without any alert: the attacker crosses the layers without ever being spotted. Prevention and detection go together, and the Zero Trust model (in French) pushes the logic to trusting no layer by default, even internal.

Key points

  1. No protection is infallible. Defence in depth starts from this fact and multiplies obstacles to compensate.
  2. Layers go from the perimeter to the data: firewall, network segmentation, system hardening, application controls, encryption. Each protects a distinct level.
  3. Layers must be independent. If a single compromise brings several down, the principle is badly applied.
  4. Defence in depth slows down and reveals: it gives defenders time and increases the chances of detecting the attacker.
  5. Detection matters as much as prevention. A layer that never alerts lets the intruder progress silently.
  6. Redundancy is not depth. Stacking identical tools at the same level does not create a new layer.
  7. These layers answer precise threats: the SOCLE threat model (in French) describes attack vectors by domain and shows what each layer protects against.

Knowledge check

Check that you have the essentials of this guide. The questions only cover what has just been explained here.

Knowledge check

Check what you have learned with this interactive quiz

6 questions
6 min
70% to pass

How it works

  • The timer starts when you click Start
  • Multiple choice, true/false and short answer questions
  • You can move between questions
  • Detailed results are shown at the end

Starts the quiz and the timer