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

Reference actions by commit SHA #224

Merged
merged 4 commits into from
Jun 3, 2023
Merged

Conversation

gabibguti
Copy link
Contributor

Referencing actions by commit SHA in GitHub workflows, guarantees you are using an immutable version. In contrast, actions referenced by tags and branches are vulnerable to attacks, such as the tag being moved to a malicious commit, a malicious commit being pushed to the branch or typosquatting.

Although there are pros and cons for each reference, GitHub acknowledges that using commit SHAs is more reliable, as does Scorecard security tool.

Currently, in this repository, we use actions such as actions/checkout@v3.5.2 and github/codeql-action/init@v2. Most actions are referenced by tags. To prevent the attacks mentioned above, it would be good to change the tag references to commit SHAs as suggested in this PR.

Additional Context

Hi! I'm Gabriela and I work on behalf of Google and the OpenSSF suggesting supply-chain security changes :)

It's important to make sure the SHA's are from the original repositories and not forks.

For reference:

https://github.com/actions/checkout/releases/tag/v3.5.2
actions/checkout@8e5e7e5


Signed-off-by: Gabriela Gutierrez <gabigutierrez@google.com>
@garydgregory
Copy link
Member

Hi @gabibguti
Thank you for the PR.
Will dependabot be able to update versions?

@garydgregory
Copy link
Member

Hi @gabibguti Thank you for the PR. Will dependabot be able to update versions?

Hm, looks like it does! For example: https://github.com/apache/commons-lang/blame/ebcb39a62fc1e47251eceaf63a4b3d731c5227a0/.github/workflows/maven.yml

@garydgregory garydgregory merged commit f1229a3 into apache:master Jun 3, 2023
13 checks passed
@gabibguti
Copy link
Contributor Author

@garydgregory
Copy link
Member

Hi @gabibguti
Do you have the tooling to create PRs like this automatically? Apache Commons has a lot of components... ;-)

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