ci: pin action SHAs, set permissions, and prevent template injection - #115
ci: pin action SHAs, set permissions, and prevent template injection#115dkhawk wants to merge 1 commit into
Conversation
Code Coverage
|
|
|
||
| permissions: | ||
| contents: read | ||
| pull-requests: write |
There was a problem hiding this comment.
Do we need this permission?
There was a problem hiding this comment.
+1 for @kikoso question.
Currently, madrapps/jacoco-report on line 57 uses token: ${{ secrets.SYNCED_GITHUB_TOKEN_REPO }}. Since top-level permissions: only scope the default GITHUB_TOKEN, pull-requests: write has no effect as written.
Recommendation (Option A — Better Security):
Keep pull-requests: write and switch madrapps/jacoco-report on line 57 to use secrets.GITHUB_TOKEN instead of secrets.SYNCED_GITHUB_TOKEN_REPO:
token: ${{ secrets.GITHUB_TOKEN }}
There was a problem hiding this comment.
Updated! Switched madrapps/jacoco-report to use secrets.GITHUB_TOKEN instead of secrets.SYNCED_GITHUB_TOKEN_REPO, which properly utilizes the pull-requests: write permission while adhering to least privilege without exposing repository secrets.
0c90f50 to
c62b1de
Compare
Description
This PR hardens the repository's GitHub Actions workflows against security vulnerabilities identified by Zizmor and CI scans:
permissions:blocks to all workflow files (contents: read,security-events: write,pull-requests: write) following the principle of least privilege.actions/checkout,actions/setup-java,gradle/actions/setup-gradle,peter-evans/create-pull-request,github/codeql-action/upload-sarif,madrapps/jacoco-report,actions/upload-artifact,googleapis/release-please-action) to full commit SHA hashes with version comments..github/workflows/test.ymlto pass step outputs viaenv:variables instead of direct shell string interpolation (${{ steps.jacoco.outputs... }}).📚 Stacked PR Chain
ci/workflow-security-hardening(Workflow permissions & action pinning)maintest/library-coverage-baseline(Test suite reaching 93.8% coverage)build/dependency-modernization(AGP 9.3.2, Gradle 9.5.1, Places 5.3.0)feat/places-usage-attribution(Usage attribution & remove:library)demo/ux-edge-to-edge-polish(Demo UX, edge-to-edge, mock location)Umbrella PR: #109