security: pin GitHub Actions to SHA digests via Renovate - #138
Conversation
Configures Renovate to use SHA256 digests when updating GitHub Actions for improved supply chain security. This ensures that action versions are pinned to specific commits, preventing potential security issues from compromised tags or branches. Benefits: - Protects against tag/branch hijacking attacks - Provides immutable references to action versions - Aligns with security best practices (SLSA, OpenSSF) - Maintains automatic updates while improving security posture Signed-off-by: Steven Borrelli <steve@borrelli.org>
humoflife
left a comment
There was a problem hiding this comment.
In renovate.json — should we add "helpers:pinGitHubActionDigests" to extends? That's the upstream-maintained preset (crossplane/crossplane extends it too) and it replaces the hand-rolled pinDigests rule with a narrower matchDepTypes: ['action'] match.
In .github/workflows/ci.yml (lines 115 and 147) — should we pin https://raw.githubusercontent.com/crossplane/crossplane/master/install.sh to a release tag instead of master? Right now we pipe an unpinned script from a moving branch into sh in the job that holds XPKG_TOKEN, which keeps the Supply-chain Levels for Software Artifacts (SLSA) L3 / Scorecard "Pinned-Dependencies" goals from being met.
L3 looks at if the build platform is hardened: builds run in isolated, ephemeral environments, and the signing key is inaccessible to user-defined build steps, so provenance is unforgeable. In GitHub Actions terms that usually means generating provenance via a trusted reusable workflow (e.g. slsa-framework/slsa-github-generator) rather than inside our own job.
|
@humoflife let's create a separate issue to address the other comments:
|
Description
Configures Renovate to automatically pin GitHub Actions to SHA256 digests for improved supply chain security.
Security Benefits
Tag/Branch Hijacking Protection
Supply Chain Security Best Practices
Aligns with industry security standards:
Example Transformation
Before (vulnerable to tag hijacking):
After (pinned to specific commit):
How It Works
# v4.1.1)Changes
Added to
renovate.json:{ "matchManagers": ["github-actions"], "pinDigests": true, "groupName": "GitHub Actions" }Testing
After merge, Renovate will automatically:
.github/workflows/References
I have: