Skip to main content

SKY-D296 · CI/CD pipelines

Container image not pinned by digest

High

HIGH for an image with no tag or the tag latest. MEDIUM for any other tag, such as node:20, and for an image name built from an expression.

A tag such as node:20 or latest is a movable name: whoever controls the image can point it at new content at any time. Only a digest (@sha256: followed by a hash of the image) always means the same bytes. SKY-D296 reports images that a workflow or action runs without one.

Languages
GitHub Actions workflows, Docker and composite actions
Quality gate
counted toward the gate limits (full and diff scans)
Finding type
review
Catalog name
GitHub Actions unpinned container image
Wrong result? Report itA false positive, a missed case or a confusing message: it goes privately to the founder.

Why it matters

The job runs the image with its token, secrets and checkout. If the publisher's registry account is taken over, or a tag is re-pushed by mistake, your next run executes the new content without any change in your repository to review.

What Skylos flags

.github/workflows/integration.yml · YAMLReported on line 11
name: Integration testson:  push:    branches: [main]permissions:  contents: readjobs:  integration:    runs-on: ubuntu-latest    container:      image: node:20    steps:      - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683        with:          persist-credentials: false      - run: npm ci --ignore-scripts && npm run test:integration

What Skylos leaves alone

.github/workflows/integration.yml · YAML
name: Integration testson:  push:    branches: [main]permissions:  contents: readjobs:  integration:    runs-on: ubuntu-latest    container:      image: >-        node:20@sha256:80b4246e696054e3f2b2a5e961b89190d2499487399f126d5ef2ee2174350883    steps:      - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683        with:          persist-credentials: false      - run: npm ci --ignore-scripts && npm run test:integration

Why Skylos leaves it alone

The image still carries the readable tag 20, but the @sha256: digest after it decides what runs: Docker refuses any content whose hash does not match. >- only lets the long value start on the next line.

How Skylos decides

  1. Reads workflow files under .github/workflows and action.yml / action.yaml files.
  2. In a workflow, looks at each job's container (written as text or as image:), the image of each services entry, and steps that use docker://<image>. In an action, looks at runs.image when runs.using is docker.
  3. In every run: step, finds lines that start with docker run or docker pull and takes the first word after the options as the image.
  4. An image that contains @sha256: passes. Otherwise it is reported: HIGH with no tag or the tag latest, MEDIUM with another tag or when the name contains ${{ … }}, because the value cannot be checked.
  5. One finding per image, on the first line of the file that contains the image text.

How to fix it

Pin each image by digest and keep the tag in front of it so readers still see the version. docker buildx imagetools inspect node:20 prints the digest. A dependency bot such as Renovate can update it later in a reviewed pull request.

.github/workflows/integration.yml · YAML · the fix, against the flagged file
name: Integration testson:  push:    branches: [main]permissions:  contents: readjobs:  integration:    runs-on: ubuntu-latest    container:Removed:       image: node:20Added:       image: >-Added:         node:20@sha256:80b4246e696054e3f2b2a5e961b89190d2499487399f126d5ef2ee2174350883    steps:      - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683        with:          persist-credentials: false      - run: npm ci --ignore-scripts && npm run test:integration

When it can be wrong

  • A Docker action with image: Dockerfile, which GitHub builds from the action's own repository, is reported as an unpinned HIGH image.
  • An image built earlier in the same job, as in docker build -t app:ci . followed by docker run app:ci, is reported as a tagged image.
  • The finding sits on the first line of the file that contains the image text, which can be an earlier mention of the same name.
  • Missed: docker create, docker compose, sudo docker run, podman and images named in Compose files.

Seeing a case that isn't listed here? Report the wrong result so the rule can be fixed. Don't paste company code: describe the shape of it.

How to silence it

  • Put # skylos: ignore[SKY-D296] at the end of the reported line or on the line directly above it, one rule per marker.

    YAML
    container:  # skylos: ignore[SKY-D296] image built and signed by our own pipeline  image: ghcr.io/acme/ci-runner:2026.11
  • [tool.skylos] ignore = ["SKY-D296"] turns the rule off for the whole project.

From the Skylos rule handbook, Skylos 5.8.0 (commit 5b880b0). All rules.