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 GitHub Action Git SHA (Digest Pinning) #7537

Closed
HonkingGoose opened this issue Oct 24, 2020 · 3 comments · Fixed by #10835
Closed

Pin GitHub Action Git SHA (Digest Pinning) #7537

HonkingGoose opened this issue Oct 24, 2020 · 3 comments · Fixed by #10835
Assignees
Labels
manager:github-actions Github actions manager platform:github GitHub Platform priority-3-medium Default priority, "should be done" but isn't prioritised ahead of others status:in-progress Someone is working on implementation type:feature Feature (new functionality)

Comments

@HonkingGoose
Copy link
Collaborator

What would you like Renovate to be able to do?

Pin a GitHub action to a specific Git SHA (digest pinning).

Did you already have any implementation ideas?

Are there any workarounds or alternative ideas you've tried to avoid needing this feature?

Is this a feature you'd be interested in implementing yourself?

References

See #7516 for related discussion.

@HonkingGoose HonkingGoose added type:feature Feature (new functionality) manager:github-actions Github actions manager platform:github GitHub Platform labels Oct 27, 2020
@rarkins rarkins added the status:requirements Full requirements are not yet known, so implementation should not be started label Jan 12, 2021
@HonkingGoose HonkingGoose added priority-3-medium Default priority, "should be done" but isn't prioritised ahead of others and removed priority-5-triage labels Mar 6, 2021
@HonkingGoose
Copy link
Collaborator Author

Maybe we should bump this to priority-2-important, as we can stop a lot of bad stuff by allowing Renovate users to pin their GitHub Actions to a specific Git SHA.

I found documentation from GitHub explaining why you need to be careful with GitHub actions, and why pinning to a specific SHA is safer than using a tag. I've copy/pasted the most relevant parts:

The individual jobs in a workflow can interact with (and compromise) other jobs. For example, a job querying the environment variables used by a later job, writing files to a shared directory that a later job processes, or even more directly by interacting with the Docker socket and inspecting other running containers and executing commands in them.

This means that a compromise of a single action within a workflow can be very significant, as that compromised action would have access to all secrets configured on your repository, and can use the GITHUB_TOKEN to write to the repository. Consequently, there is significant risk in sourcing actions from third-party repositories on GitHub. You can help mitigate this risk by following these good practices:

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.

[snip]

Pin actions to a tag only if you trust the creator
Although pinning to a commit SHA is the most secure option, specifying a tag is more convenient and is widely used. If you’d like to specify a tag, then be sure that you trust the action's creators. The ‘Verified creator’ badge on GitHub Marketplace is a useful signal, as it indicates that the action was written by a team whose identity has been verified by GitHub. Note that there is risk to this approach even if you trust the author, because a tag can be moved or deleted if a bad actor gains access to the repository storing the action.

Source for quotes: GitHub docs, security hardening for GitHub actions, using third party actions.

I'll let the Renovate maintainers decide on what priority they want to use for this issue, now they have this extra information.

@jokay
Copy link

jokay commented Apr 28, 2021

Would be great to have this one 👍

Especially if you see news like this and this 🧐

@viceice viceice self-assigned this Jul 14, 2021
@viceice viceice added status:in-progress Someone is working on implementation and removed status:requirements Full requirements are not yet known, so implementation should not be started labels Jul 14, 2021
@renovate-release
Copy link
Collaborator

🎉 This issue has been resolved in version 25.56.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
manager:github-actions Github actions manager platform:github GitHub Platform priority-3-medium Default priority, "should be done" but isn't prioritised ahead of others status:in-progress Someone is working on implementation type:feature Feature (new functionality)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants