Skip to content

feat: add SKIP_SOCKET_REACH and SKIP_SOCKET_SUBMISSION env vars for Node.js Socket CLI integration#29

Open
jdalton wants to merge 1 commit intomainfrom
feat/skip-socket-submission
Open

feat: add SKIP_SOCKET_REACH and SKIP_SOCKET_SUBMISSION env vars for Node.js Socket CLI integration#29
jdalton wants to merge 1 commit intomainfrom
feat/skip-socket-submission

Conversation

@jdalton
Copy link

@jdalton jdalton commented Feb 9, 2026

Summary

Add support for SKIP_SOCKET_REACH and SKIP_SOCKET_SUBMISSION env vars to enable Node.js Socket CLI integration. This allows the Node.js Socket CLI to run socket-basics in the background, collect the .socket.facts.json file, and submit it along with manifest data in a unified API call.

Motivation

The npm Socket CLI wants to integrate socket-basics. To achieve this:

  1. Background Execution: socket-basics runs in parallel with manifest collection
  2. Unified Submission: Single API call with all findings (manifests + socket-basics facts)
  3. Consolidated View: One scan ID on the dashboard showing all security findings

Without this change, socket-basics would submit independently, creating fragmented results.

Changes

Code Changes

  • socket_basics/socket_basics.py: Added environment variable check in submit_socket_facts()
    • When SKIP_SOCKET_REACH=1, skips tier 1 reachability scans (coana)
    • When SKIP_SOCKET_SUBMISSION=1, skips Socket API submission
    • Still generates .socket.facts.json with all findings
    • Returns socket_facts_path in results for downstream tools

Documentation Changes

  • README.md: Added "Integration Environment Variables" section
    • Documents SKIP_SOCKET_REACH and SKIP_SOCKET_SUBMISSION
    • Explains use case for external tool integration

How It Works

# Normal operation - socket-basics submits to API
docker run socketdev/socket-basics:latest

# CLI integration mode - socket-basics generates facts but doesn't submit
  docker run \
    -e SKIP_SOCKET_SUBMISSION=1 \
    -e SKIP_SOCKET_REACH=1 \
    socketdev/socket-basics:latest
# CLI then collects .socket.facts.json and submits with other data

@jdalton jdalton requested a review from a team as a code owner February 9, 2026 19:40
@jdalton jdalton force-pushed the feat/skip-socket-submission branch 3 times, most recently from a4cdfd2 to 5b512f9 Compare February 9, 2026 19:46
@jdalton jdalton changed the title feat: add SKIP_SOCKET_SUBMISSION environment variable for Socket CLI integration feat: add SKIP_SOCKET_REACH and SKIP_SOCKET_SUBMISSION env vars for Node.js Socket CLI integration Feb 9, 2026
@jdalton jdalton force-pushed the feat/skip-socket-submission branch 3 times, most recently from 26a05e5 to 2dc1dbb Compare February 9, 2026 20:15
…riables for CLI integration

Add support for environment variables to allow external tools (like the Node.js Socket CLI)
to skip specific operations and collect data for unified API submission.

SKIP_SOCKET_SUBMISSION:
- Skip Socket API submission while still generating .socket.facts.json
- Socket Basics completes all scanning and generates the facts file
- Allows external tools to collect and submit in a unified API call

SKIP_SOCKET_REACH:
- Skip Socket Tier 1 reachability analysis
- Allows external tools to skip redundant reachability scans
- Useful when reachability analysis is performed separately

Benefits:
- Single scan ID for all findings (supply chain + SAST + secrets + containers + reachability)
- Unified dashboard view
- Better performance via parallel execution
- No duplicate API submissions
- Flexible workflow integration

Implementation:
- Added SKIP_SOCKET_SUBMISSION check in submit_socket_facts()
- Added SKIP_SOCKET_REACH check in SocketTier1Scanner.scan()
- Returns early when environment variables are set
- Documented in README under Integration Environment Variables
@jdalton jdalton force-pushed the feat/skip-socket-submission branch from 2dc1dbb to ea1c5e9 Compare February 10, 2026 17:41
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.

3 participants