feat(scans): scan uploaded source archives like repositories (#325) #329

Merged
sharang merged 1 commits from feat/scan-source-archives into main 2026-09-23 07:22:06 +00:00
1 Commits
Author SHA1 Message Date
Sharang ParnerkarandClaude Opus 5 07172009f0 feat(scans): scan uploaded source archives like repositories (#325)
CI / Check (push) Skipped
CI / Detect Changes (pull_request) Skipped
CI / Deploy Agent (pull_request) Skipped
CI / Deploy Dashboard (pull_request) Skipped
CI / Deploy Docs (pull_request) Skipped
CI / Deploy MCP (pull_request) Skipped
CI / Check (pull_request) Successful in 5m57s
SAST, secret detection and the package SBOM only ran on a git clone. An
uploaded archive — how a customer without a git remote delivers code, and
how every firmware fixture arrives — was ingested, unpacked, and then only
its firmware SBOM was read. The run completed with no findings.

Ingest already unpacks the archive, so `classify_and_store` now hands back
where each artifact landed and the same stages run over that tree.
`run_pipeline` keeps what is git-specific (clone, change detection, the
commit watermark); `scan_tree` is the analysis both paths share.

Secret detection needed a second fix: `gitleaks detect` on a directory
that is not a checkout scans **zero bytes** and reports no leaks. On the
fixture that plants two credentials it found none, while `gitleaks dir`
finds both. The scanner now picks by what the tree is.

The nightly gains a source-archive target that asserts the whole chain —
two secrets, semgrep findings, three npm components from the lockfile, and
six CVEs matched against them. The firmware fixtures, all archives, now
report their SAST and SBOM results too.

DAST moves out of the shared tree scan to the callers, which know the
plan. It was recorded as skipped for every code target, including firmware
and embedded ones the matrix plans no DAST for — the same misleading
signal #319 removed elsewhere.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EYKjxacrr6K88DruUmP48p
2026-09-22 23:25:44 +02:00