How is the CIS Docker Benchmark organised, and why in that order?
Seven sections that climb the stack: host configuration, daemon configuration, daemon configuration files, container images and build files, container runtime, security operations, and Swarm configuration.
| § | Section | Typical recommendations |
|---|---|---|
| 1 | Host configuration | separate partition for /var/lib/docker, hardened and up-to-date host, only trusted users may control the daemon, auditd rules on Docker files |
| 2 | Docker daemon configuration | restrict inter-container traffic, TLS for the daemon, user namespaces, centralised logging, no-new-privileges |
| 3 | Daemon configuration files | ownership root:root and tight permissions on docker.service, docker.socket, /etc/docker, certificates |
| 4 | Container images and build file | create a non-root user, trusted base images, no secrets in Dockerfiles, COPY instead of ADD, content trust |
| 5 | Container runtime | AppArmor/SELinux, restricted capabilities, no --privileged, memory/CPU/PID limits, read-only root FS, no mounted Docker socket |
| 6 | Docker security operations | avoid image sprawl and container sprawl |
| 7 | Docker Swarm configuration | swarm off unless needed, auto-lock, encrypted overlay traffic, certificate rotation |
The order follows the order of trust. Everything sits on the host, so a compromised host makes every container setting meaningless. Next comes the daemon, which runs as root and controls all containers, and then its files, because whoever can edit daemon.json reconfigures the daemon. Only then do the images (what gets run) and the runtime (how it is run) matter. Operations and Swarm cover keeping it that way over time and across a cluster.
This is also the layout a Security Bench report follows, so a WARN in section 5 points at how a container was started, while a WARN in section 1 points at the machine underneath.
Go deeper:
CIS Docker Benchmark — download page for the current version, whose sections still follow this host-to-runtime order.
GitHub: docker/docker-bench-security — the checks grouped by the same section numbers, so a finding maps straight back to its recommendation.