Docker container security: a checklist for small teams
Review Docker access, privileges, networking, resource limits, secrets and image controls using OWASP's container security guidance.
OWASP's Docker Security Cheat Sheet says Docker, used correctly, can improve security compared with running apps directly on a host, but some misconfigurations lower it or add new holes. The sheet is a numbered list of rules. We read all of it on 15 November 2026 and did not read the Docker, NIST SP 800-190 or other pages it links. Everything attributed is OWASP's; tool names appear only because the sheet names them, and we do not endorse any of them. Check current Docker documentation before applying any setting.
The rules, in plain words
- 0. Keep host and Docker up to date. Containers share the host's kernel, so a vulnerable kernel is a vulnerable container. The sheet gives the Dirty COW kernel exploit and the Leaky Vessels container escape bugs as examples.
- 1. Do not expose the Docker daemon socket, not to the network and not to other containers. Access to it is equivalent to root on the host. The sheet says mounting the socket read-only does not make the API read-only. It also warns that a daemon listening on an open TCP address is unauthenticated and unencrypted.
- 2. Set a user. Run as an unprivileged user (at run time, in the Dockerfile, or with user namespace support); the sheet also gives the Kubernetes equivalent.
- 3. Limit capabilities. Never use the
--privilegedflag. The most secure setup is to drop all capabilities and add back only what the container needs. - 4. Prevent privilege escalation inside the container with the
no-new-privilegesoption (Kubernetes:allowPrivilegeEscalation: false). - 5. Mind inter-container connectivity. Containers attached to the default bridge can communicate by default; network attachment and explicit policy affect reachability. The sheet prefers defining specific networks over turning communication off entirely, and Kubernetes network policies for pods.
- 5a. Published ports can bypass host firewalls such as UFW. Docker adds its own firewall rules, so a published port may be open to the internet despite a deny rule. The sheet's options: bind the host side to 127.0.0.1, or use a tool that makes Docker follow the firewall.
- 6. Use a Linux security module (seccomp, AppArmor or SELinux), start from the default profile and never disable it. For runtime monitoring it names tools for detecting unexpected activity.
- 7. Limit resources: memory, CPU, restarts, file descriptors and processes, to limit denial-of-service damage.
- 8. Use a read-only filesystem, with a temporary filesystem if the app must write, and mount volumes read-only where possible.
- 9. Scan in CI/CD. Lint Dockerfiles (user set, pinned base image and OS packages,
COPYinstead ofADD, no piping downloads into a shell) and scan images for known vulnerabilities, secrets and misconfigurations. The sheet lists free and commercial scanners; we do not name them. - 10. Keep the daemon log level at
info, notdebug, unless needed. - 11. Consider rootless mode, which runs the daemon and containers without host root. OWASP says it does not guarantee protection from kernel vulnerabilities, since the kernel is still shared, and that
userns-remapis different because the daemon still runs as root. - 12. Use secrets properly. Use Docker secrets, not images or command lines. For local Compose, file-backed secrets are just bind mounts, so protect the files; the sheet says this differs from Swarm secrets, and that Kubernetes secrets are stored unencrypted by default unless extra measures are taken. For build-time secrets, do not pass credentials through
ARG,ENVor copy-then-delete: the sheet says they persist in image layers. Use BuildKit secret mounts, which are not saved in the image, and still avoid writing or printing the value. - 13. Strengthen the supply chain: record image provenance, generate a software bill of materials (SBOM) per image, sign images, store them in an access-controlled registry, and deploy with image validation and monitoring.
The sheet also describes Podman as a daemonless alternative with rootless containers and SELinux integration. We did not evaluate it.
Questions for your team
- Who can reach the Docker socket, on which hosts and containers?
- Which containers run as root, privileged or with extra capabilities, and why?
- Which published ports are reachable from outside?
- Where do build and runtime secrets live, and could any be in an image layer?
- Is the host kernel and Docker patched, and who is responsible?
- Do images get scanned before deploy?
Related: secrets management basics, cloud cost control (resource limits), REST API security checklist.
Limits
One OWASP page, read in full. Docker features and defaults change, so check the current Docker documentation and your orchestrator's before applying anything. We give no code, no statistics and no tool recommendations. Rootless and similar options have limitations the sheet points to the Docker documentation for, which we did not read. Production container security usually also involves your cloud provider's controls, which this post does not cover.
By Omnistu.