Skip to content

Add Socket Firewall enforcement to CI and releases#1681

Open
paul-paliychuk wants to merge 2 commits into
mainfrom
paul-paliychuk/socket-firewall-ci
Open

Add Socket Firewall enforcement to CI and releases#1681
paul-paliychuk wants to merge 2 commits into
mainfrom
paul-paliychuk/socket-firewall-ci

Conversation

@paul-paliychuk

Copy link
Copy Markdown
Collaborator

Summary

  • add a reusable Socket Firewall wrapper action and apply it to Python dependency installs in CI
  • enforce Socket scanning in official server and MCP Docker image releases using BuildKit secrets
  • preserve fork PRs and public Docker builds through explicit no-secret fallback paths
  • add a connectivity workflow covering wrapper routing and enforced/fallback Docker behavior

Motivation

Graphiti dependency downloads should use the same Socket policy enforcement as Zep's internal repositories without breaking outside contributors or public image builds that do not have access to Socket credentials.

Impact

Same-repository CI and official release builds use SOCKET_API_KEY. Fork PRs soft-skip the wrapper, while Docker builds default to direct installs unless release workflows explicitly enable enforcement. The enforcement build argument separates public and release paths in the BuildKit cache.

Testing

  • Parsed all modified workflow and action YAML
  • Ran actionlint on modified workflows
  • Ran Dockerfile static checks for all three images
  • Completed a root Docker build without a Socket secret
  • Verified enforced Docker mode rejects a missing secret
  • Verified the Python package-install command used by the connectivity check
  • Confirm the connectivity workflow passes in GitHub Actions with the configured Socket secret

Risks / follow-ups

SOCKET_API_KEY must remain configured as a repository secret and in the development and release environments. Fork PRs intentionally run without Socket enforcement because GitHub does not expose secrets to forks.

Made with Cursor

Route dependency installs and official image builds through Socket while preserving fork PR and public Docker fallbacks.

Co-authored-by: Cursor <cursoragent@cursor.com>
sfw can only inspect packages that are actually downloaded, so a release
image could ship a package flagged after its layer was first built. Two
caches hid dependencies from enforced builds: the BuildKit layer cache
skipped the install step outright, and the uv cache mount let uv resolve
wheels from disk without contacting PyPI even when the step did run.

Enforced builds now set a per-run SOCKET_SCAN_ID to invalidate the install
layer and export UV_NO_CACHE=1. Community builds leave SOCKET_SCAN_ID empty
and keep both caches.

The connectivity smoke test compares a stamp written inside the install
layer rather than grepping the build log, since BuildKit echoes instruction
text for CACHED steps too, and asserts an unchanged scan id still hits the
cache so the check cannot pass vacuously.

Co-authored-by: Cursor <cursoragent@cursor.com>
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.

1 participant