-
Notifications
You must be signed in to change notification settings - Fork 1.2k
feat(gha): ensure action sources use commit hash #7058
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
base: main
Are you sure you want to change the base?
Conversation
5938c7c
to
05eb54d
Compare
05eb54d
to
764975b
Compare
764975b
to
38e7266
Compare
38e7266
to
e404baa
Compare
e404baa
to
6ba32db
Compare
6ba32db
to
6241012
Compare
name=name, | ||
id=id, | ||
block_type=BlockType.ARRAY, | ||
supported_entities=('jobs', 'jobs.*.steps[]') |
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.
You may also want to add 'runs.steps[]'
to your supported_entities to capture the uses
that can appear under runs
. https://docs.github.com/en/actions/sharing-automations/creating-actions/metadata-syntax-for-github-actions#runsstepsuses
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.
thats a good find. however, runs.steps[] is not a currently supported resource type for github actions. seems like it should definitely be added though.
Great work getting this up! Much needed 😄 |
6241012
to
b57c0fa
Compare
b57c0fa
to
07dbb68
Compare
User description
Description
Github Actions should pin the actions in workflows to SHA to prevent supply chain attacks such as this:
https://www.wiz.io/blog/github-action-tj-actions-changed-files-supply-chain-attack-cve-2025-30066
Fixes #7057
New/Edited policies
CKV_GHA_8
Description
Ensure GitHub Action sources use a commit hash instead of a branch or tag to help prevent supply chain attacks.
Fix
replace tag with the commit SHA with an optional comment referencing the version
example:
Checklist:
Generated description
Below is a concise technical summary of the changes proposed in this PR:
Implements a new security check (CKV_GHA_8) in the checkov framework to ensure GitHub Actions use commit hashes instead of branches or tags. Adds the
RevisionHash
class to scan workflow configurations and includes corresponding test cases to validate the new check's functionality.Modified files (2)
Latest Contributors(2)
Modified files (1)
Latest Contributors(0)