Repository navigation
feat(gha-audit): report permissions: write-all as write to every scope - #1124
Merged
sandstream merged 3 commits intoNov 27, 2026
Merged
Conversation
A workflow-level write-all was reported only as its id-token: write part. gha-audit now flags write-all at workflow level and on each job that sets it, names the scopes it grants, and suggests a read-only GITHUB_TOKEN as the default to aim for. A workflow with no permissions block is still not reported: kit has no row for it, and its token follows a repository default the file does not show. Found by kit-research#239. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Docker image built, scanned, and smoke-tested in CI. The PR image is local to this run and is not published. |
…-sync-p6fg9a-gha-write-all # Conflicts: # docs/COMMANDS.md
|
Docker image built, scanned, and smoke-tested in CI. The PR image is local to this run and is not published. |
|
Docker image built, scanned, and smoke-tested in CI. The PR image is local to this run and is not published. |
sandstream
deleted the
claude/web-kit-status-sync-p6fg9a-gha-write-all
branch
November 27, 2026 13:21
sandstream
pushed a commit
that referenced
this pull request
Nov 27, 2026
Keep both gha-audit rules: write-all (#1124) and static cloud keys. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
What
permissions: write-allwas reported only as itsid-token: writepart (src/gha-id-token.ts:62,grantsIdToken). On a job it was reported only when no step used an OIDC token. Contents, packages, actions and pull-request write were never named.A new rule,
src/gha-write-all.ts, wired intoauditWorkflow, flags:workflow-level permissions: write-all (<file>), where every job without its ownpermissions:gets it;permissions: write-all on job <id> (<file>), for each job that sets it, bare or quoted.Each row says that write-all grants write to every scope (contents, packages, actions, pull-requests, issues, deployments, pages, statuses, checks, security-events, discussions, attestations and id-token). It suggests a read-only
GITHUB_TOKEN(permissions: contents: reador{}) as the default to aim for, with each write scope granted only on the job that needs it. It cites GitHub's guidance: https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/controlling-permissions-for-github_token. Severity is medium and the rule is CWE-250, like the id-token rows.The
id-tokenrows stay as they are, so a workflow-levelwrite-allnow gives both rows. Changing tocontents: readclears both.A missing
permissions:block is out of scope. I checked, and kit has no row for it: no gha rule, and nothing reads the repository or organisationdefault_workflow_permissions. The new rule does not flag it. The token then follows a default this file does not show, so a row would be a guess.Before / after
Fixture: a workflow with
permissions: write-allat the top, plus areleasejob that also sets it.Before (main):
After:
src/gha-write-all.test.tscovers workflow and job level, quoted forms and an inline comment, both levels at once, and the shapes that must not flag (read-all,{}, a scoped block with write scopes, a commented-out line, no block). It also checks the row next to the id-token row throughauditWorkflow. On main the test cannot load, because the module does not exist. The CLI output above is the behavioural before.Docs
The
kit gha-auditrow indocs/COMMANDS.mdnow describes the rule and why a missing block is not reported. Comments insrc/gha-audit.tsandsrc/gha-model-spend.tsnow point at the new module. Fragment:changes/gha-write-all.md.Scope notes
kit gha-auditline indocs/COMMANDS.md. Whichever merges second needs a rebase of that one line.Found by kit-research#239 (
docs/research/linkedin-batch-2026-11-27-vs-kit.md, GitHub hardening table: "write-allis reported only as itsid-token: writepart").Generated by Claude Code