Pin GitHub Actions to commit SHAs and harden Renovate config#120
Merged
Conversation
Semgrep flagged mutable action tags (supply-chain risk) and a missing Renovate minimum release age. Pin all workflow actions to full commit SHAs with version comments, add the helpers:pinGitHubActionDigests Renovate preset to keep digests maintained, and set a 7-day minimumReleaseAge across package rules to clear the scan. Co-authored-by: Claude <claude@anthropic.com>
Co-authored-by: Claude <claude@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #120 +/- ##
=======================================
Coverage 99.45% 99.45%
=======================================
Files 235 235
Lines 4033 4033
Branches 1027 1031 +4
=======================================
Hits 4011 4011
Misses 22 22
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The Semgrep Security Scan job was failing with 27 findings — all in CI configuration, none in application code:
github-actions-mutable-action-taginci.yml,publish.yml,security.yml— workflow steps referenced mutable tags (@v4,@v5,@v1). A mutable tag can be silently repointed by the action owner, which was the vector in thetj-actions/changed-filescompromise.renovate-missing-minimum-release-ageinrenovate.json— no cooldown before proposing/auto-merging newly published versions.These pre-existed on
main(not introduced by any recent PR).Fix
uses:to full 40-char commit SHAs with# vXversion comments. Pinned the current major of each action (no version bumps — those are left to Renovate so they get tested independently):actions/checkout@v4,actions/setup-node@v4,actions/upload-artifact@v4,actions/download-artifact@v4,codecov/codecov-action@v5,ncipollo/release-action@v1helpers:pinGitHubActionDigeststo Renovate'sextendsso it keeps the pinned digests updated automatically (pinning and Renovate are complementary, not in conflict).minimumReleaseAge: "7 days"globally and within each package rule. The Semgrep rule (p/owasp-top-ten) requires ≥ 7 days, so all cooldowns — including security updates — are set to 7 days.Verification
Ran the exact CI Semgrep command locally via Docker: 0 findings (down from 27), exit 0. No application code changed.