ci: route npm dependency downloads through Socket Firewall - #87
Merged
Conversation
Configure workos/setup-socket-firewall (pinned v1) before every npm install in CI and release, and tear it down before publish so the public registry is restored ahead of npm publish. Preserves OIDC trusted publishing and --provenance. External-fork CI uses the action's fail-closed public fallback; the reusable release workflow declares the PUBLIC_SOCKET_FIREWALL_TOKEN secret and the caller passes it explicitly.
peakematt
marked this pull request as ready for review
September 8, 2026 18:38
Comment on lines
42
to
47
| - name: Restore public package registry | ||
| uses: workos/setup-socket-firewall/teardown@ca93dd8aa351f54f4729fe3377a9be23c631c25d # v1 | ||
|
|
||
| - name: Build project | ||
| run: | | ||
| npm run build |
Contributor
Contributor
|
nigel-campbell
approved these changes
Sep 10, 2026
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.
CI and release jobs install npm dependencies straight from the public registry, so a compromised or typosquatted package could execute inside a job that holds publish access. This change routes those dependency downloads through the WorkOS Socket Firewall, screening the traffic before it reaches a runner, while leaving the published package, its provenance, and release timing unchanged.
Every job that runs
npm installnow configuresworkos/setup-socket-firewallimmediately afteractions/setup-nodeand before the first download, pinned to the reviewedv1commit. The firewall points npm atsocket-firewall.workos.devand null-routes the public registry hosts for the rest of the job, so a package the firewall rejects never lands. TheCIjobs also run on pull requests from forks, which cannot read organization secrets, so they setallow-external-fork-fallback: true. The action only honors that fallback for a genuine external-fork pull request into this public repository and still fails closed for trusted, same-repository, and Dependabot runs. Those jobs drop tocontents: readand check out without persisted credentials to match the low-privilege contract the fallback requires.The publish path needs the firewall while it installs and builds, then needs the public registry back before it publishes.
release.ymlkeeps Socket Firewall active throughnpm installand the offlinetscbuild, runs the matching teardown at the same commit to restoreregistry.npmjs.org, and only then runsnpm publish. Because the build compiles offline and publish downloads nothing, no dependency fetch happens after teardown. Trusted publishing through OpenID Connect and--provenanceis untouched. The reusablerelease.ymldeclares a single named secret andrelease-please.ymlpasses it explicitly instead of inheriting every secret.To verify, read
release.yml:Configure Socket Firewallsits afterSetup Node, andRestore public package registrysits after the build and beforePublish.actionlintpasses on all three workflows.One operational requirement follows from this: Dependabot npm jobs install through the firewall too, so
PUBLIC_SOCKET_FIREWALL_TOKENmust be present in both the Actions and the Dependabot secret stores, otherwise those runs fail closed by design.