Repository navigation
Update workflow actions to latest releases - #126
Conversation
025b162 to
c2adbd8
Compare
Signed-off-by: lucarlig <luca.carlig@ibm.com>
c2adbd8 to
5403be5
Compare
msureshkumar88
left a comment
There was a problem hiding this comment.
Security: action refs regress from SHA-pinning to mutable tags
All 6 workflow files replace pinned commit SHAs with floating version tags:
actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd→actions/checkout@v7.0.0actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405→actions/setup-python@v6.2.0actions/upload-artifact@b7c566a...→actions/upload-artifact@v7.0.1actions/download-artifact@37930b1...→actions/download-artifact@v8.0.1pypa/gh-action-pypi-publish@ed0c539...→pypa/gh-action-pypi-publish@v1.14.0codecov/codecov-action@75cd116...→codecov/codecov-action@v7.0.0
Why this is a regression, not just a version bump: the previous refs were pinned to immutable commit SHAs. A tag like v7.0.0 is mutable — the upstream maintainer (or an attacker who compromises their account/token) can repoint it to a different commit after this PR merges, and every subsequent CI run silently pulls that new code with no diff/review on this side. This is exactly the supply-chain attack vector that SHA-pinning closes, and it's what OpenSSF Scorecard's "Pinned-Dependencies" check and GitHub's own Actions hardening guide call out as a requirement, not a nice-to-have. tests/test_plugin_catalog.py was also updated to assert the new tag strings directly, so the test suite now encodes the unpinned refs as the expected state rather than catching the regression.
Requested fix: keep the version bump, but pin back to the commit SHA each tag resolves to, with the human-readable tag as a trailing comment (the standard Dependabot/Renovate convention), e.g.:
- uses: actions/checkout@<sha-for-v7.0.0> # v7.0.0
- uses: actions/setup-python@<sha-for-v6.2.0> # v6.2.0Same treatment for the other 4 actions and codecov/codecov-action.
Minor (non-blocking)
pypa/gh-action-pypi-publish@v1.14.0still transitively pullsactions/setup-python@v5.6.0(Node 20 warning persists) — PR body already flags this; worth a tracking issue upstream.- Once SHA-pinning is restored, consider adding a regression test (e.g. regex requiring
@[0-9a-f]{40}on all third-partyuses:lines) so this can't silently drift again.
Local validation (checked out at PR head 5403be5)
test_plugin_catalog.py: 109 tests, 1 failure — unrelated to this diff (pii_filterdirectory-location check, pre-existing repo state)test_install_built_wheel.py: 14/14 pass- YAML parse clean on all
.github/workflows/*.y*ml git diff --check: no whitespace issues
Signed-off-by: lucarlig <luca.carlig@ibm.com>
|
Thanks Suresh. Addressed in af33c62.
Validation:
The PyPA transitive |
msureshkumar88
left a comment
There was a problem hiding this comment.
Requested fix confirmed: all 6 third-party action refs back to @<sha> # <tag> pinning. Verified each SHA against GitHub API — all 6 resolve to the claimed tag exactly (checkout→v7.0.0, setup-python→v6.2.0, codecov-action→v7.0.0, upload-artifact→v7.0.1, download-artifact→v8.0.1, gh-action-pypi-publish→v1.14.0). New regression test test_workflow_actions_are_pinned_to_commit_shas added, enforcing @[0-9a-f]{40} # <tag> format on all workflow uses: lines going forward — addresses my non-blocking suggestion from the prior review.
Local validation at PR head af33c62:
python3 -m unittest tests/test_plugin_catalog.py: 110 tests, 1 pre-existing failure (pii_filtertest, unrelated to this diff, present before this PR too)python3 -m unittest tests/test_install_built_wheel.py: 14/14 pass- YAML parse clean on all
.github/workflows/*.y*ml - No new issues introduced by the fix commit
Approving.
Summary
Updated actions
Why
Validation
Notes