security: pin GitHub Actions to immutable SHA hashes#9046
security: pin GitHub Actions to immutable SHA hashes#9046Ankitsinghsisodya wants to merge 2 commits intoknative:mainfrom
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: Ankitsinghsisodya The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Hi @Ankitsinghsisodya. Thanks for your PR. I'm waiting for a knative member to verify that this patch is reasonable to test. If it is, they should reply with Tip We noticed you've done this a few times! Consider joining the org to skip this step and gain Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Pins third-party GitHub Actions to immutable commit SHAs to reduce supply-chain risk from mutable tags.
Changes:
- Pin
actions/checkoutto a specific commit SHA inknative-downstream.yaml. - Pin
ko-build/setup-ko,actions/checkout, andrtCamp/action-slack-notifyto specific commit SHAs inkind-e2e.yaml.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| .github/workflows/knative-downstream.yaml | Replaces actions/checkout tag references with a pinned commit SHA. |
| .github/workflows/kind-e2e.yaml | Replaces action tags for ko setup, checkout, and Slack notify with pinned commit SHAs. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #9046 +/- ##
=======================================
Coverage 51.05% 51.05%
=======================================
Files 409 409
Lines 21997 21997
=======================================
+ Hits 11230 11231 +1
+ Misses 9905 9902 -3
- Partials 862 864 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
32e4611 to
d1446dc
Compare
Mutable tags (v0.9, v2.1.0, v4, v6) can be silently moved to a different commit, making CI vulnerable to supply-chain attacks. Pinning third-party actions to their exact commit SHA ensures the code that ran in review is the code that runs in production. Pinned: - ko-build/setup-ko v0.9 -> d006021b - actions/checkout v4 -> 34e11487 (kind-e2e.yaml) - actions/checkout v6 -> de0fac2e (knative-downstream.yaml) - rtCamp/action-slack-notify v2.1.0 -> e17352fe knative/actions@main is intentionally left unpinned — Knative's own reusable actions follow a rolling @main convention by design. chainguard-dev/actions/setup-kind was already pinned to a SHA.
- Note in workflow headers that .github/.dependabot.yaml bumps pinned third-party actions on a weekly schedule (addresses supply-chain review feedback about SHA pins not auto-updating). - Expand inline comments to full action@tag plus upstream release URL for checkout, setup-ko, and slack-notify pins.
d1446dc to
279b9f7
Compare
Summary
Mutable tags (
v0.9,v2.1.0,v4,v6) can be silently moved to a different commit, making CI vulnerable to supply-chain attacks. Pinning third-party actions to their exact commit SHA ensures the code that ran during review is the code that runs in production.Pinned in
kind-e2e.yaml:ko-build/setup-kov0.9d006021bactions/checkoutv434e11487rtCamp/action-slack-notifyv2.1.0e17352fePinned in
knative-downstream.yaml:actions/checkoutv6de0fac2eLeft unpinned intentionally:
knative/actions/*@main— Knative's own reusable actions follow a rolling@mainconvention by designchainguard-dev/actions/setup-kind— already pinned to a SHA in both filesTest plan
Automated updates for pinned actions
This repo already configures Dependabot for GitHub Actions in
.github/.dependabot.yaml(package-ecosystem: github-actions, weekly interval). Dependabot opens PRs when new releases move the tag that corresponds to a pinned action, so SHA pins do not go stale without review.