Skip to content

ci: route example dependency installs through Socket Firewall - #1

Merged
peakematt merged 1 commit into
mainfrom
add-socket-firewall
Sep 10, 2026
Merged

peakematt merged 1 commit into
mainfrom
add-socket-firewall

Conversation

@peakematt

Copy link
Copy Markdown
Contributor

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 install before anyone reviews it. This change routes those downloads through the WorkOS Socket Firewall, which blocks known-malicious packages at install time.

The build job 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 sets allow-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 to main, 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 Firewall step reports the firewall active before dependencies install and that the build still succeeds. The action is pinned to the immutable commit ca93dd8aa351f54f4729fe3377a9be23c631c25d.

Protection on same-repo and Dependabot runs depends on the PUBLIC_SOCKET_FIREWALL_TOKEN secret being available to Actions and to Dependabot; without it those trusted runs fail closed by design.

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
peakematt marked this pull request as ready for review September 9, 2026 00:06

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

@greptile-apps

greptile-apps Bot commented Sep 9, 2026

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

The workflow hardening appears safe to merge, with no concrete regressions identified.

Summary

  • Disables persistence of checkout credentials in the build job.
  • Configures the Socket Firewall before pnpm and project dependencies are installed.
  • Pins the new firewall action to an immutable commit.
  • Allows public-registry fallback for external-fork pull requests where repository secrets are unavailable.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Checkout without persisted credentials] --> B[Setup Socket Firewall]
  B --> C{Firewall token available?}
  C -->|Yes| D[Route downloads through firewall]
  C -->|No, genuine external fork| E[Use public-registry fallback]
  C -->|No, trusted run| F[Fail closed]
  D --> G[Install pnpm]
  E --> G
  G --> H[Install frozen-lockfile dependencies]
  H --> I[Build example]
Loading

@peakematt
peakematt merged commit e65163e into main Sep 10, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant