Skip to content

fix(supply-chain-firewall): CLI reads the audit JSON's real keys (Part of #8428) - #8595

Merged
squid-shepherd[bot] merged 2 commits into
mainfrom
churn/8428-20261118T1119Z
Nov 18, 2026
Merged

squid-shepherd[bot] merged 2 commits into
mainfrom
churn/8428-20261118T1119Z

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

Part of #8428 (security epic #8427).

What / design decision

The standalone supply-chain-firewall CLI read raw_imports and risk_vector from audit-JSON file entries, but the audit JSON has neither (it has "9. Extracted Dependencies" and "4. Vulnerability & Risk Exposures" as {display label: "N%"}). Chosen option: the CLI reads the real audit keys (_audit_file_to_node in supply_chain_firewall.py translates an entry to the in-memory node run_firewall_audit takes). galaxyscope output is unchanged and the CLI no longer accepts the old shape. The risk labels come from the same derivation AuditRecorder uses.

Tests (real code)

  • A real galaxyscope scan of a planted repo, then main() on the resulting *_audit.json: blacklisted requests exits 1; strict mode with an unapproved import exits 1, with all imports approved exits 0.
  • Round-trip of the exposure block into the risk vector (including [UNSCANNED - NO DATA]).
  • Existing CLI tests in test_supply_chain_firewall.py now feed the audit shape (they fed the old shape, which is why they passed while the CLI was a no-op).

Pre-gate

.github/workflows/gitgalaxy.yml pre-gate, run locally on this repo after the fix: 2,525 files, 16,111 imports seen (was 0), no threats, exit 0. Keep it required.

Gates

audit_check.py all clear; ruff format/check on changed files clean; test file ~10 s per test on a loaded box (the real scan is a module fixture).

Class / Sibling gaps

Class: consumers of the audit JSON. The CLI main was the only one (the issue's table re-checked: vault_sentinel, X-Ray, terabyte_log_scanner, cobol tools, readiness do not load the audit; the engine-internal path uses the in-memory shape). Handled: CLI.
Sibling gaps: (1) telemetry.network_metrics for FIREWALL_NETWORK_WEIGHTING is still not read from the audit JSON (opt-in, off by default; needs a check of what the audit emits); (2) docs showcase results (Terraform, tRPC, pwntools) need re-run or removal; docs claims (enforce-supply-chain-firewall.md, supply_chain_security/README.md, 04-03) need re-verify. Neither fits this slice's mechanism.

Remaining slices

Docs re-verify plus showcase re-run (docs only, per #8426 section C); network_metrics weighting from the audit.

🤖 Generated with Claude Code

@squid-protocol squid-protocol added the shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md label Nov 18, 2026
@squid-shepherd

Copy link
Copy Markdown
Contributor

No description provided.

@squid-shepherd
squid-shepherd Bot marked this pull request as ready for review November 18, 2026 12:37
@squid-shepherd
squid-shepherd Bot enabled auto-merge (squash) November 18, 2026 12:38
@github-actions

Copy link
Copy Markdown
Contributor

🐦‍⬛ Muninn Security Scan

✅ No security issues found.

🐦‍⬛ Powered by Muninn · Skald Lab

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant