Skip to content

PR-12: CVE pipeline, suppressions, baseline, incremental scan (scanner) - #41

Merged
emmanuelgjr merged 1 commit into
mainfrom
improve/pr-12-cve-suppressions-baseline
Jul 18, 2026
Merged

PR-12: CVE pipeline, suppressions, baseline, incremental scan (scanner)#41
emmanuelgjr merged 1 commit into
mainfrom
improve/pr-12-cve-suppressions-baseline

Conversation

@emmanuelgjr

Copy link
Copy Markdown
Contributor

Completes Phase 3. Depends on PR-05.

CVE pipeline → into the CLI (cli/dsgai_cve.py, stdlib)

  • OSV /v1/querybatch is the per-version source; NVD enriches CVSS by cveId only (no keywordSearch, which returns junk for names like ai). Cached at ~/.dsgai/cve-cache/ (24h TTL, --refresh-cve).
  • Classification is CVSS-aware (≥7 or CRITICAL/HIGH → EXPLOITABLE); CVSS is cached so online and offline runs are byte-identical.
  • The LLM never transcribes CVE data — hallucinated CVEs become impossible by construction. CVE enrichment reaches CI Job 1 with no WebFetch.

Suppressions / baseline / incremental

  • Inline # dsgai-ignore: P##.# reason="…" (reason required) → a visible suppressed section, never silent. Each directive suppresses exactly one finding.
  • baseline subcommand + --baseline → gate only on new findings.
  • --diff <ref> → scan only changed files; report labelled INCREMENTAL — not a full assessment.
  • New cve subcommand; --exclude/--diff/--baseline wired through the skill + the Action (now fetches dsgai_cve.py). Exploitable CVEs gate the build.

Verification

  • Fixture findings unchanged (29, checkpoint schema-valid with the new suppressed/cve/baselined shapes — still forbidding match content on findings and suppressed entries).
  • Baseline round-trip: 16 fingerprints → scan --baseline exits 0 (all baselined).
  • Suppression: suppresses exactly one finding (the double-suppress bug my test caught is fixed).
  • langchain==0.1.0: real OSV advisories incl. EXPLOITABLE (CVSS 7.1/9.8), cache populated, offline re-run identical.
  • pytest16 passed (+1 opt-in live-CVE test via DSGAI_CVE_LIVE=1, verified passing); actionlint/yamllint/shellcheck/md-links clean.

… (PR-12)

- cli/dsgai_cve.py (stdlib urllib): CVE enrichment in the CLI so the LLM never
  transcribes CVE data. OSV /v1/querybatch is the per-version source; NVD
  enriches CVSS by cveId only (no keywordSearch). Cached at ~/.dsgai/cve-cache/
  (24h TTL, --refresh-cve); classification is CVSS-aware (>=7 or CRITICAL/HIGH =
  EXPLOITABLE) and CVSS is cached so online and offline runs are byte-identical.
- Suppressions: inline '# dsgai-ignore: P##.# reason="..."' (reason required)
  move findings to a visible checkpoint 'suppressed' list, never silent. Each
  directive suppresses exactly one finding (same line, else the line below).
- Baseline: 'baseline' subcommand writes fingerprints; --baseline gates only on
  NEW findings (baselined ones carry baselined: true).
- Incremental: --diff <ref> scans only git-changed files; scan_scope becomes
  'diff:<ref>' and the report is labelled INCREMENTAL.
- New 'cve' subcommand; --exclude/--diff/--baseline wired through the skill and
  the Action (now fetches dsgai_cve.py). Exploitable CVEs also gate the build.
- schemas/dsgai-scan.schema.json extended (suppressed[], baselined, cve shape),
  still forbidding match content on findings AND suppressed entries.

Verified: fixture findings unchanged (29, schema-valid); baseline round-trip
(16 fps -> exit 0); suppression suppresses exactly one; langchain==0.1.0 yields
real OSV advisories incl. EXPLOITABLE with a populated cache; offline re-run
identical. pytest 16 passed (+1 live-CVE test, opt-in via DSGAI_CVE_LIVE).
@emmanuelgjr
emmanuelgjr merged commit 7bc1347 into main Jul 18, 2026
9 checks passed
@emmanuelgjr
emmanuelgjr deleted the improve/pr-12-cve-suppressions-baseline branch July 18, 2026 13:54
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