Skip to content

ci(security): add a least-privilege permissions block to sync-check#32

Merged
MANVENDRA-github merged 1 commit into
mainfrom
ci/least-privilege-sync-check
Jul 8, 2026
Merged

ci(security): add a least-privilege permissions block to sync-check#32
MANVENDRA-github merged 1 commit into
mainfrom
ci/least-privilege-sync-check

Conversation

@MANVENDRA-github

Copy link
Copy Markdown
Owner

Why

sync-check.yml declared no permissions:, so it inherited the repository's default GITHUB_TOKEN scope — read/write across contents, issues, and packages on older repo settings.

$ grep -L '^permissions:' .github/workflows/*.yml
.github/workflows/sync-check.yml

All three of its jobs (sync-determinism, frontmatter-lint, tests) only check out the repo and run npm. None writes a comment, a commit, or a release. release.yml already scopes itself to contents: write because it genuinely creates a Release — sync-check needs strictly less.

The part that stings

This repo ships:

  • an infra-config-reviewer agent — "Reviews infrastructure-as-code and deploy config for misconfiguration — over-broad permissions, public exposure, root containers, unpinned images, plaintext secrets."
  • a supply-chain-security skill.

A missing permissions: block on a CI workflow is the first thing either would report. It is also the first thing a reviewer greps for on a public repo.

Verification

$ python -c "import yaml; d=yaml.safe_load(open('.github/workflows/sync-check.yml')); print(d['permissions'], list(d['jobs']))"
{'contents': 'read'} ['sync-determinism', 'frontmatter-lint', 'tests']

$ npm run sync   # clean, no drift

This PR's own CI run is the proof the scope is sufficient — it executes under the new block.

sync-check.yml declared no `permissions:`, so it inherited the repository's
default GITHUB_TOKEN scope -- read/write across contents, issues, and packages
on older repo settings. All three of its jobs only check out the repo and run
npm; none writes a comment, a commit, or a release.

release.yml already scopes itself to `contents: write` because it genuinely
creates a Release. sync-check needs strictly less: `contents: read`.

Worth naming: this repo ships an infra-config-reviewer agent whose stated job
is flagging "over-broad permissions" in CI/CD workflow config, and a
supply-chain-security skill. A missing permissions block is the first thing
either would report about this workflow.
@MANVENDRA-github
MANVENDRA-github merged commit 866aefa into main Jul 8, 2026
3 checks passed
@MANVENDRA-github
MANVENDRA-github deleted the ci/least-privilege-sync-check branch July 8, 2026 18:51
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.

1 participant