ci/least-privilege
Workflows declare minimal permissions
| Severity | warning |
| Tiers | 1, 2 |
| Stacks | any |
| Scope | root |
| Kind | expr |
| Source | library v0.0.0-20261011205826-ecb4e9b3ffd4 |
| Selected by | fleetlint-recommended@0.1.0 |
Requirement
Every workflow sets top-level permissions (normally contents: read) and escalates per job only.
Why
The default token has write access to the repo; a compromised action in a read-only workflow can do far less.
Applies when
exists(".github/workflows/*.y*ml")Check
For each item in:
glob(".github/workflows/*.y*ml")yaml(item) != null && has(yaml(item).permissions)Fix
Add permissions: { contents: read } at the top of each workflow and widen per job.
Agent instruction: Add top-level permissions: { contents: read } to every workflow lacking it; move any wider permission to the job that needs it.
See: https://fleetlint.org/baseline/#security
Generated by fleetlint docs from catalog v0.0.0-20261011205826-ecb4e9b3ffd4.