Add explicit GITHUB_TOKEN permissions to CI and audit workflows - #118
Merged
Conversation
Resolves the eight open `actions/missing-workflow-permissions` CodeQL alerts (#1, #3, #4, #5, #6, #7, #8, #9). Every job now has an effective `permissions:` block scoped to what it actually does. ci.yml Workflow-level `contents: read` covers `check`, `test` and `lints`, which only check out the repo and run cargo check/test/fmt/clippy. Four jobs override to `contents: write` because they mutate releases: - `release` runs `gh release create --generate-notes` - `upload-mac-universal-bin` and `upload-linux-bin` run `gh release upload` to attach the built tarballs - `generate-dotslash-files` uses facebook/dotslash-publish-release, which also publishes via `gh release upload` audit.yml `rustsec/audit-check` needs `checks: write` to publish the advisory status check on push/pull_request runs and `issues: write` to open an issue per new advisory on the weekly scheduled run (both documented in the action's README). `contents: read` covers actions/checkout. It does not upload SARIF, so no `security-events: write`. codeql.yml already declares permissions and is untouched.
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.
Resolves the eight open
actions/missing-workflow-permissionsCodeQLalerts (#1, #3, #4, #5, #6, #7, #8, #9). Every job now has an effective
permissions:block scoped to what it actually does.ci.yml
Workflow-level
contents: readcoverscheck,testandlints,which only check out the repo and run cargo check/test/fmt/clippy.
Four jobs override to
contents: writebecause they mutate releases:releaserunsgh release create --generate-notesupload-mac-universal-binandupload-linux-binrungh release uploadto attach the built tarballsgenerate-dotslash-filesuses facebook/dotslash-publish-release,which also publishes via
gh release uploadaudit.yml
rustsec/audit-checkneedschecks: writeto publish the advisorystatus check on push/pull_request runs and
issues: writeto open anissue per new advisory on the weekly scheduled run (both documented in
the action's README).
contents: readcovers actions/checkout. Itdoes not upload SARIF, so no
security-events: write.codeql.yml already declares permissions and is untouched.
Alerts resolved
actions/missing-workflow-permissions(medium) —.github/workflows/audit.yml:14actions/missing-workflow-permissions(medium) —.github/workflows/ci.yml:149actions/missing-workflow-permissions(medium) —.github/workflows/ci.yml:126actions/missing-workflow-permissions(medium) —.github/workflows/ci.yml:102actions/missing-workflow-permissions(medium) —.github/workflows/ci.yml:57actions/missing-workflow-permissions(medium) —.github/workflows/ci.yml:42actions/missing-workflow-permissions(medium) —.github/workflows/ci.yml:31actions/missing-workflow-permissions(medium) —.github/workflows/ci.yml:22Verification
permissions:block (cross-checked by parsing the YAML against the alert list).actionlintoutput is byte-identical tomain— no new findings introduced.codeql.ymluntouched.