Skip to main content

CI/CD provider

ISSUE-103HighCI/CD Container Images

Container image is not pinned by digest

Control: Container images must be pinned by digestยท Config key: containerImageMustNotUseForbiddenTags

๐Ÿ“‹ 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
# .plumber.yaml
gitlab:
controls:
containerImageMustNotUseForbiddenTags:
enabled: true
containerImagesMustBePinnedByDigest: true

๐Ÿ’ก 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.

โš™๏ธ Configuration

This control is configured in .plumber.yaml under the gitlab section:

gitlab:
  controls:
    containerImageMustNotUseForbiddenTags:
      enabled: true

See the CLI documentation for the full configuration reference.