Safeguard
Software Supply Chain•

How do you vet a Docker Hub image before you pull it?

Check the publisher badge, prefer curated image programs, pin by digest, read the build provenance, scan the layers and run it unprivileged. A pre pull checklist.

Safeguard Security Team
4 min read

To vet a Docker Hub image, check who publishes it and whether it belongs to a curated program, pull by digest instead of tag, inspect its attestations, scan its contents, and run it first with no privileges and no secrets. A name that looks familiar is not evidence.

Who publishes the image?

Docker Hub marks several kinds of trusted content. Docker's documentation lists Docker Official Images, Docker Hardened Images, Verified Publisher images and Docker-Sponsored Open Source Software images. Official Images are a curated set of repositories with clear documentation, a focus on best practices and regular updates.

Anything outside those programs is a community image. That does not make it bad, but it moves the burden of proof to you. Look at the namespace, how long it has existed, whether a source repository is linked, and whether the Dockerfile in that repository matches what the image claims.

A constructed example: you search for a Redis image and see redis-fast with a large pull count next to the official redis. Pull counts can be inflated and say nothing about contents. Use the official one unless you can name a reason.

Why pull by digest?

Tags are labels that publishers can move. Docker's pull documentation describes digests as the immutable identifier: pulling by digest lets you pin an image to exactly one version and guarantees it is always the same. Docker prints the digest after a pull.

docker pull ubuntu:24.04
# note the line starting with Digest: sha256:
docker pull ubuntu@sha256:<digest-you-recorded>

Record the digest you vetted in your Dockerfile or deployment manifest. When you want an update, you repeat the vetting for the new digest.

What can you learn from attestations?

Images built with BuildKit can carry provenance and SBOM attestations. Docker's attestation docs show how to read them with docker buildx imagetools inspect, using the .Provenance attribute for SLSA data. Check the source repository and revision, and whether the base images are themselves pinned.

Absence tells you something too. A missing attestation does not mean malicious, but it means you cannot see how the image was built and must rely on scanning and sandboxing instead.

What should you scan?

Scan the image layers for known vulnerable packages and for embedded secrets. Compare the package list with what the application needs: a web proxy image that includes a compiler and a package manager has more attack surface than one that does not. Check which user the process runs as, and whether the image expects to run privileged.

Run the scan on the exact digest you intend to deploy, not on a tag you pulled last week. Safeguard's container image scanning and SBOM tooling can do this check, and its policies can block images that fail your rules at the pull request or pipeline stage.

How do you run it safely the first time?

Use a throwaway host or VM. Run the container without --privileged, without mounting the Docker socket or your home directory, without cloud credentials in the environment, and with outbound network blocked unless you need to observe it. A container that tries to reach unexpected hosts on first start deserves a closer look.

What to do

  1. Prefer Official, Hardened, Verified Publisher or Sponsored OSS images where one exists.
  2. For community images, check namespace history and the linked source repository.
  3. Pull once, record the digest, and reference the digest from then on.
  4. Inspect provenance and SBOM attestations when present.
  5. Scan the exact digest for vulnerabilities and secrets.
  6. Test run unprivileged, with no secrets and restricted network.
  7. Put the digest in version control so changes are reviewed.

Quick check

Is a high pull count a sign an image is safe?

No. It shows popularity, not trustworthiness. Use publisher status, source linkage, attestations and scanning.

Does pinning by digest stop me getting security updates?

It stops automatic updates. Schedule a regular review where you vet and record a new digest, and use automation to open the pull request.

Sources

Last reviewed: 18 October 2026.

Never miss an update

Weekly insights on software supply chain security, delivered to your inbox.

Self-healing security runs on Safeguard.

Your first fix PR is minutes away.

No sales call required, even your agent can complete the purchase over MCP.