Skip to content

Harden GitHub actions - #1715

Merged
cpeel merged 3 commits into
DistributedProofreaders:masterfrom
bpfoley:harden-github-actions
Nov 17, 2026
Merged

cpeel merged 3 commits into
DistributedProofreaders:masterfrom
bpfoley:harden-github-actions

Conversation

@bpfoley

@bpfoley bpfoley commented Nov 15, 2026

Copy link
Copy Markdown
Collaborator

Prompted by a similar audit done to phpstan-src using the zizmor linter.

We don't need git authentiction tokens to be saved to disk on the
job runner, as we do no authenticated actions such as checking
out a branch, or pushing a commit to the repo.

This limits the severity of any potential github action attack.
None of these jobs need to perform any github operations, so remove
GITHUB_TOKEN permissions for all jobs by default for security's sake.
`./path/to/action` looks for an action in the filesystem of the job
runner, and is subject to any filesystem changes performed by any of
the preceeding jobs. This flexibility is almost never needed and
opens the potential for jobs to overwrite actions.

`$/path/to/action` on the other hand specifically references the
action as found in the git repository and doesn't require any checkout
and can't be modified by a job.

See https://github.blog/changelog/2026-07-30-reference-same-repository-actions-with-self-repository-syntax/
@cpeel
cpeel merged commit a559f42 into DistributedProofreaders:master Nov 17, 2026
12 checks passed
@bpfoley
bpfoley deleted the harden-github-actions branch November 17, 2026 20:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants