liveBook · Manning

Defense in depth

As explained in Kubernetes for Developers

Defense in depth is a security strategy that layers multiple independent protections so that failure of one protection does not compromise the entire system.

Defense in depth layers independent protections so one breach does not expose the entire system. For containers, isolation should be reinforced by non-root execution. section 12.4

A containerized application can be protected by:

  • Application-level defenses. section 12.4
  • Linux containerization that limits access to the host. section 12.4
  • Linux user privileges that prevent a container escape from immediately granting node-level root access. section 12.4

Run a container as non-root

Set runAsNonRoot: true and, when needed, runAsUser: 1001. A matching image USER directive may be required; otherwise Kubernetes can reject the container or the application may fail when binding to port 80. Move the server to port 8080 and target it from the Service.

How Kubernetes for Developers covers it

How deep it goes
Explains three defense layers and works through identity, permissions, ports, and service configuration.
Examples
Uses Kubernetes manifests, Dockerfile USER settings, port 8080 migration, and permission-related pod failures.
What it assumes
Assumes container deployment familiarity while teaching non-root configuration and its operational consequences.
What you can do after
Operate containers with non-root identities and diagnose resulting startup, port, and filesystem permission errors.
How it connects
Connects application security, container isolation, container escape vulnerabilities, and Linux user privileges.

Also explained in

Compare how 7 books explain defense in depth →

Related concepts

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