-
Notifications
You must be signed in to change notification settings - Fork 8.3k
ci: pin GitHub Actions to SHAs #87184
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
Conversation
aescolar
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+0
No complaints from me.
I only checked that the shas in the actions used from the bsim workflows seem to point to verified commits in the actions repos themselves and not forks. But not their code content.
pdgendt
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1, but we'll probably want to have dependabot working so we don't need to manually keep track of this.
@stephanosio / @nashif can it be verified that dependabot update PRs could be created?
I've submitted an issue dependabot/dependabot-core#11657 but I'm also not entirely sure if there's simply a setting disabled in the repository.
Looking at zephyr-testing, the updates do seem to work: zephyrproject-rtos/zephyr-testing#311
|
You would think we should be trusting actions from gh, i.e. those hosted at |
I checked everything related to that and it seems we have everything in place, not sure what is missing. |
9b7557f to
2aef93b
Compare
|
updated to only pins non |
This commit updates all GitHub Actions workflows to use specific SHAs for the actions when they're not GitHub owned (`actions/*`) instead of using tag-based versioning since tags are mutable. Signed-off-by: Benjamin Cabé <[email protected]>
2aef93b to
25fa8b5
Compare
FWIW it might still be best practice to pin everything - at least as per scorecard checks (https://scorecard.dev/viewer/?uri=github.com/zephyrproject-rtos/zephyr --- they do give a "not-so bad" score for Github-owned vs non-Github actions, but only way to get a 10/10 is to pin everything) -- I would be happy to revert to the original approach of pinning everything depending on people's feedback/thoughts on this. |
I have no problem with that, I was just wondering.... the scorcard needs lots of work in many areas, right now it is very bad in general (5.3) |
|
Dependabot is able to run: see #87204, so I would be in favor of pinning all action versions. |
Yeah I would agree -- basically we should be fine pinning ourselves to whatever SHA at a given point in time for all actions since we typically don't care about getting latest updates for minor bug fixes except when they're security fixes which Dependabot will let us know about. Waiting a bit more to hear from others and will switch back to original "pin everything" approach if nobody feels strongly against it. |
|
Why did this PR become a hotfix? |
Pinning to specific version and hashes helps with preventing supply chain attacks. Do not use custom tokens, rely on GH provided and managed tokens. Update GitHub Actions workflows to follow principle of least privilege Based on zephyr changes: zephyrproject-rtos/zephyr#87184 zephyrproject-rtos/zephyr#87609 zephyrproject-rtos/zephyr#87510 zephyrproject-rtos/zephyr#87254 Signed-off-by: Jakub Ciesla <[email protected]>
This commit updates all GitHub Actions workflows to use specific SHAs for the actions instead of using tag-based versioning since tags are mutable.
Alternatively, we could keep
actions/andzephyrproject-rtos/actions unpinned as they are rather unlikely to be compromised.Will probably want to backport, too.