Skip to content
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 in CI workflow to commit SHA #9755

Merged
merged 1 commit into from
May 17, 2024
Merged

Conversation

JamieMagee
Copy link
Contributor

Recommended as part of GitHub's own GitHub Actions security hardening guide and the OSSF Scorecards checks

Pin actions to a full length commit SHA

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. When selecting a SHA, you should verify it is from the action's repository and not a repository fork.

Recommended as part of [GitHub's own GitHub Actions security hardening guide][1] and [the OSSF Scorecards checks][2]

> **Pin actions to a full length commit SHA**
>
> 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. When selecting a SHA, you should verify it is from the action's repository and not a repository fork.

[1]: https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions#using-third-party-actions
[2]: https://github.com/ossf/scorecard/blob/main/docs/checks.md#pinned-dependencies
@JamieMagee JamieMagee requested a review from a team as a code owner May 17, 2024 04:59
@jurre jurre merged commit b08f819 into main May 17, 2024
35 checks passed
@jurre jurre deleted the jamiemagee/pin-actions-ci branch May 17, 2024 06:42
@jurre
Copy link
Member

jurre commented May 17, 2024

Thanks Jamie! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants