Skip to content

Supply chain component version fixes#1262

Open
bk201 wants to merge 5 commits intoharvester:masterfrom
bk201:wip-sec-1502
Open

Supply chain component version fixes#1262
bk201 wants to merge 5 commits intoharvester:masterfrom
bk201:wip-sec-1502

Conversation

@bk201
Copy link
Copy Markdown
Contributor

@bk201 bk201 commented Mar 31, 2026

Pin various components to fixed versions.

Signed-off-by: Kiefer Chang <kiefer.chang@suse.com>
@bk201 bk201 marked this pull request as ready for review March 31, 2026 12:42
@bk201 bk201 requested review from Vicente-Cheng and Copilot March 31, 2026 12:42
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Pins several build and CI dependencies to fixed versions and adds checksum verification to improve supply-chain integrity.

Changes:

  • Pin downloaded CLI tools (wharfie, yq, helm, terraform, dapper) to explicit versions and add checksum verification.
  • Replace golangci-lint install script usage with a versioned go install.
  • Pin rancher-eio/read-vault-secrets GitHub Action to a specific commit SHA across workflows.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
package/harvester-os/Dockerfile Pins wharfie version and adds SHA256 verification for downloaded binary
Makefile Pins dapper download to v0.6.0 and adds SHA512 verification
Dockerfile.dapper Pins yq, golangci-lint, and helm with checksum verification for downloaded artifacts
.github/workflows/vagrant-install.yaml Pins Terraform version and verifies downloaded zip checksum
.github/workflows/fossa.yml Pins read-vault-secrets action to a specific commit
.github/workflows/build.yml Pins read-vault-secrets action to a specific commit

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +14 to +16
RUN curl -sfL https://github.com/rancher/wharfie/releases/download/${WHARFIE_VERSION}/wharfie-${ARCH} -o /usr/bin/wharfie \
&& echo "${!WHARFIE_SUM}" /usr/bin/wharfie | sha256sum -c - \
&& chmod +x /usr/bin/wharfie
Copy link

Copilot AI Mar 31, 2026

Choose a reason for hiding this comment

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

${!WHARFIE_SUM} relies on Bash-specific indirect parameter expansion, but this Dockerfile doesn't set SHELL to bash. On base images where /bin/sh isn't bash, the build will fail at checksum verification. Consider switching to a POSIX-compatible selection (e.g., case "$ARCH" ...) or explicitly setting SHELL ["/bin/bash", "-c"] before this RUN.

Suggested change
RUN curl -sfL https://github.com/rancher/wharfie/releases/download/${WHARFIE_VERSION}/wharfie-${ARCH} -o /usr/bin/wharfie \
&& echo "${!WHARFIE_SUM}" /usr/bin/wharfie | sha256sum -c - \
&& chmod +x /usr/bin/wharfie
RUN set -e; \
case "$ARCH" in \
amd64) sum="$WHARFIE_SUM_amd64" ;; \
arm64) sum="$WHARFIE_SUM_arm64" ;; \
*) echo "Unsupported architecture: $ARCH" >&2; exit 1 ;; \
esac; \
curl -sfL "https://github.com/rancher/wharfie/releases/download/${WHARFIE_VERSION}/wharfie-${ARCH}" -o /usr/bin/wharfie; \
echo "$sum /usr/bin/wharfie" | sha256sum -c -; \
chmod +x /usr/bin/wharfie

Copilot uses AI. Check for mistakes.
Comment on lines +28 to +30
ENV YQ_SUM="YQ_SUM_${ARCH}"
RUN curl -sfL https://github.com/mikefarah/yq/releases/download/${YQ_VERSION}/yq_linux_${ARCH} -o /usr/bin/yq && echo "${!YQ_SUM}" /usr/bin/yq | sha256sum -c - && chmod +x /usr/bin/yq

Copy link

Copilot AI Mar 31, 2026

Choose a reason for hiding this comment

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

${!YQ_SUM} uses Bash-only indirect expansion, but the Dockerfile doesn't set SHELL to bash. If /bin/sh isn't bash, checksum verification will fail. Prefer a POSIX-compatible approach (e.g., case "$ARCH" to choose the expected sum) or set SHELL to bash explicitly.

Copilot uses AI. Check for mistakes.
ARG HELM_SUM_amd64=dbb4c8fc8e19d159d1a63dda8db655f9ffa4aac1b9a6b188b34a40957119b286
ARG HELM_SUM_arm64=bfb14953295d5324d47ab55f3dfba6da28d46c848978c8fbf412d4271bdc29f1
ARG HELM_SUM="HELM_SUM_${ARCH}"
RUN echo ${HELM_URL}
Copy link

Copilot AI Mar 31, 2026

Choose a reason for hiding this comment

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

RUN echo ${HELM_URL} references HELM_URL, but that variable is no longer defined in this Dockerfile. This looks like leftover debug output and also adds an extra image layer; remove it or reintroduce the missing variable definition if it's still needed.

Suggested change
RUN echo ${HELM_URL}

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

Comment on lines +45 to +51
ARG HELM_SUM="HELM_SUM_${ARCH}"
RUN echo ${HELM_URL}
RUN mkdir /usr/tmp && cd /usr/tmp && \
curl -O https://get.helm.sh/helm-${HELM_VERSION}-linux-${ARCH}.tar.gz && \
echo "${!HELM_SUM}" helm-${HELM_VERSION}-linux-${ARCH}.tar.gz | sha256sum -c - && \
tar xvzf helm-${HELM_VERSION}-linux-${ARCH}.tar.gz --strip-components=1 && \
mv helm /usr/bin/helm
Copy link

Copilot AI Mar 31, 2026

Choose a reason for hiding this comment

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

${!HELM_SUM} relies on Bash-specific indirect parameter expansion. Since this Dockerfile doesn't set SHELL to bash, builds can break on images where /bin/sh isn't bash. Use a POSIX-compatible checksum selection (e.g., case "$ARCH") or set SHELL to bash before this step.

Copilot uses AI. Check for mistakes.
bk201 added 4 commits March 31, 2026 21:00
Signed-off-by: Kiefer Chang <kiefer.chang@suse.com>
Signed-off-by: Kiefer Chang <kiefer.chang@suse.com>
Signed-off-by: Kiefer Chang <kiefer.chang@suse.com>
Signed-off-by: Kiefer Chang <kiefer.chang@suse.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants