Skip to content

ci: protect npm installs with Socket Firewall - #91

Merged
peakematt merged 1 commit into
mainfrom
ci/socket-firewall-npm
Sep 11, 2026
Merged

peakematt merged 1 commit into
mainfrom
ci/socket-firewall-npm

Conversation

@peakematt

Copy link
Copy Markdown
Contributor

authkit-remix downloads public npm packages during continuous integration and again inside the release job before it publishes directly to npm. Today those downloads reach the public registry without passing through the WorkOS Socket Firewall, so a compromised or typosquatted transitive dependency could be installed on a runner that later builds and publishes the package.

This change routes every npm install through the pinned Socket Firewall setup action ca93dd8aa351f54f4729fe3377a9be23c631c25d and pairs it with the matching teardown at the same release. The organization PUBLIC_SOCKET_FIREWALL_TOKEN secret is handed only to the setup action's token input; it never appears in a job or step environment. In continuous integration the checkout no longer persists credentials, the workflow runs with read-only contents permission, and public fork pull requests fall back to the action's validated public-registry mode while same-repository and default-branch runs stay fail-closed.

The release job keeps npm trusted publishing intact. Socket Firewall is configured after setup-node has pointed npm at https://registry.npmjs.org, dependencies install through the firewall, and teardown restores the public registry before the build and either publish step runs. No dependency download happens after teardown, so the firewall credential and proxy never reach npm publish, and the existing --provenance publication with its latest and next tag selection is unchanged.

Verify the workflow structure with:

actionlint .github/workflows/ci.yml .github/workflows/release.yml

Continuous integration runs against this branch and exercises the token-backed install and teardown on every supported Node version. The release workflow only runs for a published release or a manual dispatch, so this pull request publishes nothing.

Before merge, PUBLIC_SOCKET_FIREWALL_TOKEN must also be reachable from the separate Dependabot secret store so that dependency-update pull requests stay fail-closed and green.

@peakematt
peakematt marked this pull request as ready for review September 8, 2026 20:24

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

Copy link
Copy Markdown
Contributor

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 8, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 5/5

The PR appears safe to merge, with no new actionable issues introduced since the previous review.

Summary

  • Grants CI only read access to repository contents and disables persisted checkout credentials.
  • Configures the pinned Socket Firewall action before each npm install.
  • Tears down the firewall before executing project scripts or publishing.
  • Preserves npm trusted publishing and the existing release-tag behavior.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Checkout without persisted credentials] --> B[Configure Node.js and npm registry]
  B --> C[Configure Socket Firewall]
  C --> D[npm install through firewall]
  D --> E[Teardown and restore public registry]
  E --> F[Run checks or build]
  F --> G[Publish release when applicable]
Loading

Reviews (2) · Last reviewed commit: "ci: protect npm installs with Socket Fir..."

@peakematt
peakematt force-pushed the ci/socket-firewall-npm branch from 465cb99 to 999f7f0 Compare September 11, 2026 17:30
@peakematt
peakematt merged commit 877422c into main Sep 11, 2026
5 checks passed
@peakematt
peakematt deleted the ci/socket-firewall-npm branch September 11, 2026 17:38
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.

2 participants