Skip to content

Pin GitHub Actions to commit hashes to prevent supply chain attacks#2

Closed
basi wants to merge 3 commits intomainfrom
work/security-update
Closed

Pin GitHub Actions to commit hashes to prevent supply chain attacks#2
basi wants to merge 3 commits intomainfrom
work/security-update

Conversation

@basi
Copy link
Copy Markdown
Owner

@basi basi commented Jul 23, 2025

Background

This PR changes GitHub Actions in our workflows from version tags to specific commit hashes to prevent potential supply chain attacks.

Reference: https://www.wiz.io/ja-jp/blog/new-github-action-supply-chain-attack-reviewdog-action-setup

Changes

Updated Actions:

  • actions/checkout@v4actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 (v4.2.2)
  • actions/setup-node@v4actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 (v4.4.0)
  • actions/cache@v4actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 (v4.2.3)
  • actions/upload-artifact@v4actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 (v4.6.2)
  • actions/github-script@v7actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea (v7.0.1)
  • vapor/swiftly-action@v0.2.0vapor/swiftly-action@afdde2275f2b916c2704383f3a6b72032adb488c (v0.2.0)

Files Modified:

  • .github/workflows/release.yml
  • .github/workflows/ci.yml

Security Benefits

  • Supply Chain Attack Prevention: Using commit hashes instead of tags prevents potential attacks where malicious actors could compromise tags
  • Immutable References: Commit hashes are immutable, ensuring the exact same code is always executed
  • Transparency: Clear visibility of exactly which version of each action is being used

Maintenance

  • Dependabot will continue to detect updates for these actions
  • Updates can be applied by changing the commit hash to the latest stable version
  • No operational impact expected as these are the same stable versions, just referenced by hash instead of tag

Testing

All existing CI/CD functionality remains unchanged. The workflows will continue to work exactly as before, but with enhanced security.

basi added 3 commits July 23, 2025 19:05
- Pin actions/checkout to 11bd71901bbe5b1630ceea73d27597364c9af683 (v4.2.2)
- Pin actions/setup-node to 49933ea5288caeca8642d1e84afbd3f7d6820020 (v4.4.0)
- Pin actions/upload-artifact to 50769540e7f4bd5e21e526ee35c689e35e0d6874 (v4.4.0)
- Pin actions/github-script to 60a0d83039c74a4aee543508d2ffcb1c3799cdea (v7.0.1)

This prevents potential supply chain attacks by ensuring specific versions are used.
- Pin actions/checkout to 11bd71901bbe5b1630ceea73d27597364c9af683 (v4.2.2)
- Pin actions/cache to 6849a6489940f00c2f30c0fb92c6274307ccb58a (v4.1.2)
- Pin actions/upload-artifact to 50769540e7f4bd5e21e526ee35c689e35e0d6874 (v4.4.0)
- Pin vapor/swiftly-action to afdde2275f2b916c2704383f3a6b72032adb488c (v0.2.0)

This completes the security hardening of all GitHub Actions workflows.
- Update actions/cache to 5a3ec84eff668545956fd18022155c47e93e2684 (v4.2.3)
- Update actions/upload-artifact to ea165f8d65b6e75b540449e92b4886f43607fa02 (v4.6.2)

This ensures we're using the most recent stable versions with security fixes.
@basi basi closed this Jul 24, 2025
@basi basi deleted the work/security-update branch July 24, 2025 03:10
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.

1 participant