[Bug] CLI help describes --sbom-inventory-only as applying to CycloneDX as well as SPDX

Aperta Adatta ai principianti
#1,880 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
1/5
Tempo stimato
Meno di un'ora
Idoneità per principianti
92/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
node.js, typescript

Direzione di ricerca

Inizia leggendo la descrizione di --sbom-inventory-only in src/cli/help.ts e confrontala con la formulazione in action.yml. Esamina tests/help.test.ts per identificare l’asserzione mirata relativa alla guida, quindi compila ed esegui node dist/index.js --help per verificare la descrizione visualizzata. Il lavoro è completato quando la guida della CLI distingue accuratamente il comportamento di SPDX e CycloneDX e il test mirato della guida viene superato.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

documentation good first issue

Summary

The top-level help describes --sbom-inventory-only as leaving “a pure inventory.” With CycloneDX, the report still includes vulnerability records. Someone choosing flags from --help has no indication that this option applies only to SPDX.

Environment

CVE Lite CLI 1.44.0, upstream main at a47a1cd. macOS 27.2.1, Node.js v24.19.0, npm 11.17.0. The reproduction uses the repository’s direct-high npm v3 lockfile and local fixture advisory database.

Reproduction and command used

Run from a built checkout (npm ci && npm run build).

tmp=$(mktemp -d)
node scripts/build-fixture-db.mjs
node dist/index.js --help | grep -- '--sbom-inventory-only'
scan() {
  node dist/index.js examples/scenarios/direct-high \
    --offline-db tests/fixtures/advisories/seeded.db "$@"
}
scan --sbom cyclonedx --output "$tmp/default.cdx.json"
scan --sbom cyclonedx --sbom-inventory-only --output "$tmp/inventory.cdx.json"
jq -c '[.vulnerabilities[].id]' "$tmp/default.cdx.json" "$tmp/inventory.cdx.json"
scan --sbom spdx --output "$tmp/default.spdx.json"
scan --sbom spdx --sbom-inventory-only --output "$tmp/inventory.spdx.json"
jq '[.packages[].annotations[]?] | length' "$tmp/default.spdx.json" "$tmp/inventory.spdx.json"

Actual behavior

The help line reads Omit the vulnerability overlay from --sbom, leaving a pure inventory. Both CycloneDX reports list ["CVE-LITE-S-001"]. For the same scan, the SPDX package annotation count goes from 1 to 0 when the flag is added.

Expected behavior

The CLI help should say that the flag omits vulnerability annotations from SPDX output and that CycloneDX output still includes vulnerabilities. The GitHub Action already gives users that explanation.

Where to look

This can be addressed in the CLI help text with a focused help test. Help text · GitHub Action wording · Help tests

Lingua principale
TypeScript
Stelle
806
Fork
209
Merge medio
3g 19h
PR unite (30g)
138

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di OWASP/cve-lite-cli

Tutte le issue di OWASP/cve-lite-cli

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.