chore: harden release workflow for supply-chain security#120
Open
thetutlage wants to merge 3 commits into
Open
chore: harden release workflow for supply-chain security#120thetutlage wants to merge 3 commits into
thetutlage wants to merge 3 commits into
Conversation
- Use npm Trusted Publishing (OIDC) instead of NPM_TOKEN - Pin third-party actions and reusable workflows to commit SHAs - Drop default permissions to read-only, elevate per-job - Add --ignore-scripts to release-time install - Add npm audit signatures step - Add Dependabot for github-actions ecosystem - Add concurrency guard Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Addresses CodeQL "Workflow does not contain permissions" finding by declaring contents: read at workflow scope so GITHUB_TOKEN is scoped down on push/pull_request/workflow_call runs. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Requires approval from the Core Team before npm publish runs, via the GitHub Environment created in each repo. Pair with an npm Trusted Publisher config that pins the environment to fully close the gate. Co-Authored-By: Claude Opus 4.7 (1M context) <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.
Summary
NPM_TOKENfrom the workflow, so transitivepostinstallscripts can no longer exfiltrate it from~/.npmrc.actions/checkout,actions/setup-node, and theadonisjs/.github/adonisjs/corereusable workflows to commit SHAs to defend against tag/branch reflog tampering.permissions:tocontents: read, elevates per-job (contents: write+id-token: writeonly on the release job).npm install --ignore-scriptsso transitive postinstall scripts cannot run during the release job.npm audit signaturesstep before publishing to verify registry signatures.github-actionsecosystem so the pinned SHAs are kept current automatically.concurrencyblock to prevent overlapping release runs.Prerequisites
release.yml, environment: none). Confirmed configured before this PR.NPM_TOKENcan be deleted after the first successful tokenless release.Test plan
releaseworkflow manually with a patch bump.NPM_TOKENbeing available.npm install --ignore-scriptsbreaks the build for this repo (e.g. a transitive dep relies onpostinstallto fetch a native binary), drop the flag in a follow-up.🤖 Generated with Claude Code