Skip to content
Merged
Show file tree
Hide file tree
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
14 changes: 14 additions & 0 deletions .github/workflows/codespell.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Codespell

on:
pull_request:
branches: [main]

jobs:
codespell:
name: Codespell
runs-on: arc-runner-set
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- run: make verify-codespell
14 changes: 14 additions & 0 deletions .github/workflows/cpo-container-sync.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: CPO Container Sync

on:
pull_request:
branches: [main]

jobs:
cpo-container-sync:
name: CPO Container Sync
runs-on: arc-runner-set
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- run: make cpo-container-sync
19 changes: 19 additions & 0 deletions .github/workflows/gitlint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Gitlint

on:
pull_request:
branches: [main]

jobs:
gitlint:
name: Gitlint
runs-on: arc-runner-set
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- run: make run-gitlint
env:
PULL_BASE_SHA: ${{ github.event.pull_request.base.sha }}
PULL_PULL_SHA: ${{ github.event.pull_request.head.sha }}
17 changes: 17 additions & 0 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Lint

on:
pull_request:
branches: [main]

jobs:
lint:
name: Lint
runs-on: arc-runner-set
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- run: git fetch origin main:main
- run: make lint
25 changes: 25 additions & 0 deletions Dockerfile.github-actions-runner
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
FROM ghcr.io/actions/actions-runner@sha256:5b922563ee9406d55e77a57d3dde85e1d793e600ed326ef6739182a847efae0f

USER root

RUN apt-get update && \
apt-get install -y --no-install-recommends \
make \
gcc \
libc6-dev \
git \
curl \
ca-certificates \
python3-pip \
&& rm -rf /var/lib/apt/lists/*

ARG GO_VERSION=1.25.3
RUN curl -fsSL "https://go.dev/dl/go${GO_VERSION}.linux-arm64.tar.gz" | tar -C /usr/local -xz

RUN curl -fsSL "https://mirror.openshift.com/pub/openshift-v4/aarch64/clients/ocp/stable/openshift-client-linux.tar.gz" | tar -C /usr/local/bin -xz oc kubectl
Comment on lines +17 to +19
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Verify mutable channel and missing checksum validation patterns in the Dockerfile
rg -n 'openshift-v4/aarch64/clients/ocp/stable/openshift-client-linux.tar.gz|go.dev/dl/go\$\{GO_VERSION\}.linux-arm64.tar.gz' Dockerfile.github-actions-runner
rg -n 'sha256sum -c|SHA256|_SHA256' Dockerfile.github-actions-runner || true

Repository: openshift/hypershift

Length of output: 322


Pin package versions and add checksum verification for supply-chain integrity.

Line 19 downloads from a mutable stable URL, and both line 17 and line 19 stream archives directly to tar without checksum validation. This causes nondeterministic builds and creates supply-chain risk for the runner image.

Replace the mutable stable channel with a specific version, and verify all downloads with SHA256 checksums:

Proposed fix
 ARG GO_VERSION=1.25.3
-RUN curl -fsSL "https://go.dev/dl/go${GO_VERSION}.linux-arm64.tar.gz" | tar -C /usr/local -xz
+ARG GO_SHA256=<pin-go-tarball-sha256>
+RUN curl -fsSLo /tmp/go.tgz "https://go.dev/dl/go${GO_VERSION}.linux-arm64.tar.gz" && \
+    echo "${GO_SHA256}  /tmp/go.tgz" | sha256sum -c - && \
+    tar -C /usr/local -xzf /tmp/go.tgz && \
+    rm -f /tmp/go.tgz

-RUN curl -fsSL "https://mirror.openshift.com/pub/openshift-v4/aarch64/clients/ocp/stable/openshift-client-linux.tar.gz" | tar -C /usr/local/bin -xz oc kubectl
+ARG OCP_CLIENT_VERSION=<pin-ocp-version>
+ARG OCP_CLIENT_SHA256=<pin-oc-tarball-sha256>
+RUN curl -fsSLo /tmp/oc.tgz "https://mirror.openshift.com/pub/openshift-v4/aarch64/clients/ocp/${OCP_CLIENT_VERSION}/openshift-client-linux.tar.gz" && \
+    echo "${OCP_CLIENT_SHA256}  /tmp/oc.tgz" | sha256sum -c - && \
+    tar -C /usr/local/bin -xzf /tmp/oc.tgz oc kubectl && \
+    rm -f /tmp/oc.tgz
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@Dockerfile.github-actions-runner` around lines 17 - 19, Replace the mutable
downloads with pinned versions and verify SHA256 checksums before extracting:
stop streaming archives directly into tar for both the Go download (using the
GO_VERSION variable referenced in the RUN that fetches
go${GO_VERSION}.linux-arm64.tar.gz) and the OpenShift client download (replace
the "stable" path and the tarball URL used in the RUN that extracts oc and
kubectl with a specific OC_VERSION), download the corresponding .sha256 (or
.sha256sum) files, validate them with sha256sum -c (or compute and compare the
checksum), and only then extract the verified archive to /usr/local or
/usr/local/bin; ensure failure on checksum mismatch so the build aborts.


ENV PATH="/usr/local/go/bin:${PATH}"
ENV GOPATH="/home/runner/go"
ENV PATH="${GOPATH}/bin:${PATH}"

USER runner
8 changes: 8 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,14 @@ verify: generate update staticcheck fmt vet verify-codespell lint cpo-container-
$(eval STATUS = $(shell git status -s))
$(if $(strip $(STATUS)),$(error untracked files detected: ${STATUS}))

.PHONY: verify-ci
verify-ci: generate update staticcheck fmt vet
git diff-index --cached --quiet --ignore-submodules HEAD --
git diff-files --quiet --ignore-submodules
git diff --exit-code HEAD --
$(eval STATUS = $(shell git status -s))
$(if $(strip $(STATUS)),$(error untracked files detected: ${STATUS}))

$(CONTROLLER_GEN): $(TOOLS_DIR)/go.mod # Build controller-gen from tools folder.
cd $(TOOLS_DIR); $(GO) build -tags=tools -o $(BIN_DIR)/controller-gen sigs.k8s.io/controller-tools/cmd/controller-gen

Expand Down
Loading
Loading