-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
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
Pin actions to a full length commit SHA #140301
Pin actions to a full length commit SHA #140301
Conversation
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.
Please undo all of the formatting changes.
Is this compatible with dependabot? We have it enabled in a fork of this repo and forward the PRs here. |
Yes it is compatible. |
Will do that. |
Is that documented somewhere? |
|
7e9fe66
to
f843543
Compare
I have undone the formatting changes. |
f843543
to
0ba17f1
Compare
Pinning an action to a full length commit SHA is currently the only way to use an action as an immutable release. Pinning to a particular SHA helps mitigate the risk of a bad actor adding a backdoor to the action's repository, as they would need to generate a SHA-1 collision for a valid Git object payload. https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions#using-third-party-actions https://github.com/ossf/scorecard/blob/main/docs/checks.md#pinned-dependencies
0ba17f1
to
1447de9
Compare
At least with short shas this is not possible on GitHub and you get a 404 instead the collisioned hash. |
How many updates will cause this? If we blindly merge all dependabot updates we gain nothing than more work for us. Also I think at least for GitHubs own actions we don't want to pin them to get important updates they might do on their side to reflect API changes etc. |
If our threat model is that we don't trust certain actions, should we than not have those action at all? |
Why don't you want to get the GitHub-owned actions? |
I agree that the github actions should probably not be pinned. I like pinning the other actions just to protect from malicious updates. I agree that that protection is mostly limited to somebody pointing out an update is malicious before we update if we don't review the diff. Reviewing the diff may still be easier than doing a full review. Although most of the actions here seem to be fairly small in scope so maybe a review isn't that hard. Also https://github.com/actions/github-script may be an option to replace the actions that just comment or do other super basic stuff. In general I don't like using many actions from different repos in my own projects but it's also hard to have nice CI and mostly trusted actions. |
I marked this as stale due to inactivity. → More info |
Closing because of feedback. |
Motivation for this change
Pinning an action to a full length commit SHA is currently the only way to use an action as
an immutable release. Pinning to a particular SHA helps mitigate the risk of a bad actor adding a
backdoor to the action's repository, as they would need to generate a SHA-1 collision for
a valid Git object payload.
https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions#using-third-party-actions
https://github.com/ossf/scorecard/blob/main/docs/checks.md#pinned-dependencies
Things done
sandbox = true
set innix.conf
? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)