Skip to content

Docker audit fix · Network & Supply Chain

How to Audit and Secure Unpinned Running Docker Images

A container started from a bare image name or the latest tag cannot be tied back to a tested build, because the tag moves under you. Redeploy those containers pinned to a version or a digest, and keep an image scanner available.

Hiren KalariyaHiren KalariyaLast reviewed image-hygiene
CtrlOpsUnpinned Running ImagesMEDIUM

What did your audit say?

WARN · when the audit printed

Unpinned containers and no scanner

Both halves failed: containers are running from references that move, and no scanner binary is installed here to tell you what is inside them.

WARN · when the audit printed

Unpinned containers (scanner present)

A scanner was found, but at least one running container came from a bare name or :latest, so you cannot say which build is actually in production. The message names the scanner it found.

WARN · when the audit printed

Pinned but no scanner

Image references are pinned, but no scanner binary exists on this host. Scanning done in CI is invisible here and is a perfectly good answer to this half.

Severity
Medium
Needs root or sudo
Yes
Results it can return
WARN · SKIP · PASS
Check in this audit
5 of 5

Every threshold on this page is transcribed from the docker-security-network-supply-chain audit script that CtrlOps runs, and a build check fails if the two ever disagree. See all 5 Network & Supply Chain checks, or how the audit runs.

It reads the image reference of every running container with docker ps --format '{{.Image}}' and counts the ones matching :latest$ or having no tag and no digest at all (^[^:@]+$, a bare nginx). Separately it hunts for a scanner, checking PATH for trivy, grype, docker-scout, clair and snyk and then trying docker scout version. The two signals are combined into one result: a PASS needs an unpinned count of zero and at least one scanner, and every other combination, pinned images with no scanner included, is a WARN.

Needs a reachable daemon; otherwise SKIP. Note it does not SKIP when nothing is running - with no containers the image count is zero and the result then turns purely on whether a scanner is installed. It combines two unrelated signals: the images of running containers matching :latest or carrying no tag or digest at all (^[^:@]+$, i.e. bare nginx), and whether any of trivy, grype, docker-scout, clair, snyk is on PATH or docker scout version works. PASS requires both - pinned images and a scanner present. Other floating tags (stable, main, edge) are not matched, and the scanner test only proves a binary exists, never that anything is scanned.

What each result means
ResultWhenWhat it means
SKIPDaemon unreachableNeither half ran, so nothing is known about your image references or your scanning tools. The scanner probe sits inside the same branch and is skipped with everything else.
WARNUnpinned containers and no scannerBoth halves failed: containers are running from references that move, and no scanner binary is installed here to tell you what is inside them.
WARNUnpinned containers (scanner present)A scanner was found, but at least one running container came from a bare name or :latest, so you cannot say which build is actually in production. The message names the scanner it found.
WARNPinned but no scannerImage references are pinned, but no scanner binary exists on this host. Scanning done in CI is invisible here and is a perfectly good answer to this half.
PASSPinned and a scanner is availableNo running image matched the unpinned pattern and a scanner binary is present. Other floating tags such as stable or main are not matched, and an installed scanner is not evidence that anything gets scanned.

