ci: pin third-party actions to commit SHAs - #160
Merged
Merged
Conversation
nttld/setup-ndk and softprops/action-gh-release ran from mutable major tags inside the APK job, which holds a contents:write token. Whoever controls those tags upstream could have pointed them at unreviewed code with permission to rewrite this repo's release assets. Both now resolve to a fixed commit, with the human-readable version in a trailing comment. GitHub-owned actions stay on major tags: pinning them would cost an SHA bump on every upstream release for a materially smaller risk. The signing keystore was never reachable this way. It lives only in release-apk.yml, which runs no third-party action and triggers only on events that already require write access.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
nttld/setup-ndk@v1andsoftprops/action-gh-release@v2ran from mutable major tags inside theandroid-apkjob, which holds acontents: writetoken. Whoever controls those tags upstream couldhave pointed them at unreviewed code with permission to rewrite this repository's release assets.
Both are now pinned to a commit SHA, with the human-readable version in a trailing comment:
nttld/setup-ndked92fe6softprops/action-gh-release3bb1273Each SHA was resolved through the API and checked against the tag it belongs to, rather than copied
by hand.
action-gh-releaseis pinned at the v2 line it was already on; moving to v3 is a separatedecision, not something to slip into a hardening change.
GitHub-owned actions (
checkout,setup-java,upload-artifact) stay on major tags. Pinning themtoo would be needed to turn on the repository's SHA-pinning enforcement, at the cost of an SHA bump
on every upstream release, for a materially smaller risk.
The release signing keystore was never reachable through this path. It lives only in
release-apk.yml, which runs no third-party action and triggers only onrelease: publishedandworkflow_dispatch, both of which already require write access.CI exercises the
setup-ndkpin on this PR. Theaction-gh-releasepin only runs on a tag push, soit stays unproven until the next release: that is why the SHA was resolved rather than typed.
Alongside this change, and not visible in the diff, the repository now has secret scanning with push
protection enabled, a ruleset blocking deletion and force-push on release tags
v*, and the same onmain.