-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Pin SHA values as version numbers for 3rd party GHAs #29485
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
Size Change: 0 B Total Size: 1.39 MB ℹ️ View Unchanged
|
Looks like the failing tests are also failing currently in |
What is an immutable release? |
Immutable release means it's unable to be changed. SHAs are the only way to guarantee that what's checked out cannot be changed to something else. Tags can be moved or deleted, but the SHAs cannot be changed. |
Cool, cool. Would it make sense to enforce this somehow? Just thinking about what would happen if a future developer writes a new action but doesn't know to do this. |
We could! Not sure how easy that is to build into the automations scripts you have going. I think including a link to the security best practices in the PR description somewhere in contributing documentation could also suffice. |
How about actions like Mostly curious if we could keep using tags for those, as they're a bit nicer on the eye 😄 |
Technically yes, they are 1st party. But, because they are separate repositories and not included on the runners, it's always possible that a bad actor has access to one of the repositories. Where these actions are the most used of any on the marketplace, they're ideal targets should anyone be trying to exploit an action. Trusting the GH actions would fall under the third item listed in the related section on the page linked in the description: "Pin actions to a tag only if you trust the creator". We could declare that all official GitHub actions are "trusted". But it's probably just easier to just have a consistent policy across the board, and it's the most secure.
This gave me an idea! I have added a |
(cherry picked from commit 80b6e5b)
Description
This PR changes the version numbers specified for 3rd party GitHub Action scripts to SHA values. Pinning an action to a full length commit SHA is currently the only way to use an action as an immutable release.
All SHAs reference the same version of the action script that was being used prior to this PR, except the
styfle/cancel-workflow-action
action, which has been upgraded from0.4.0
to0.8.0
(latest version).See: https://docs.github.com/en/actions/learn-github-actions/security-hardening-for-github-actions#using-third-party-actions.
Related: https://core.trac.wordpress.org/changeset/50474.