Skip to content

Pin GitHub Actions to immutable SHA hashes #48

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

wroersma
Copy link

Summary

This PR updates GitHub Actions to their latest versions and pins them to specific SHA hashes rather than version tags to mitigate supply chain attack risks.

Security Rationale

Using version tags like @v3 creates a security vulnerability as the content behind those tags can be modified at any time by action maintainers or by attackers who compromise their accounts. Recent supply chain attacks like the xz vulnerability (CVE-2024-3094) demonstrate how dependencies can be compromised through trusted distribution mechanisms.

By pinning to immutable SHA hashes, we ensure that the exact code run by our workflows is never silently changed.

Changes

This PR updates the following GitHub Actions:

Action From To
actions/github-script v3 v7.0.1 (60a0d83039c74a4aee543508d2ffcb1c3799cdea)
docker/setup-qemu-action e81a89b1732b9c48d79cd809d8d81d79c4647a18 v3.4.0 (4574d27a4764455b42196d70a065bc6853246a25)
actions/cache 1bd1e32a3bdc45362d1e726936510720a7c30a57 v4.2.1 (0c907a75c2c80ebcb7f088228285e798b750cf8f)
nick-fields/retry 943e742917ac94714d2f408a0e8320f2d1fcafcd v3.0.2 (ce71cc2ab81d554ebbe88c79ab5975992d79ba08)
google-github-actions/auth ef5d53e30bbcd8d0836f4288f5e50ff3e086997d v2.1.8 (71f986410dfbc7added4569d411d040a91dc6935)
google-github-actions/setup-gcloud e30db14379863a8c79331b04a9969f4c1e225e0b v2.1.4 (77e7a554d41e2ee56fc945c52dfd3f33d12def9a)

Notable Security Improvements

  • Fixed actions/github-script@v3 which is used in Docker image validation - a critical security control
  • All actions are now pinned to specific SHA hashes with version tags commented for reference
  • Updates include security patches and performance improvements from newer versions

Testing

All workflows have been manually validated to ensure they continue to function with the updated action versions.

@wroersma
Copy link
Author

Latest actual vulnerability using supply chain attacks this very commit would help protect against https://www.wiz.io/blog/github-action-tj-actions-changed-files-supply-chain-attack-cve-2025-30066

@@ -79,7 +79,7 @@ runs:
ccache --version || echo "No local ccache installation found"

- name: Setup fixed path ccache caching
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
uses: actions/cache@627f0f41f6904a5b1efbaed9f96d9eb58e92e920 # v3.2.4
Copy link
Contributor

Choose a reason for hiding this comment

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

Why use 3.2.4 here rather than 4.2.1 as it is below and in the PR description?

Copy link
Author

Choose a reason for hiding this comment

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

It seems I have a bug in my tool that automates this. Very sorry let me resolve that.

Copy link
Author

Choose a reason for hiding this comment

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

So this is fixed but reviewing it more I think it’s missing a few files.

@wroersma wroersma force-pushed the security/pin-github-actions-sha branch from 4f42479 to b67b56d Compare March 18, 2025 23:11
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