Combines two supply-chain hygiene signals: reproducible, pinned deployments (CIS Docker 4.2, OWASP Docker Cheat Sheet Rule #9) and the presence of scanning tooling (CIS Docker 4.4). A container running app or app:latest cannot be correlated with a tested build.

  • docker ps shows the image name as given at docker run. Compose with image: app and a local build: shows app (no tag) → unpinned. Tag local builds with a version (image: app:${GIT_SHA}).
  • Digest-pinned images (nginx@sha256:...) contain @ and correctly count as pinned.
  • The bare-name pattern treats any : as a tag, so an untagged image from a registry with a port, localhost:5000/app or registry.example.com:5000/team/app, counts as pinned even though it resolves to latest.
  • Scanner presence on the host is a proxy; CI-side scanning is invisible and perfectly acceptable. A PASS requires a local scanner binary, which many teams do not install on production hosts. Treat the scanner half as advisory.
  1. Find the unpinned containers

    sh
    docker ps --format '{{.Image}} {{.Names}}' | grep -E '^([^:@ ]+|[^ ]*:latest) '

    Also check by eye for untagged references to a registry with a port, such as localhost:5000/app, which the check counts as pinned.

  2. Pin a version or digest

    sh
    docker image inspect <image> --format '{{index .RepoDigests 0}}'

    yaml
    image: nginx:1.27.1                 # or nginx@sha256:<digest>

    For a service built locally, give the build a version: image: app:${GIT_SHA}.

  3. Recreate the containers

    A container keeps the reference it was created from, so the finding only clears once it is recreated.

    sh
    docker compose up -d --force-recreate

  4. Scan images, here or in CI

    Install trivy on the host to clear the other half of the check, or rely on the scanning stage in CI, where a failed scan can block a release. The CI route is the stronger one even though this check cannot see it.

sh
# Running images, and which of them are unpinned:docker ps --format '{{.Names}}\t{{.Image}}'docker ps --format '{{.Image}}' | grep -E '(:latest$|^[^:@]+$)'# expected: no output# The strongest pin is a digest:docker inspect -f '{{.Name}} {{.Config.Image}}' $(docker ps -q)     # @sha256:... in the reference means digest-pinneddocker image inspect <image> --format '{{index .RepoDigests 0}}'# A scanner being installed is not the same as scanning - prove it runs:trivy image --quiet --severity CRITICAL,HIGH <image>

Debugging

  • The audit account could not talk to the daemon. To find out why, check systemctl is-active docker, then docker ps as the audit user and sudo docker ps, and run the audit as root or with sudo if only the second works. A host where the daemon answers but nothing is running does not SKIP here; it gets a result decided by the scanner half alone. The Docker Inventory check walks through the unreachable case in more detail.
  • Half the check. Install trivy (or grype/scout); more importantly, scan in CI where you can block a release, since a scanner on the host proves nothing about your pipeline.
  • Repin in the Compose file or run command and recreate the containers. A container keeps the image it was created from, so the finding will not clear until you docker compose up -d --force-recreate.
  • stable, main, edge and truncated version tags are not matched by the pattern. Review your image: keys directly.
  • That is the trade-off. Pair digest pins with a scheduled rebuild or a bot (Renovate/Dependabot) that raises the pin deliberately, so upgrades are a reviewed change rather than an accident.
  • Image tagging is also covered by Floating Image Tags (local images, not running ones) and scanning by Image Vulnerability Scan (which actually runs the scanner). Treat this one as the summary and those as the detail.

Sources

Next

Re-run the Network & Supply Chain audit after applying the fix and confirm this check moves to PASS. CtrlOps runs all 5 checks over your existing SSH connection and scores the result, so the change is visible without reading another config file.

Download for MacDownload for WindowsAll 5 Network & Supply Chain fixes

14-day free trial, no credit card required.

Explore article with AI tools

Written by

Hiren Kalariya

Co-Founder & CEO, TST Technology

Hiren Kalariya is the Co-Founder and CEO of TST Technology and the product lead behind CtrlOps, a local-first desktop app that makes Linux server management fast and easy for developers and DevOps teams. Over the past five years he has shipped 60+ production systems, and he still tests every tool he writes about on real servers.

Stop juggling tools. Start managing fleets.

PuTTY
Termius
MobaXterm
WinSCP
SecureCRT
Royal TS
Warp
CtrlOps14 tools left
Webmin
aaPanel
RunCloud
Dokploy
IP spreadsheet
bash (2)
sticky notes

One app. All your servers. No context switching. Free to start, free to leave.

Start instantly · No credit card · Cancel anytime

Your privacy preferences. We use product analytics to improve CtrlOps. Google Analytics cookies and live chat stay off until you allow them. Cookie policy