Non-FictionAnnual CheckupContainer Security
Container Security Incidents eBook
Review Docker and Kubernetes misconfiguration and
by Le Kyong
Review Docker and Kubernetes misconfiguration and escape vulnerabilities.
Formats
Free sample
Chapter 1: The Three Doors...–- The alert arrived at 3:47 AM on a Tuesday. Not the dramatic, screen-filling red alert from the movies—just a single line of gray text in a Slack channel that had been quiet for months. "High severity: privileged container detected on node k8s-prod-12." The on-call engineer, half-asleep, dismissed it as another false positive from the new runtime security tool. She rolled over and went back to sleep. Twelve hours later, the entire cluster was mining cryptocurrency for an unknown wallet in Belarus.
The company’s cloud bill for that single day: $47,000. The attacker’s path? A Node.js container with a vulnerable lodash library, running with --privileged=true because “it wouldn’t work otherwise.”This is not a story from 2018, when containers were new and nobody knew better. This happened last quarter. And it happens every single day, in startups and Fortune 500s alike, because the fundamental misunderstanding of container security persists: engineers treat containers like lightweight virtual machines, but attackers treat them like what they actually are—processes on a shared kernel with a thin wrapper of isolation.This chapter establishes the framework that will guide the rest of this book.
By the time you finish these pages, you will understand precisely why containers fail, where attackers look first, and why your organization is almost certainly vulnerable to at least one of the three doors we are about to open.The Shared Kernel Reality: Why Your Container Is Not a VMLet us begin with a statement that sounds obvious but is almost universally misunderstood: containers do not contain. The very name "container" suggests a sealed box, something you can put goods into, close the lid, and trust that nothing gets in or out. This mental model is dangerous. A better metaphor is a cubicle in an open office. You have walls, but they do not reach the ceiling.
Your neighbor can hear you, and if they stand on their desk, they can see everything you are doing.Technically, containers are a set of Linux kernel features applied to a process. When you run docker run --rm -it ubuntu bash, Docker creates a new process on the host—exactly the same as if you had run bash directly. The difference is that Docker asks the kernel to apply several "namespaces" to that process. Namespaces limit what the process can see. A PID namespace makes the process think it is PID 1 (the first process) when in reality it might be PID 28471 on the host.
A network namespace gives the process its own virtual network stack, with its own loopback interface and its own view of network ports. A mount namespace restricts which filesystem mounts the process can see.But crucially, the kernel is shared. There is only one kernel running on the host. Every system call—every open(), every read(), every execve()—travels from the container process directly into the host kernel. The kernel checks whether the calling process has the appropriate permissions (capabilities, namespace memberships, seccomp filters) and then executes the request.
If the kernel has a bug, or if the permissions are too broad, the isolation fails.Contrast this with a virtual machine. A VM runs a full operating system, with its own kernel, on top of a hypervisor. The hypervisor (KVM, VMware, Xen) acts as a true hardware boundary. A process inside a VM cannot make a system call to the host kernel because the host kernel is not visible—there is an entire additional operating system in between. This is why VMs are considered secure for multi-tenant environments and containers are not.
The overhead of a VM is higher, but the isolation is vastly stronger.The industry has spent the last decade trying to close this gap. Projects like Kata Containers and g Visor (which we will cover in Chapter 11) attempt to give containers VM-like isolation. But in the vast majority of production clusters today, the isolation between containers is exactly the thin Linux namespace layer described above. And that layer has holes.The Three Doors: How Attackers Enter After analyzing hundreds of real-world container security incidents—from public breach disclosures, private incident response reports, and red team exercises—a clear pattern emerges. Attackers do not use sophisticated kernel exploits most of the time.
They walk through one of three doors that operators left unlocked.We call this the Three Doors framework. Every container security incident falls into one of these categories:Door One: The Supply Chain (Pre-Runtime)The first door opens before the container ever runs. An attacker injects malicious code into the container image during the build process, and that code is baked into the artifact that gets deployed to production. This is the supply chain vector.The most common examples include:Vulnerable base images: An application uses node:latest as its base image, and that image contains a known CVE (like the infamous lodash prototype pollution vulnerability from 2019, or the log4shell vulnerability in Java images from 2021). The vulnerability is not introduced by the application code; it ships with the base image.Typosquatting: A developer types FROM ubunutu:latest instead of FROM ubuntu:latest.
The malicious image with the typo sits on Docker Hub, waiting to be downloaded. It contains a cryptominer and a reverse shell. According to a 2024 study by Docker Security, typosquatted images have been downloaded over 500,000 times cumulatively.CI/CD pipeline poisoning: An attacker gains access to a Git Hub Actions secret or a Jenkins credential (often leaked in a public repository or a compromised developer laptop). They modify the build pipeline to inject a backdoor into the official image that the company builds and ships to customers. Every downstream customer receives the compromised image.We will explore Door One in depth in Chapter 10.
For now, the critical insight is that this door opens during the build phase. By the time the container reaches production, the attacker is already inside. No runtime security tool can prevent this if it is not scanning for behavioral anomalies—only image signing, pinned digests, and rigorous CI/CD controls can stop it.Door Two: The Runtime (Misconfigurations)The second door is the most common—accounting for approximately 95% of real-world container security incidents according to an analysis of over 10,000 production clusters conducted by the Cloud Native Computing Foundation in 2024. This is the runtime misconfiguration door. The container runs with privileges, flags, or mounts that break the isolation model.The most dangerous misconfigurations are:--privileged flag: Running a container with this flag disables all seccomp filters, all App Armor/SELinux profiles, and grants every Linux capability the kernel offers.
As we will see in Chapter 3, an attacker inside a privileged container can escape to the host in less than 30 seconds using the nsenter tool.Docker socket mount (/var/run/docker.sock): Many CI/CD tools and monitoring agents mount the Docker socket into a container so that the container can control the Docker daemon. This is equivalent to giving the container root access to the host. Chapter 5 demonstrates an attack that uses curl to instruct the host's Docker daemon to spin up a new, fully privileged container.Dangerous Linux capabilities: Even without --privileged, a container might receive specific dangerous capabilities like CAP_SYS_ADMIN (allows mounting filesystems)…
This is the end of the free sample. Get the eBook to keep going. Buy now
About this book
Details
- Author
- Le Kyong
- Publisher
- SamEnrico
- Language
- English
- Genre
- Non-Fiction, Annual Checkup, Container Security
- Released
- 2026-06-08
- Pages (approx.)
- 152
- Available as
- eBook, Audiobook
Read better in the ZLOADR app
Your eBooks on your phone or tablet. Sign in with your SamEnrico account and start reading.
More by Le Kyong
Bipolar And Pregnancy GuideLe Kyong$11.99
The Intuitive Eating Addiction RecoveryLe Kyong$11.99
Micro Induction BuprenorphineLe Kyong$11.99
Imposter Syndrome Journal GuideLe Kyong$11.99
Navarino: The Battle That Shattered Ottoman RuleLe Kyong$11.99
Construction SuperintendentLe Kyong$11.99
Understanding Primary Ciliary DyskinesiaLe Kyong$17.99
Search Console Video IndexingLe Kyong$12.99
Jewelry Export Ethical SourcingLe Kyong$12.99
A Beginners Guide to Football tennis (Volume 1)Le Kyong$11.99You may also like
Hong Kong Handover 1997Dunn Johnnie$11.99
Zumba For Postnatal Recovery CourseNeal Christian$11.99
Zumba for BeginnersLadner Nikia$11.99
YouTube Comment Mining GuideHumes Pandora$12.99
Worry Box MeditationCarlin Rudy$11.99
Workplace Stress MeditationNguyen Lynn$11.99
Workplace Stress and Sleep RepairHawley Ivory$11.99
Workplace Perfectionism CureDelaney Jeffry$11.99
Workplace Injustice Anger GuideWallen Isabelle$11.99
Work Addiction and Burnout LinkGreenwood Ester$11.99
Women in Yoga and WellnessBeattie Galina$11.99
Women in Stand Up ComedyChun Evangeline$11.99