Repository navigation
ci: route example dependency installs through Socket Firewall - #1
Merged
Merged
Conversation
Add the WorkOS Socket Firewall setup action to the build job before pnpm is installed so npm-compatible dependency downloads are routed through the firewall. Public-repo contract: PUBLIC_SOCKET_FIREWALL_TOKEN, external-fork fallback (action-gated to genuine public fork PRs), checkout without persisted credentials. No publish/deploy in this job, so no teardown.
peakematt
marked this pull request as ready for review
September 9, 2026 00:06
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.
The example apps in this repository are built in continuous integration, but their dependencies install straight from the public npm registry, so a compromised or typo-squatted package could execute during
pnpm installbefore anyone reviews it. This change routes those downloads through the WorkOS Socket Firewall, which blocks known-malicious packages at install time.The
buildjob now runs the firewall setup action immediately after checkout and before pnpm is installed, so every download in the job, pnpm itself and the frozen-lockfile install, passes through the firewall. Because this public repository builds pull requests from forks, the step setsallow-external-fork-fallback: true. The action inspects the event context itself and only relaxes to the public registry for a genuine external-fork pull request, where the firewall token cannot be provided. Pushes tomain, manual runs, same-repo pull requests, and Dependabot all keep the firewall active and fail closed when the token is missing rather than silently reaching the public registry. The checkout no longer persists its credentials, so an untrusted dependency cannot reuse them. The job holds no deploy or publish credentials and ships nothing, so no teardown step is needed and the firewall stays active through the build.To verify, open the workflow run for this branch and confirm the
Setup Socket Firewallstep reports the firewall active before dependencies install and that the build still succeeds. The action is pinned to the immutable commitca93dd8aa351f54f4729fe3377a9be23c631c25d.Protection on same-repo and Dependabot runs depends on the
PUBLIC_SOCKET_FIREWALL_TOKENsecret being available to Actions and to Dependabot; without it those trusted runs fail closed by design.