From dcd15d9a299eff9a2f4841fb79c1a0ae86fe1b96 Mon Sep 17 00:00:00 2001 From: Kanwalpreet Dhindsa Date: Mon, 29 Jun 2026 23:39:16 -0700 Subject: [PATCH 1/3] add socket tier 1 reachability analysis --- .github/workflows/socket-scan.yml | 95 +++++++++++++++++++++++++++++++ 1 file changed, 95 insertions(+) create mode 100644 .github/workflows/socket-scan.yml diff --git a/.github/workflows/socket-scan.yml b/.github/workflows/socket-scan.yml new file mode 100644 index 000000000..a30c2d2f5 --- /dev/null +++ b/.github/workflows/socket-scan.yml @@ -0,0 +1,95 @@ +# Socket reachability scan for xdrgen. +# For general Socket reachability documentation, see https://docs.socket.dev/docs/full-application-reachability +# Ruby-only project (Gemfile + Gemfile.lock). +# +# Schedule: Mon 03:12 UTC weekly. Use workflow_dispatch to run on demand. +# +# ============================================================================ +# Socket scan — reading the job status. (The scan step below produces this: an +# exit code + an optional ::warning:: annotation, which GitHub Actions renders +# as the job's state.) +# ============================================================================ +# GREEN (exit 0, no warning): scan completed and every analyzed vulnerability +# got full Tier 1 reachability (precise, your-code-aware). Nothing to do. +# YELLOW (exit 0 + "::warning:: Socket scan completed with Tier 2 fallbacks"): +# scan completed, but Tier 1 could NOT be computed for some/all +# vulnerabilities, which fell back to Tier 2 (precomputed) reachability. +# You still get CVE detection + Tier 2 results, just reduced precision +# for the affected CVEs. The job is NOT failing. +# RED (non-zero exit): scan did not complete. Do not assume any part +# succeeded — could be reachability hard-failing, a missing language +# toolchain, the runner out of memory, a network/API error, or even the +# underlying CVE/SBOM detection failing. Check the logs and fix before +# relying on results. +# ---------------------------------------------------------------------------- +# THIS REPO STARTS YELLOW — a KNOWN upstream Coana bug, NOT your code or this +# scan setup: +# Coana's gem analyzer can't locate installed gems ("No load paths found"); +# the gem CVEs fall back to Tier 2. (This is a Ruby-only repo.) +# Reported to Socket; may be fixed upstream over time. Do NOT let this baseline +# yellow train the team to ignore yellow — a *new* yellow (a different Tier 2 +# fallback that appears later) is a real signal worth investigating. After the +# initial rollout, the team may resolve the baseline yellow at its discretion +# (once Coana ships a fix, or by adjusting the scan) so GREEN becomes the +# normal state and any future yellow stands out. +# ============================================================================ +# +# NOTE: tried pre-installing gems (bundle install + vendor/bundle path) and --reach-version=latest to upgrade the gem CVEs from Tier 2 to Tier 1 — all attempts hit "No load paths found for the packages to analyze". This appears to be a Coana limitation with the Ruby (gem) ecosystem. The 3 affected vulnerabilities continue to fall back to Tier 2. + +name: Socket reachability scan + +on: + schedule: + - cron: '12 3 * * 1' + workflow_dispatch: + +permissions: + contents: read + +env: + # Force JS-based GitHub actions (actions/checkout, actions/setup-*, etc.) to + # use Node 24 instead of the soon-to-be-deprecated Node 20. Safe to remove + # after 2026-06-16 (when Node 24 becomes the default and this becomes a no-op). + FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true + +jobs: + socket-scan: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 + - uses: ruby/setup-ruby@12fd324f1d0b43274fdc8130f6980590a667c455 # v1.312.0 + with: + ruby-version: "3.4.9" + - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 + with: + node-version: "24.18.0" + - name: Enable Corepack (yarn/pnpm per repo packageManager) + run: corepack enable + + - name: Install Socket CLI + run: npm install -g socket + + - name: Run Socket reachability scan + env: + SOCKET_SECURITY_API_TOKEN: ${{ secrets.SOCKET_SECURITY_API_TOKEN }} + run: | + # Stream the scan output through tee so the run log captures it AND + # we can grep it for Tier-2-fallback markers; capture the scan's + # exit code via ${PIPESTATUS[0]} (tee always exits 0). If the scan + # succeeded but logged a Tier 2 fallback, emit a ::warning:: + # annotation that GitHub Actions renders as a yellow run-level + # warning without failing the job. + set +e + socket scan create --reach \ + --org=stellar \ + --no-interactive \ + --reach-continue-on-no-source-files \ + --reach-continue-on-analysis-errors \ + --reach-continue-on-install-errors \ + --reach-continue-on-missing-lock-files \ + . 2>&1 | tee /tmp/scan.log + rc=${PIPESTATUS[0]} + if [ $rc -eq 0 ] && grep -qE "Reachability falls back to Tier 2|fallback to the results from the pre-computed|Reachability falls back to precomputed" /tmp/scan.log; then + echo "::warning::Socket scan completed with Tier 2 fallbacks - some vulnerabilities used precomputed reachability instead of full Tier 1" + fi + exit $rc From 41480798db5abe610c8cb3debaba507176268c84 Mon Sep 17 00:00:00 2001 From: Kanwalpreet Dhindsa Date: Fri, 21 Aug 2026 11:54:42 -0700 Subject: [PATCH 2/3] socket-scan: address review comments - Make the Node 24 env-var comment date-agnostic (2026-06-16 has passed) - Remove the unused Corepack step; this repo has no package.json, so it only ever shimmed yarn/pnpm that are never invoked Co-Authored-By: Claude Opus 5 (1M context) --- .github/workflows/socket-scan.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/socket-scan.yml b/.github/workflows/socket-scan.yml index a30c2d2f5..d60d3d75a 100644 --- a/.github/workflows/socket-scan.yml +++ b/.github/workflows/socket-scan.yml @@ -48,8 +48,7 @@ permissions: env: # Force JS-based GitHub actions (actions/checkout, actions/setup-*, etc.) to - # use Node 24 instead of the soon-to-be-deprecated Node 20. Safe to remove - # after 2026-06-16 (when Node 24 becomes the default and this becomes a no-op). + # use Node 24 instead of Node 20. Remove this once the runner default is Node 24. FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true jobs: @@ -63,8 +62,6 @@ jobs: - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 with: node-version: "24.18.0" - - name: Enable Corepack (yarn/pnpm per repo packageManager) - run: corepack enable - name: Install Socket CLI run: npm install -g socket From 4d888d27630d023fc45ab03935c2e3c44afa1f0f Mon Sep 17 00:00:00 2001 From: Kanwalpreet Dhindsa Date: Fri, 21 Aug 2026 12:12:44 -0700 Subject: [PATCH 3/3] socket-scan: drop the FORCE_JAVASCRIPT_ACTIONS_TO_NODE24 env var MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It is now dead config, for two independent reasons: - Every action pinned in this workflow already declares `using: node24` in its action.yml, and the var only upgrades actions that declare node20 — so it had no effect here even before the cutover. - GitHub runners have defaulted to Node 24 since 2026-06-16, and Node 20 is fully removed on 2026-09-16. Note the var never silenced the node20 deprecation warnings either: the runner classifies an action from its declared version before consulting this var (actions/runner#4295). Co-Authored-By: Claude Opus 5 (1M context) --- .github/workflows/socket-scan.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/socket-scan.yml b/.github/workflows/socket-scan.yml index d60d3d75a..733d3b9e5 100644 --- a/.github/workflows/socket-scan.yml +++ b/.github/workflows/socket-scan.yml @@ -46,11 +46,6 @@ on: permissions: contents: read -env: - # Force JS-based GitHub actions (actions/checkout, actions/setup-*, etc.) to - # use Node 24 instead of Node 20. Remove this once the runner default is Node 24. - FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true - jobs: socket-scan: runs-on: ubuntu-latest