liveBook · Manning

Defense in depth

As explained in Grokking Software Architecture

Layered defense is a security pattern that places multiple independent protective controls between an attacker and protected resources.

A castle does not rely on its moat alone: an intruder who crosses it still faces gates, guards, and a locked vault. Defense in depth applies the same idea to software, placing multiple, independent protective controls throughout a system so that one failure does not mean total compromise. section 11.2.2

A perimeter-only model trusts users once they get inside the firewall. That is risky when phishing, social engineering, or a compromised supplier can get an attacker through the outer wall. Layered defense asks what stops the attacker next. section 11.2.2 section 11.1

A layered architecture can combine several kinds of control:

  • Restrict network routing so that a breach in one area does not provide a direct path to sensitive systems. section 11.2.2 section 11.7
  • Verify identity and enforce authorization rather than trusting every internal request. section 11.10 section 11.4
  • Validate inputs and encrypt data as additional protections at the application and data tiers. section 11.2.2
Figure 11.6 The modern security architecture in action. Notice that an attacker must bypass network firewalls, active threat detection, centralized identity verification, and application-level authorization before they can even attempt to access the encrypted data.

This architecture illustrates distinct barriers between an attacker and encrypted data, including firewalls, threat detection, identity verification, and authorization. section 11.4

A vendor portal becomes a path to cash registers

In the 2013 Target breach, attackers stole an HVAC vendor's portal credentials through phishing. The portal was meant for billing, but insufficient network segmentation let the attackers pivot to the point-of-sale network and install malware on cash registers. Restricting the vendor's permissions and blocking routing from the billing portal to those systems would have created additional barriers after the initial breach. section 11.7

Design for the outer wall to fail. Combine redundant controls with least privilege so that a compromised account or service has fewer places to go and fewer actions it can take. section 11.10 section 11.2

How Grokking Software Architecture covers it

How deep it goes
Defines independent layers and explains their roles across network, application, and data tiers through an architectural diagram and breach analysis.
Examples
Illustrates layers with a castle and analyzes the 2013 Target HVAC vendor breach.
What you can do after
Evaluate/understand how layered defenses contain intruders and differ from a perimeter-only model.
How it connects
Connects defense in depth with least privilege, zero trust, network segmentation, identity verification, and authorization.

Also explained in

Compare how 11 books explain defense in depth →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Grokking Software Architecture. The section links point to the parts of the book it draws on.