LOGBOOK

HELP

Quiz Entry - updated: 2026.11.26

What does the --privileged flag give a container, and why is CAP_SYS_MODULE in particular so dangerous?

--privileged grants a container almost all capabilities and broad device access. CAP_SYS_MODULE lets it load kernel modules — i.e. run arbitrary code in the host kernel, escaping any container boundary.

A normal container runs with a restricted set of Linux capabilities. Starting it with --privileged removes nearly all of those restrictions — it is close to running directly on the host. Among the capabilities it gains is CAP_SYS_MODULE, the right to insert and remove kernel modules (insmod / rmmod).

Why that is catastrophic: a kernel module runs in kernel space, with full power over the machine. An attacker who already has a foothold in a --privileged container can:

  1. Compile a kernel module on (or copy one to) the container.
  2. insmod it — the module loads into the host kernel (observable in the host's journalctl -k).
  3. From inside that module do anything the host kernel can: every door to the host is open.

So --privileged + CAP_SYS_MODULE turns a container foothold into total host compromise. The principle to take away is least privilege: a container should hold only the exact capabilities it needs. Later sections (capabilities, seccomp) show how to drop the rest — and you should essentially never run untrusted workloads with --privileged.

Go deeper:

From Quiz: ISLAB / Docker Security | Updated: Nov 26, 2026