Skip to content

feat(tools): sbom_scan — CycloneDX/SPDX SBOM vulnerability scanner + CLI subcommand (+98 tests) - #64

Open
manus-use wants to merge 1 commit into
mainfrom
feat/sbom-scan
Open

feat(tools): sbom_scan — CycloneDX/SPDX SBOM vulnerability scanner + CLI subcommand (+98 tests)#64
manus-use wants to merge 1 commit into
mainfrom
feat/sbom-scan

Conversation

@manus-use

@manus-use manus-use commented Jun 28, 2026

Copy link
Copy Markdown
Owner

Summary

Implements the sbom_scan tool and manus-agent sbom-scan CLI subcommand — a complete SBOM vulnerability scanner that was documented in the README but had zero implementation (no tool file, no CLI dispatch, no tests).

What it does

Parses CycloneDX (JSON) and SPDX (JSON) SBOM files, batch-queries OSV.dev for known vulnerabilities affecting each component, enriches findings with current EPSS exploitation probability scores and CISA KEV membership status, then ranks results by:

  1. CISA KEV membership (actively exploited in the wild → first)
  2. EPSS score (highest exploitation probability → next)
  3. CVSS base score (highest severity → last tiebreak)

CLI Usage

manus-agent sbom-scan bom.json
manus-agent sbom-scan sbom.spdx.json --output json | jq .critical_count

Tool Features

  • Format auto-detection: CycloneDX (bomFormat: "CycloneDX") and SPDX (spdxVersion field)
  • Package URL (purl) parsing: Supports PyPI, npm, Maven, Go, Cargo, NuGet, RubyGems, Packagist, Pub, Hex, Debian, Alpine, and more
  • OSV.dev batch queries: Efficient POST /v1/querybatch (chunked at 1000 per request)
  • EPSS bulk enrichment: Batch FIRST.org API lookups (chunked at 100 CVEs per request)
  • CISA KEV enrichment: Full catalog fetch + set membership check
  • Retry/back-off: Configurable via SBOM_SCAN_MAX_RETRIES and SBOM_SCAN_RETRY_BASE_DELAY env vars
  • Graceful degradation: If any enrichment source fails, scan continues with available data
  • Deduplication: Same vulnerability reported for the same package+version is counted once
  • Strands TOOL_SPEC interface: Compatible with agent tool registry

Tests

98 fully-mocked tests covering:

Category Count
TOOL_SPEC contract 4
Input validation 5
Format detection 6
Purl parsing 10
CycloneDX extraction 7
SPDX extraction 4
parse_sbom integration 3
HTTP retry 5
OSV batch query 4
EPSS enrichment 4
CISA KEV enrichment 3
CVE extraction 4
CVSS extraction 5
Fix version extraction 4
Finding assembly & ranking 5
Text formatting 3
JSON formatting 3
Full scan integration 3
Tool handler 3
CLI subcommand 6
Edge cases 7

Test results: 1256 passed (baseline 1158 + 98 new), 0 failures.

Files Changed

  • src/manus_agent/tools/sbom_scan.py — new tool implementation
  • src/manus_agent/cli.py — added sbom-scan to _SUBCOMMANDS, parser, runner, dispatch
  • tests/test_sbom_scan.py — 98 comprehensive tests

Design Decisions

  • Zero new dependencies — uses only requests (already a project dependency)
  • OSV.dev batch API — far more efficient than per-package queries for SBOM-scale workloads
  • Ecosystem mapping via purl type — standard Package URL scheme provides reliable ecosystem identification
  • Ranking by KEV → EPSS → CVSS — actionability-first ordering (known-exploited before theoretical severity)

Duplicate Check

Checked all 50 open PRs (#138#187) and 30 merged PRs — no existing open or merged PR implements sbom-scan or an SBOM scanner. Closest PRs:

manus-use pushed a commit that referenced this pull request Jun 29, 2026
…n PRs roadmap, and changelog section

- poc-search subcommand (PR #62): multi-source PoC aggregator (trickest, VulnCheck KEV, Exploit-DB, GitHub, NVD)
- changelog subcommand (PR #66): conventional-commit release automation
- VulnCheck enrichment section: VULNCHECK_API_KEY optional, vulncheck-kev + nist-nvd2 indexes
- Updated 8-step VI pipeline description to include VulnCheck KEV in step 2, patch diff/exploit complexity/version range in step 6
- Coming Soon table: 9 open PRs (#51 silent-patches, #53 cve-timeline, #54 version-range, #58 vendor-response, #60 poc-freshness, #63 blast-radius, #64 sbom-scan, #65 temporal-priority, #67 cluster-variants)
- Updated built-in tools list to mention VulnCheck KEV and new VI tools
- Added Changelog section linking to CHANGELOG.md
- Updated Table of Contents with Changelog entry
- Expanded Security examples to include poc-search and changelog
@manus-use manus-use changed the title feat(tools): SBOM vulnerability scanner — scan_sbom tool + manus-use sbom-scan CLI feat(tools): sbom_scan — CycloneDX/SPDX SBOM vulnerability scanner + CLI subcommand Aug 13, 2026
@manus-use manus-use changed the title feat(tools): sbom_scan — CycloneDX/SPDX SBOM vulnerability scanner + CLI subcommand feat(tools): sbom_scan — CycloneDX/SPDX vulnerability scanner + CLI subcommand (+96 tests) Aug 15, 2026
@manus-use manus-use changed the title feat(tools): sbom_scan — CycloneDX/SPDX vulnerability scanner + CLI subcommand (+96 tests) feat(tools): sbom_scan — CycloneDX/SPDX SBOM vulnerability scanner + CLI subcommand (+98 tests) Aug 17, 2026
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