PR-12: CVE pipeline, suppressions, baseline, incremental scan (scanner) - #41
Merged
Merged
Conversation
… (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).
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.
Completes Phase 3. Depends on PR-05.
CVE pipeline → into the CLI (
cli/dsgai_cve.py, stdlib)/v1/querybatchis the per-version source; NVD enriches CVSS bycveIdonly (nokeywordSearch, which returns junk for names likeai). Cached at~/.dsgai/cve-cache/(24h TTL,--refresh-cve).Suppressions / baseline / incremental
# dsgai-ignore: P##.# reason="…"(reason required) → a visiblesuppressedsection, never silent. Each directive suppresses exactly one finding.baselinesubcommand +--baseline→ gate only on new findings.--diff <ref>→ scan only changed files; report labelled INCREMENTAL — not a full assessment.cvesubcommand;--exclude/--diff/--baselinewired through the skill + the Action (now fetchesdsgai_cve.py). Exploitable CVEs gate the build.Verification
suppressed/cve/baselinedshapes — still forbidding match content on findings and suppressed entries).scan --baselineexits 0 (all baselined).langchain==0.1.0: real OSV advisories incl. EXPLOITABLE (CVSS 7.1/9.8), cache populated, offline re-run identical.pytest→ 16 passed (+1 opt-in live-CVE test viaDSGAI_CVE_LIVE=1, verified passing);actionlint/yamllint/shellcheck/md-links clean.