ci: GHA workflow security cleanup#451
Open
emptyhammond wants to merge 5 commits into
Open
Conversation
actions/checkout leaves the workflow's GITHUB_TOKEN in the local git config after fetching by default. Set persist-credentials: false so later steps don't inherit token access they don't need.
Set a top-level permissions: {} default and grant each job only the
GITHUB_TOKEN scopes it needs:
- check.yml/check and check.yml/finish: contents: read for checkout
and coverallsapp PR identification.
- features.yml/build: contents, deployments, id-token to match the
permissions the called reusable workflow requires.
The run: block expanded ${{ matrix.type }} into the shell directly.
Reference TEST_TYPE (already bound in the step's env:) instead so
workflow-context values stay out of the shell source.
Tags can be moved to point at different commits after publication. Pinning the SHA (with the previous tag retained as a comment for readability) ensures CI runs the exact code we audited.
The called workflow only declares ABLY_AWS_ACCOUNT_ID_SDK in its workflow_call.secrets contract. Replace secrets: inherit with an explicit passthrough so other repo secrets aren't forwarded into a workflow that has no need for them.
Collaborator
|
@emptyhammond looks like this has broken something in CI |
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.
Routine hygiene pass over the GitHub Actions workflows in this repo, addressing findings from a workflow security audit. Changes are split into five commits, one per finding type:
No behavioural changes intended — the workflows run the same checks against the same inputs.