Docker audit fixes
Volume Permissions: fixing all 7 checks
The volume audit reads every container's mount table and the /var/lib/docker/volumes tree, so it finds which host paths a container can reach and which volume data a local account can write.
Three of the seven stat /var/lib/docker/volumes and need real root: docker group membership gets you the daemon but not that directory, so they skip with a "Need root" message while the four container-side checks still run. Those same three skip on a host with a custom data-root, because the path they look under is hard-coded.
Transcribed from the docker-security-volume-permissions audit script.
Find your finding
Listed in the order the audit runs them. Take the check name from the third field of the result line and open its page.
Sensitive Host Path Mounts
SoonChecks for containers bind-mounting sensitive host paths (/, /etc, /root, /proc, /sys, docker.sock, /var/lib/docker, /home)
HighNeeds root3 resultsWritable Volume Mounts
SoonCounts read-write vs read-only volume mounts and flags a writable docker.sock
HighNeeds root3 resultsWorld-Writable Volumes
SoonScans Docker volume data directories for world-writable permissions
MediumNeeds root3 resultsVolume Ownership
SoonFlags volume data owned by UIDs with no matching host user (orphaned ownership)
MediumNeeds root3 resultsVolume Directory Permissions
SoonChecks for overly permissive (777) modes on volume directories and the volumes root
MediumNeeds root3 resultsAnonymous/Dangling Volumes
SoonDetects dangling (unused/orphaned) Docker volumes
LowNeeds root3 resultsRead-Only Volume Enforcement
SoonChecks whether containers enforce a read-only root filesystem
MediumNeeds root3 results
How the Volume Permissions audit reads your server
Every check in this audit runs after the same preamble, and several of its results only make sense once you know what that preamble could and could not see.
The first two and the last two evaluate all containers (docker ps -a, including stopped); the three /var/lib/docker/volumes checks need root.
Docker detection: DOCK=direct if docker ps works as the audit user (docker group), DOCK=root if it works through sudo; the dk helper wraps docker accordingly. IDS is the list of running container IDs and NRUN their count; dk inspect --format is used with Go templates. Podman is recognised but not audited.
A SKIP is never a pass
A skipped check verified nothing at all. The most common cause is privilege: 7 of the 7 checks in this audit need root for a complete result. Before every run, each script works out which of four privilege modes it is in.
| Mode | How it is reached | What it means for your results |
|---|---|---|
root | The audit runs as UID 0. | Every privileged branch runs directly. No check skips for lack of permission. |
nopass | sudo -n true succeeds, so the account has passwordless sudo. | Privileged commands run through sudo -n. |
pass | A sudo password was supplied in the CtrlOps audit settings and accepted. | Privileged commands run through sudo -S. |
none | None of the above worked. | CAN_ROOT=0. Every privileged branch returns SKIP with a "Need root" message rather than guessing. |
If many checks skip with a “need root” message, run the audit as root, grant the audit account sudo (with or without NOPASSWD), or supply the sudo password in the CtrlOps audit settings. For Docker checks, membership of the docker group is an alternative to sudo: run usermod -aG docker <user> and log in again.
Volume Permissions questions
Run all 7 Volume Permissions checks, in one click
CtrlOps runs this audit over your existing SSH connection - no agents, no scripts to manage. $7/user/month after a 1 month free trial - no credit card required.
✓ Start instantly·✓ No credit card·✓ No sneaky autorenewals