Skip to content

fix(ci): harden workflows#310

Merged
ruturaj-browserstack merged 4 commits into
browserstack:mainfrom
SavioBS629:harden-workflows
May 29, 2026
Merged

fix(ci): harden workflows#310
ruturaj-browserstack merged 4 commits into
browserstack:mainfrom
SavioBS629:harden-workflows

Conversation

@SavioBS629
Copy link
Copy Markdown
Collaborator

@SavioBS629 SavioBS629 commented May 29, 2026

Summary

Three independent workflow hardening fixes.

Changes

1. mcp-ci.yml — least-privilege permissions
Added top-level permissions: contents: read. The CI workflow previously inherited the write-all
default for GITHUB_TOKEN; it only needs to check out the repo and run npm test.

2. npm-publish.yml — npm provenance
Added --provenance to the npm publish command and the required id-token: write permission.
Released packages now carry a signed attestation linking the tarball to this workflow run on this
repo — defends against trojaned releases via a leaked NPM_TOKEN or compromised maintainer machine.
Verifiable by consumers via npm audit signatures.

3. mcp-registry-publish.yml — SHA-verify the mcp-publisher binary
Replaced curl … | tar xz with download → sha256sum -c → extract. Pinned to mcp-publisher
v1.3.3 linux_amd64; digest cross-checked against the official registry_1.3.3_checksums.txt.
Workflow aborts if the downloaded tarball doesn't match.

SavioBS629 and others added 3 commits May 29, 2026 15:25
Workflow inherited the write-all default for GITHUB_TOKEN. Limits to
read-only — the job only checks out the repo and runs npm test, no
write access to any GitHub resource is needed.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Adds --provenance to the npm publish step and the required id-token: write
permission. Attaches a signed attestation to the published package so
consumers can verify it was built by this exact workflow on this repo.
Defends against trojaned releases via a compromised maintainer machine
or NPM_TOKEN.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Previous install step piped curl output straight to tar — any compromise of
the release URL (CDN, account, MITM) would have executed arbitrary code
with OIDC write access. Now: download to file, verify SHA-256 against
pinned digest, then extract. Workflow aborts on mismatch.

Pinned to mcp-publisher v1.3.3 linux_amd64 (digest cross-checked against
the official registry_1.3.3_checksums.txt file).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@ruturaj-browserstack ruturaj-browserstack merged commit cce7d39 into browserstack:main May 29, 2026
1 check passed
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.

2 participants