-
Notifications
You must be signed in to change notification settings - Fork 1k
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
For actions that are pinned-by-hash, bump the human readable version number in the code comment #4691
Comments
I think this is a great idea and we'd happily merge a PR if anyone wants to take a crack at it. Looking at the relevant code, I don't think it'd be that hard to implement. A few design notes:
|
I want to pin the dependencies in our repos, but I'm kinda waiting for this feature to be implemented. It will make it much easier to maintain. I was looking into StepSecurity to do the first pass in all the workflows and found step-security/secure-repo#1087. They removed the tag comment because dependabot doesn't support updating it. I also wanted to point out that the OpenSSF action uses yet another format for the comment when you create their workflow
not sure how popular this is...I think |
Until dependabot/dependabot-core#4691 is fixed this is too much work to maintain those comments. Note that git history can be used to know the version.
I just deployed this feature, many thanks to @jproberts for contributing the PR. Many variations of version tags are supported, for examples see the unit tests: dependabot-core/github_actions/spec/fixtures/workflow_files/pinned_sources_version_comments.yml Lines 7 to 30 in b4112ce
If you hit bugs please let us know. |
I'm intentionally pinning a slightly older version of actions/checkout to see if the update works like it should. See: dependabot/dependabot-core#4691
Dependabot is also capable of pinning to future tag releases and will maintain the comment that descibes the shasum. dependabot/dependabot-core#4691 Signed-off-by: Marco Franssen <[email protected]>
Dependabot is also capable of pinning to future tag releases and will maintain the comment that descibes the shasum. dependabot/dependabot-core#4691 Signed-off-by: Marco Franssen <[email protected]>
Dependabot is also capable of pinning to future tag releases and will maintain the comment that descibes the shasum. dependabot/dependabot-core#4691 Signed-off-by: Marco Franssen <[email protected]>
Dependabot is also capable of pinning to future tag releases and will maintain the comment that descibes the shasum. dependabot/dependabot-core#4691 Signed-off-by: Marco Franssen <[email protected]>
Dependabot is also capable of pinning to future tag releases and will maintain the comment that descibes the shasum. dependabot/dependabot-core#4691 Signed-off-by: Marco Franssen <[email protected]>
Instead of referencing versions, the guidance is to pin actions to a full length SHA corresponding to the release tag [1] [2]. Dependabot will continue to automatically monitor and open PRs for versions [3]. | Action | Old | New | | checkout | v4 | v4.1.1 release commit | | github-action-markdown-link-check | v1 | v1.0.15 release commit | | setup-python | v5 | v5.0.0 release commit | | upload-artifact | v4 | v4.3.0 release commit | [1] https://securityscorecards.dev/viewer/?uri=github.com/intel/perfmon [2] https://github.com/ossf/scorecard/blob/497b851040f18b6cacfbc67500b6fad98ac5e367/docs/checks.md#pinned-dependencies [3] dependabot/dependabot-core#4691
Hello!
As good security practice and guided by the code scanning alert for 'Pinned-Dependencies' from the ossf/scorecard project, users are encouraged to pin GitHub workflow actions by hash. The example provided by the scorecard repoincludes a comment following the action+pinned-hash, example below:
Subsequent updates by dependabot do not bump the version in the comment, leading to confusion and incorrect information. An example of this can be found here: ChrisCarini/environment-variable-settings-summary-intellij-plugin#36
Below is a before & after example of the above linked PR
Before
After
Summary
Dependabot updated
ossf/scorecard-action
from versionv1.0.1
tov1.0.2
.In the "Before", the hash was updated correctly, however the trailing comment with the tag version, was not.
I believe this change would help GitHub workflow owners to have a better security posture w.r.t. using hash-pinned GitHugb action dependencies, while also having improved ergonomics to be able to quickly verify they are on the correct version.
This idea shares similar sentiment of #3699
(I would consider trying to make a code change for this, however I lack expertise in Ruby and have thus far struggled to get the project opened for development.)
The text was updated successfully, but these errors were encountered: