Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ARG BASE_IMAGE=registry.access.redhat.com/ubi9-micro:latest

FROM registry.access.redhat.com/ubi9/go-toolset:9.8-1786023237 AS builder
FROM registry.access.redhat.com/ubi9/go-toolset:9.8-1786351949 AS builder

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

πŸ”’ Security & Privacy | 🟠 Major | ⚑ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail

image='registry.access.redhat.com/ubi9/go-toolset:9.8-1786351949'
digest="$(skopeo inspect --format '{{.Digest}}' "docker://${image}")"

test -n "${digest}"
printf 'Use: %s@%s\n' "${image}" "${digest}"

Repository: openshift-hyperfleet/hyperfleet-adapter

Length of output: 221


🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail

printf '%s\n' '--- Dockerfile ---'
cat -n Dockerfile

printf '%s\n' '--- related container files ---'
find . -maxdepth 2 -type f \( -iname 'Dockerfile*' -o -iname 'Containerfile*' -o -name '.dockerignore' \) -print

Repository: openshift-hyperfleet/hyperfleet-adapter

Length of output: 2626


🏁 Script executed (no clone):

#!/usr/bin/env bash
set -euo pipefail

image='registry.access.redhat.com/ubi9/go-toolset'
tag='9.8-1786351949'
url="https://${image}/manifests/${tag}"
accept='application/vnd.oci.image.index.v1+json, application/vnd.docker.distribution.manifest.list.v2+json, application/vnd.oci.image.manifest.v1+json, application/vnd.docker.distribution.manifest.v2+json'

curl --fail --silent --show-error --location \
  -H "Accept: ${accept}" \
  -D /tmp/manifest-headers \
  -o /tmp/manifest \
  "${url}"

printf '%s\n' '--- response digest ---'
awk 'BEGIN{IGNORECASE=1} /^Docker-Content-Digest:/ {print}' /tmp/manifest-headers
printf '%s\n' '--- manifest media type and digest ---'
jq -r '.mediaType // "no-json-media-type", (.manifests[]? | [.platform.os, .platform.architecture, .digest] | `@tsv`)' /tmp/manifest

Length of output: 176


🏁 Script executed (no clone):

#!/usr/bin/env bash
set -euo pipefail

repo='ubi9/go-toolset'
tag='9.8-1786351949'
url="https://registry.access.redhat.com/v2/${repo}/manifests/${tag}"
accept='application/vnd.oci.image.index.v1+json, application/vnd.docker.distribution.manifest.list.v2+json, application/vnd.oci.image.manifest.v1+json, application/vnd.docker.distribution.manifest.v2+json'

curl --fail --silent --show-error --location \
  -H "Accept: ${accept}" \
  -D /tmp/manifest-headers \
  -o /tmp/manifest \
  "${url}"

printf '%s\n' '--- response digest ---'
awk 'BEGIN{IGNORECASE=1} /^Docker-Content-Digest:/ {print}' /tmp/manifest-headers
printf '%s\n' '--- manifest ---'
jq -c '{mediaType, schemaVersion, manifests: [.manifests[]? | {platform, digest}]}' /tmp/manifest

Length of output: 921


🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail

printf '%s\n' '--- all FROM instructions and base-image declarations ---'
rg -n '^\s*(ARG .*IMAGE|FROM )' Dockerfile 'test/Dockerfile.integration' || true

printf '%s\n' '--- container hardening guidance ---'
rg -n -A8 -B3 'digest|base image|container' ../architecture/hyperfleet/standards ../architecture/hyperfleet/components 2>/dev/null || true

Repository: openshift-hyperfleet/hyperfleet-adapter

Length of output: 548


Pin the builder and runtime base images by digest.

The builder tag resolves to sha256:0b471eb04868f3d9d90bf3c668f9c6c7a22cef07474ac9fec067909dfd7dec7c. Retain the tag and add this digest. The default BASE_IMAGE also uses mutable ubi9-micro:latest; replace it with a verified digest-pinned reference. Mutable tags create supply-chain risk (CWE-494).

πŸ€– Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@Dockerfile` at line 3, Update the Dockerfile builder FROM reference to retain
its existing tag while appending the specified sha256 digest, and replace the
mutable default BASE_IMAGE value for ubi9-micro:latest with a verified
digest-pinned image reference. Keep the existing image roles and build flow
unchanged.

Source: Path instructions


ARG GIT_SHA=unknown
ARG GIT_DIRTY=""
Expand Down