Skip to content

Commit 18ca8a8

Browse files
emmanuelgjrclaude
andauthored
dsgai_scanner_tool: v0.2 — fix critical defects, add obfuscation modes, CI integrations (#4)
v0.1 had two critical bugs that prevented documented use: install instructions referenced a filename that didn't exist (/GenAIDataSecurity vs the actual /dsgai_scanner_tool), and 6 of the 21 promised control scans were missing pattern blocks. This release: Critical fixes - Align README install/usage to the actual filename - Add the 6 missing scan blocks (DSGAI08, 09, 10, 16, 17, 19) Security / privacy - STRICT obfuscation by default; --internal flag restores full paths - Mandatory VALUE-BEARING scan protocol (V1-V6) so matched secret values never enter the report, the on-disk checkpoint, or any persistent tool call - Defense-in-depth secret sweep on STRUCTURAL evidence - Pinned DSGAI-scan.json schema forbids match_text / content fields Correctness - Search patterns rewritten as engine-neutral PCRE; noise patterns narrowed (P01.4 dp libs, P02.7 vault, P04.4 version operators, P11.1 vector queries, P20.5 inference endpoints) - NVD severity filter corrected (one value per call), GitHub Advisory affects-filter added, Go ecosystem added to OSV, MITRE ATLAS split from CVE sources - Report scaffolding renumbered; styling contradictions removed - Windows open-report command added New surfaces - VENDOR ATTESTATION REQUIRED status for BUY-tagged controls - --scope <path> flag for monorepos / large codebases - --no-cve flag for fully offline operation - YAML frontmatter (description, argument-hint, allowed-tools) - TL;DR quick-reference table - Known Limitations section (honest disclosure) - Plain-prompt variant (dsgai_scanner_prompt.md) for Cursor / Copilot / ChatGPT / Gemini - GitHub Action template (integrations/dsgai-scan.yml) with PR summary comments - Pre-commit hook recipe (integrations/pre-commit-hook.md + dsgai-secret-scan.sh) for fast DSGAI02 secret scanning See dsgai_scanner_tool/CHANGES_v0.2.md for the full release notes. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 5d011cb commit 18ca8a8

7 files changed

Lines changed: 1692 additions & 440 deletions

File tree

‎dsgai_scanner_tool/CHANGES_v0.2.md‎

Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
# DSGAI Scanner — v0.2 Release Notes
2+
3+
**Release date:** May 2026
4+
**Previous version:** v0.1 (April 2026)
5+
6+
A complete revision driven by a hard audit of v0.1. Eleven defects fixed across correctness, completeness, security, and developer experience. Three new distribution surfaces added.
7+
8+
---
9+
10+
## 🔴 Critical fixes (v0.1 was broken)
11+
12+
### Install path now works
13+
The v0.1 README told users to install `GenAIDataSecurity.md` and invoke `/GenAIDataSecurity`. The actual file was `dsgai_scanner_tool.md`, so the literal install commands failed. v0.2 aligns all install commands and invocations to the actual filename: `cp dsgai_scanner_tool.md ~/.claude/commands/` → `/dsgai_scanner_tool`.
14+
15+
### All 21 control scans now defined
16+
v0.1 promised 21 controls and listed all 21 in the classification table, but only **15** had actual scan pattern blocks. The 6 silently missing scans were DSGAI08 (Regulatory Compliance), DSGAI09 (Multimodal), DSGAI10 (Synthetic Data), DSGAI16 (IDE Plugin), DSGAI17 (Resilience), DSGAI19 (Data Labeling).
17+
18+
v0.2 adds explicit pattern blocks for all 6, with classification, file scope, and pass/fail criteria.
19+
20+
---
21+
22+
## 🛡️ Privacy & obfuscation hardening
23+
24+
### Strict obfuscation by default + `--internal` flag
25+
v0.1 stated "value-bearing matches must never appear in the report" but enforced this only at report-write time — the raw grep output (containing the actual secret) flowed through Claude's context and into the on-disk checkpoint. v0.2:
26+
27+
- Adds a mandatory **VALUE-BEARING SCAN PROTOCOL** (Steps V1–V6) that uses files-only search modes first, defers content search until after path triage, and explicitly forbids writing matched lines to any persistent tool call.
28+
- Introduces **two obfuscation modes**:
29+
- 🛡️ **STRICT** (default, no flag): filename + line only (`config.py:12`), intermediate directories dropped, value-bearing match content never displayed. Safe to share with auditors, attach to tickets, commit to public repos.
30+
- 🔓 **INTERNAL** (`--internal` flag): full relative path restored for team-internal use; value-bearing content *still* never displayed.
31+
- Adds a **defense-in-depth secret sweep** on every STRUCTURAL match — if the matched line accidentally contains a secret-pattern, it's redacted as if value-bearing.
32+
- Pins the `DSGAI-scan.json` schema: forbids `match_text`, `raw_grep_output`, `content`, `value` fields; in STRICT mode omits `path_internal` entirely so the checkpoint itself is shareable.
33+
34+
### VENDOR ATTESTATION REQUIRED status
35+
v0.1 had a `[BUY]` scope mechanism documented but no controls were actually tagged BUY, and the BUY-handling branch never fired. v0.2 introduces a new finding status — **VENDOR ATTESTATION REQUIRED** — for controls (or BUY-portions of BOTH-tagged controls) where the code scan cannot determine compliance. Each such finding emits a callout listing the specific attestations to request from the vendor (SOC 2 report, training data retention policy, abuse detection documentation, etc).
36+
37+
---
38+
39+
## 🔧 Correctness fixes
40+
41+
### Search patterns now portable PCRE
42+
v0.1 patterns mixed `\s`, `{n,m}`, and other PCRE features with a `grep -rn` invocation that implied POSIX grep — patterns would silently fail on basic grep. v0.2:
43+
44+
- Explicitly documents the **PCRE prerequisite** at the top of Step 2
45+
- Patterns rewritten and labeled `P##.#` for traceability
46+
- Each scan block lists pattern, file scope, and classification separately — engine-agnostic
47+
48+
### Noisy patterns narrowed
49+
Patterns that matched generic identifiers (`open(`, `query`, `search`, `generate`, `complete`, `.insert(`, `.update(`) and produced useless noise were narrowed to AI-specific contexts:
50+
- DSGAI05 RAG ingestion: `(loader\.load\(|ingest_document\(|add_documents\(|PyPDFLoader|...)` instead of `open(`
51+
- DSGAI11 vector queries: requires AI-namespace context (`similarity_search`, `as_retriever`)
52+
- DSGAI12 DDL detection: excludes `(migrations|fixtures|tests)` paths from FAIL classification
53+
- DSGAI18 LLM calls: scoped to known SDK invocation patterns
54+
- DSGAI21 KB writes: requires vector-store-SDK proximity, not generic `.insert(`
55+
56+
### CVE enrichment fixed
57+
- **NVD URL bug fixed:** v0.1 passed `cvssV3Severity=HIGH&cvssV3Severity=CRITICAL` — NVD honors only one. v0.2 issues two parallel calls per package.
58+
- **GitHub Advisory URL fixed:** v0.1 fetched the unfiltered global feed (useless). v0.2 uses `?affects=<package>&ecosystem=<eco>`.
59+
- **Go ecosystem added** to OSV queries (v0.1 listed Go as a target language but never queried `"ecosystem": "Go"`).
60+
- **NVD rate-limit handling** documented, with `NVD_API_KEY` support.
61+
- **GitHub `Authorization` header** documented for 5000 req/hour limit.
62+
- **MITRE ATLAS split** from CVE sources — it documents attack techniques, not CVEs. Now renders in its own subsection of Section 1; not counted in Section 2 CVE totals.
63+
64+
### Report scaffolding fixed
65+
- Duplicate item numbers (`4.` / `4.`, `11.` / `11.`) renumbered.
66+
- Direct contradiction in Styling — v0.1 said both "always visible, no collapse JS" and "Interactive: collapsible finding cards (click to expand), filter buttons" — resolved: no collapse JS, no filter buttons, all cards always visible. Aligns with PDF-first design.
67+
- **Windows `start DSGAI-report.html`** command added (v0.1 had only `open` / `xdg-open`).
68+
69+
### YAML frontmatter
70+
v0.1 had none. v0.2 adds frontmatter with `description`, `argument-hint`, and `allowed-tools` so Claude Code can surface the skill correctly and lock down its tool access.
71+
72+
---
73+
74+
## 🚀 New distribution surfaces
75+
76+
### GitHub Action template
77+
`integrations/dsgai-scan.yml` — runs the scan on every PR, uploads the report as an artifact, posts a PR comment summary with FAIL/WARN/PASS/CVE counts, and (optionally) fails the build on FAIL-class findings. Drop-in copy, supports `NVD_API_KEY` and `GITHUB_TOKEN` secrets for higher API rate limits.
78+
79+
### Pre-commit hook recipe
80+
`integrations/pre-commit-hook.md` — sub-second pre-commit hook that runs only the DSGAI02 hardcoded-credential subset, blocking secret commits before they hit git history. Available in three flavors: pre-commit framework, plain git hook, Husky.
81+
82+
### Plain-prompt variant for non-Claude tools
83+
`dsgai_scanner_prompt.md` — tool-neutral version stripped of Claude-Code-specific instructions (no Grep output modes, no parallel tool calls, no Write/Edit three-part protocol). Paste into Cursor, GitHub Copilot Chat, ChatGPT, or Gemini. Includes consolidated PCRE pattern bundle.
84+
85+
---
86+
87+
## 📊 What stayed the same
88+
89+
- All 21 control definitions, risk descriptions, mitigations — unchanged content
90+
- BUILD / BUY / BOTH scope tagging philosophy
91+
- Structural vs Value-Bearing classification system (now properly enforced)
92+
- PDF-first HTML report design
93+
- OWASP attribution and CC BY-SA 4.0 licensing
94+
- Three-part Write/Edit protocol for context-safe report generation
95+
96+
---
97+
98+
## 🔄 Migration from v0.1
99+
100+
**For end users:**
101+
1. Replace your existing `~/.claude/commands/dsgai_scanner_tool.md` with the v0.2 file.
102+
2. Invocation is unchanged: `/dsgai_scanner_tool`. New flags: `--internal`, `--no-cve`.
103+
3. Reports generated by v0.2 are STRICT-redacted by default. If you have a pipeline that expected full paths, add `--internal` or update the pipeline.
104+
105+
**For OWASP project maintainers:**
106+
1. Commit v0.2 of all files to `dsgai_scanner_tool/`.
107+
2. The `integrations/` directory is new — verify CI workflows reference the correct path.
108+
3. The plain-prompt variant (`dsgai_scanner_prompt.md`) is a separate distribution artifact — link from the OWASP project page.
109+
110+
---
111+
112+
## Audit trail
113+
114+
Fixes in this release were derived from a hard audit identifying 11 defects across 4 severity tiers:
115+
116+
| Severity | Count | Examples |
117+
|---|---|---|
118+
| 🔴 Critical | 2 | Install path broken; 6 of 21 scans missing |
119+
| 🟠 High | 5 | Styling contradiction; duplicate numbering; value-bearing leak risk; POSIX-incompatible patterns; noisy patterns |
120+
| 🟡 Medium | 4 | CVE enrichment URL bugs; BUY scope dead code; Windows command gap; skill-vs-slash-command terminology |
121+
| 🟢 Low | several | CVE freshness; sample image size; performance claim qualification |
122+
123+
All are addressed in v0.2. The Critical and High items are user-visible and were blocking the skill from working as documented.
124+
125+
---
126+
127+
## License
128+
129+
CC BY-SA 4.0. OWASP GenAI Data Security Initiative, led by Emmanuel Guilherme Junior. Skill adaptation by Harish Ramachandran. v0.2 revisions contributed via the [GenAI-Security-Project/GenAI-Data-Security-Initiative](https://github.com/GenAI-Security-Project/GenAI-Data-Security-Initiative) repo.

0 commit comments

Comments
 (0)