Severity: CRITICAL · Rule ID: compose-privileged
A service sets privileged: true.
services:
worker:
image: busybox
privileged: true # <- all capabilities, all devices, no seccomp/AppArmorprivileged: true is not "a few more permissions". It grants every Linux capability,
disables seccomp and AppArmor, and exposes all host devices. A privileged container can load kernel
modules, access raw block devices, and mount the host filesystem - so escaping it is trivial by
design rather than a bug.
Remove the flag and add back only what is actually needed:
services:
worker:
image: busybox
cap_add:
- NET_ADMIN # only the capability the workload needsIf the service needs a specific device, map it explicitly with devices: rather than granting all
of them.
A container that genuinely manages host hardware - a storage or networking agent in a
controlled environment. Even then, prefer specific cap_add and devices: entries; privileged
is rarely the minimum that works.
Permanently, for the whole repository:
# .docksec.yml
rules:
disabled:
- compose-privilegedOr per finding, with a reason and an expiry that keeps the decision auditable:
# .docksec-ignore.yml
ignores:
- id: compose-privileged
reason: "why this is accepted here"
expires: 2027-01-01- Implementation:
docksec/compose_scanner.py - All compose rules · Exploit chains