Skip to content

feat(ci): add sfw-enterprise support and publish-without-sfw escape hatch#1181

Merged
John-David Dalton (jdalton) merged 5 commits intov1.xfrom
chore/v1x-sfw-enterprise-support
Apr 9, 2026
Merged

feat(ci): add sfw-enterprise support and publish-without-sfw escape hatch#1181
John-David Dalton (jdalton) merged 5 commits intov1.xfrom
chore/v1x-sfw-enterprise-support

Conversation

@jdalton
Copy link
Copy Markdown
Contributor

@jdalton John-David Dalton (jdalton) commented Apr 9, 2026

Summary

Backport of sfw-enterprise support to v1.x inline workflows.

  • When SOCKET_API_KEY secret is set, downloads sfw-enterprise from SocketDev/firewall-release instead of sfw-free
  • Enterprise shims include additional wrapper mode ecosystems: gem, bundler, nuget, go (Linux only)
  • SSL workaround (GIT_SSL_NO_VERIFY) only applied for sfw-free
  • Adds publish-without-sfw escape hatch to provenance workflow — strips shims before publish, restores after
  • Applied to all 4 sfw blocks (ci.yml lint/typecheck/test + provenance.yml build)

Test plan

  • CI passes with no SOCKET_API_KEY set (sfw-free path, current behavior)
  • Enterprise path activates when SOCKET_API_KEY repo secret is configured
  • publish-without-sfw checkbox bypasses shims during publish

Note

Medium Risk
Modifies CI and release workflows to conditionally download and run different firewall binaries based on a repository secret and to optionally bypass shims during npm publishing; mistakes could break builds/publishes or change supply-chain scanning coverage.

Overview
Updates GitHub Actions workflows to download sfw from either SocketDev/sfw-free or SocketDev/firewall-release depending on whether SOCKET_API_KEY is present, and exports SFW_IS_ENTERPRISE to drive behavior.

In CI, shim generation now expands the wrapped commands for enterprise (adds gem, bundler, nuget, and go on Linux) and only applies the GIT_SSL_NO_VERIFY workaround for the free variant.

In provenance.yml, adds a publish-without-sfw input that temporarily strips the sfw shim directory from PATH for npm publish, then restores the original PATH afterward.

Reviewed by Cursor Bugbot for commit 976cb5d. Configure here.

…atch

When SOCKET_API_KEY is set, downloads sfw-enterprise from
SocketDev/firewall-release instead of sfw-free. Enterprise shims
include additional ecosystems (gem, bundler, nuget, go on Linux).
SSL workaround only applies to sfw-free.

Adds publish-without-sfw input to provenance workflow to bypass
firewall shims during publishing.
Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix prepared a fix for the issue found in the latest run.

  • ✅ Fixed: PATH stripping via GITHUB_ENV cannot override GITHUB_PATH
    • Replaced the ineffective GITHUB_ENV PATH override with renaming the shim directory on disk (mv to .disabled), which reliably removes shims from PATH resolution regardless of GITHUB_PATH precedence.

Create PR

Or push these changes by commenting:

@cursor push fa4f89be6d
Preview (fa4f89be6d)
diff --git a/.github/workflows/provenance.yml b/.github/workflows/provenance.yml
--- a/.github/workflows/provenance.yml
+++ b/.github/workflows/provenance.yml
@@ -190,12 +190,10 @@
 
       - name: Strip sfw shims for publishing
         if: inputs.publish-without-sfw == true
-        run: | # zizmor: ignore[github-env]
+        run: |
           echo "Bypassing Socket firewall shims for publishing"
-          echo "SFW_ORIGINAL_PATH=$PATH" >> "${GITHUB_ENV:-/dev/null}"
-          if [ -n "$SFW_SHIM_DIR" ]; then
-            CLEAN_PATH="$(echo "$PATH" | tr ':' '\n' | grep -vxF "$SFW_SHIM_DIR" | paste -sd: -)"
-            echo "PATH=$CLEAN_PATH" >> "${GITHUB_ENV:-/dev/null}"
+          if [ -n "$SFW_SHIM_DIR" ] && [ -d "$SFW_SHIM_DIR" ]; then
+            mv "$SFW_SHIM_DIR" "${SFW_SHIM_DIR}.disabled"
           fi
 
       - run: INLINED_SOCKET_CLI_PUBLISHED_BUILD=1 pnpm run build:dist
@@ -225,7 +223,7 @@
           SOCKET_CLI_DEBUG: ${{ inputs.debug }}
       - name: Restore sfw shims after publishing
         if: inputs.publish-without-sfw == true && always()
-        run: | # zizmor: ignore[github-env]
-          if [ -n "$SFW_ORIGINAL_PATH" ]; then
-            echo "PATH=$SFW_ORIGINAL_PATH" >> "${GITHUB_ENV:-/dev/null}"
+        run: |
+          if [ -n "$SFW_SHIM_DIR" ] && [ -d "${SFW_SHIM_DIR}.disabled" ]; then
+            mv "${SFW_SHIM_DIR}.disabled" "$SFW_SHIM_DIR"
           fi

You can send follow-ups to the cloud agent here.

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 976cb5d. Configure here.

Writing PATH to GITHUB_ENV doesn't work because GITHUB_PATH entries
are always prepended by the runner after GITHUB_ENV is applied
(actions/toolkit#655). Rename shim files to .disabled instead so
real binaries resolve from PATH naturally.
@jdalton John-David Dalton (jdalton) enabled auto-merge (squash) April 9, 2026 21:47
@jdalton John-David Dalton (jdalton) merged commit e4fe86a into v1.x Apr 9, 2026
12 checks passed
@jdalton John-David Dalton (jdalton) deleted the chore/v1x-sfw-enterprise-support branch April 9, 2026 21:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants