Skip to content

missing-permissions

GitHub Actionssuspiciousno fixdefault: off

Reports a job with no permissions, in a workflow with no top-level permissions.

Without permissions, the GITHUB_TOKEN gets the default of the repository or organization, which for older repositories is read and write on most scopes. A compromised step or action then has more access than the job needs.

To fix, set permissions with only the scopes the job uses, for example contents: read.

Reported
jobs:
a:
runs-on: ubuntu-latest
b:
permissions: read-all
...
github-actions:
lint:
rules:
missing-permissions: warn # off (default), warn, error

Suppress one line with sudsy-disable-next-line missing-permissions in a comment of the file’s language.