Description
Feature or enhancement
Proposal:
When developing with CI workflows, it's common to version-pin dependencies (i.e. actions/checkout@v3
). Such major-version pins can be useful in that you get immediate access to the latest version of each Action. However, this also makes the project vulnerable should a broken or malicious release be published. However, version tags are mutable, so minor version tags aren't the best solution, since a malicious attacker could overwrite a version tag to point to a malicious or vulnerable commit instead.
Hash-pinning workflow dependencies ensures the dependency is immutable and its behavior is guaranteed.
These hashes (and comments indicating the respective version) can be kept up-to-date by dependabot, which cpython already uses. However, the current configuration (ignoring patch and minor version bumps, set in #92186) would need to be modified. My understanding of the motivation for #92186 was the flood of PRs generated by dependabot. However, this concern can be mostly eliminated by relying on dependabot's new grouped updates; dependabot can now be configured to send a single PR per month updating all Actions at once (see this example).
I'll send a PR pinning the Actions and changing dependabot's configuration along with this issue.
Hey, I'm Pedro. I work with Google and the OpenSSF to help critical projects improve their supply-chain security.
Has this already been discussed elsewhere?
This is a minor feature, which does not need previous discussion elsewhere
Links to previous discussion of this feature:
I previously suggested this change to pypa/setuptools, where I had an excellent exchange with @jaraco. I recommend taking a look at our conversation there.
The conclusion there was that the change wasn't feasible for that project. My understanding is that the main "hurdle" was the project's use of jaraco/skeleton as its template. Unfortunately, keeping the hashes updated in the skeleton and its "child" repositories would lead to frequent conflicts when merging skeleton updates into the repositories. The maintainers therefore reasonably concluded (and I couldn't really disagree) that the benefits of hash-pinning weren't worth the significant overhead they would cause in that situation.
However, I believe the situation for CPython is much more straightforward. The "overhead" here would be merging at most one dependabot PR per month.