Skip to main content

CI/CD provider

ISSUE-103HighCI/CD Container Images

Container image is not pinned by digest

Control:CTRL-102Container images must be pinned by digest

📋 What is this?

When digest pinning is enabled in your configuration, every container image must be referenced by its SHA256 digest (image@sha256:...). This image is using a tag reference instead.

⚠️ Impact

Even specific version tags (e.g., python:3.12.1) can be reassigned to a different image. Digest pinning is the only way to guarantee the exact image content used in your pipeline, providing the strongest supply chain security.

🔧 How to fix

Replace the tag reference with a digest reference. You can find the digest using docker inspect or crane digest.

✗ BeforeEven specific version tags can be reassigned to a different image.
# .gitlab-ci.yml: ❌ Uses tag reference (not pinned by digest)
build:
image: python:3.12.1
script:
- python setup.py build
✓ AfterSHA256 digest ensures the exact image content is always used.
# .gitlab-ci.yml: ✅ Pinned by SHA256 digest
build:
image: python@sha256:1c5313e4a18...f4b8e
script:
- python setup.py build
# Find the digest with:
# docker pull python:3.12.1
# docker inspect --format='{{index .RepoDigests 0}}' python:3.12.1
# Or:
# crane digest python:3.12.1

💡 Tips

  • Digest pinning is a sub-option of the containerImageMustNotUseForbiddenTags control, not a control of its own: containerImagesMustBePinnedByDigest defaults to true in the shipped config.
  • Use crane digest <image>:<tag> (from go-containerregistry) for a quick digest lookup.
  • Consider automating digest updates with tools like Renovate or Dependabot.

⚙️ Configure this control

With the CLI alone: set it in your configuration file. Every field and default is in the controls configuration reference, CTRL-102.