Add SBOM export, offline mode, install-skill, and fix-command output#138
Merged
Conversation
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
| path = rg.generate_cyclonedx_report(trivy_bom, tool_version="9.9.9") | ||
| assert os.path.exists(path) | ||
| assert path.endswith(".cdx.json") | ||
| written = json.loads(open(path).read()) |
| "components": [], | ||
| }) | ||
| path = rg.generate_cyclonedx_report(trivy_bom, tool_version="1.0") | ||
| written = json.loads(open(path).read()) |
| with patch('builtins.print'): | ||
| try: | ||
| main() | ||
| except SystemExit: |
…code-quality bot findings on the SBOM/offline/skill PR: - Use a context manager for the two CycloneDX report reads in test_report_generator.py so the file is always closed. - Add an explanatory comment to the empty `except SystemExit` in the --offline CLI test.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds four features adapted from the sibling OWASP project cve-lite-cli, closing
the remaining comparison-table gaps and the CLAUDE.md "still open" parity items,
plus a fix for a
--jsonoutput-purity bug found along the way.Features
--sbom) — writes a spec-compliant CycloneDX BOM(
<image>.cdx.json) of the scanned image via Trivy's native exporter, withDockSec stamped into the tool metadata. Opt-in and independent of
--format;needs a single image (
-i), so it is skipped for compose runs. Surfaced in thereport summary and in
--jsonunderreport_files.--offline) — scans with no network: Trivy runs with--offline-scan --skip-db-update(uses the local vuln DB) and the AI pass andDocker Scout are skipped. Makes air-gapped scanning a single flag.
install-skillsubcommand —docksec install-skillwrites DockSec usageinstructions into AI-assistant context files (Claude Code, Cursor, Codex
AGENTS.md, GeminiGEMINI.md, GitHub Copilot). Idempotent (updates theDockSec section in place). Added via backward-compatible subcommand dispatch:
all existing flag-based usage is unchanged.
many findings have an upstream fixed version and prints a "Suggested fixes"
block of severity-ranked, deduplicated
upgrade PKG old -> newhints. Trivy'sFixedVersionis threaded into every finding (also present in JSON/CSV/SARIF).Fixed
--jsonstdout was polluted by the Rich progress spinner, breaking themachine-readable contract for CI consumers. The spinner now routes through the
shared output console (stderr in
--jsonmode), so stdout is pure JSON.Docs
install-skillrow,usage examples, and dedicated sections for SBOM / offline / install-skill.
[Unreleased]Added/Changed/Fixed entries.subcommand, and
install_skill.pymodule documented.Testing
pytest: 175 passed (was 157; +18 new tests covering the CycloneDX writer,install-skill idempotency/append/in-place-replace, the fix-command helper, and
--sbom/--offline/install-skillCLI wiring).python:3.9-slimandalpine:3.18: SBOM validity(CycloneDX 1.6),
--jsonpurity, offline scanning, and the fix-command output.Notes / not included
--offlinerelies on the local Trivy DB ratherthan a bundled advisory DB. Both noted as future work in CLAUDE.md.
setup.pyversion is unchanged (2026.7.2); a release bump for these featuresis deliberately left out of this PR.