Skip to content

ci: route release publish install through Socket Firewall - #119

Merged
peakematt merged 2 commits into
mainfrom
socket-firewall-publish-lane
Sep 11, 2026
Merged

ci: route release publish install through Socket Firewall#119
peakematt merged 2 commits into
mainfrom
socket-firewall-publish-lane

Conversation

@peakematt

Copy link
Copy Markdown
Contributor

The reusable publish workflow, defined in release.yml and called by release-please.yml when a release is cut, installs dependencies straight from the public npm registry before it publishes the package. That install runs on a runner that holds publish privileges and OIDC trust, so a compromised or malicious transitive dependency could execute during pnpm install with access to the release environment. Nothing currently guards that download.

This change routes the publish job's dependency download through the WorkOS Socket Firewall using the pinned workos/setup-socket-firewall composite action. Setup runs immediately after actions/setup-node, which is required because setup-node writes the registry auth placeholder that the firewall relies on, and it stays active across pnpm install. The matching teardown restores public npm registry access before the build and publish steps. The only dependency download in the job is that single pnpm install, so the firewall covers every download and nothing fetches packages after teardown. The prepublishOnly hook that runs during pnpm publish only invokes already-installed workspace tooling, including the example app's pnpm build, so it downloads nothing.

The action is fail-closed: if PUBLIC_SOCKET_FIREWALL_TOKEN is missing the install fails rather than silently reaching the public registry. The token is passed only through the action's token input, never exposed at workflow or job scope. To keep the reusable boundary tight, release.yml now declares just the PUBLIC_SOCKET_FIREWALL_TOKEN secret and release-please.yml passes it explicitly instead of using secrets: inherit.

The publish command, the https://registry.npmjs.org target, the --provenance OIDC trusted publishing, and the release-please flow are all unchanged.

You can verify the workflows statically with actionlint .github/workflows/release.yml .github/workflows/release-please.yml, which passes. Running the release path itself is deliberately not exercised here because it would trigger a real publication.

Wrap the reusable publish workflow's dependency install with the pinned workos/setup-socket-firewall setup and teardown pair so release-time installs are guarded against malicious packages. Teardown restores public npm registry access before build and publish, so no dependency download happens after it. The reusable workflow declares only the PUBLIC_SOCKET_FIREWALL_TOKEN secret and release-please passes it explicitly instead of inheriting all secrets. Publish command, npm registry, and OIDC provenance semantics are unchanged.
@peakematt
peakematt marked this pull request as ready for review September 8, 2026 20:46

@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
Contributor

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge, with no concrete correctness, security, or repository-rule violations identified.

Summary

  • Restricts CI workflow permissions and disables persisted checkout credentials.
  • Enables Socket Firewall around dependency installation.
  • Restores the public npm registry before release build and publication.
  • Declares and explicitly passes the reusable workflow’s firewall token secret.

Diagram

sequenceDiagram
  participant RP as release-please.yml
  participant R as release.yml
  participant SF as Socket Firewall
  participant NPM as npm Registry

  RP->>R: Call with firewall token
  R->>SF: Enable firewall
  R->>R: Set up pnpm and Node
  R->>SF: Refresh registry configuration
  R->>SF: pnpm install
  SF->>NPM: Proxy dependency downloads
  R->>SF: Teardown firewall
  R->>R: Build and run prepublish checks
  R->>NPM: Publish with OIDC provenance
Loading

@peakematt
peakematt merged commit 0305539 into main Sep 11, 2026
6 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.

2 participants