Free — no signup required

Introduction: Is Docker Secure Enough?

2 min read

The Shared Kernel Problem

Think of a standard container like a private office cubicle in an open-plan office. You have your own desk, your own files, and your own space — but you share the same building infrastructure: the electrical system, the plumbing, the HVAC. If something goes wrong with the building's core systems, everyone is affected. Standard containers work the same way: each container gets its own isolated filesystem, network, and process space, but they all share the host OS kernel.

When you run a container with Docker or containerd, your application is ultimately just a process on the host server. The isolation is enforced by two Linux kernel features:

  • Namespaces: Make the process think it has its own filesystem, network, and process tree.
  • cgroups (Control Groups): Limit how much CPU, memory, and I/O the process can consume.

This is efficient and fast — but the isolation is only as strong as the kernel itself.

The Risk — Container Escape: If an attacker discovers a vulnerability in the Linux kernel (a "container escape" bug), they can break out of the namespace boundary entirely and gain access to the host. From there, they can read memory from other containers on the same node, access secrets, or pivot to the rest of your infrastructure. In a multi-tenant environment — where you're running workloads for multiple customers on the same physical node — a single kernel vulnerability can compromise every tenant simultaneously.

For most internal workloads, this risk is acceptable because you trust your own code. But for high-security environments — running untrusted third-party code, processing regulated data, or operating a public SaaS platform — the shared kernel model is a fundamental architectural weakness.

Interview Tip

Interviewers often ask: "Are containers secure?" The correct answer is nuanced: containers provide process isolation, not VM-level isolation. The shared kernel is the fundamental trust boundary. If you need stronger guarantees — multi-tenancy, untrusted code execution, regulated workloads — you need sandboxed runtimes or actual VMs. Saying "yes, containers are secure" without this qualification signals a shallow understanding of the threat model.

This is one of 18 chapters

Every chapter is free — Kubernetes, Terraform, SRE, distributed systems, and more — with fast daily review built in.

Sign up free