Skip to content

Commit fc41257

Browse files
ShreeShree
authored andcommitted
docs: add SAST fixture evidence matrix
1 parent 430bfb5 commit fc41257

2 files changed

Lines changed: 26 additions & 5 deletions

File tree

skills/devsecops/sast-config/SKILL.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ phase: [build]
1212
frameworks: [OWASP-ASVS-4.0.3, CWE-Top-25]
1313
difficulty: intermediate
1414
time_estimate: "30-60min"
15-
version: "1.1.0"
15+
version: "1.1.1"
1616
author: unitoneai
1717
license: MIT
1818
allowed-tools: Read, Grep, Glob
@@ -239,6 +239,7 @@ rules:
239239
- [ ] `pattern-not` or `pattern-not-inside` handles known safe patterns to reduce false positives.
240240
- [ ] Safe wrappers and validators are modeled as sanitizers, not suppressed wholesale.
241241
- [ ] Rule tests include at least one vulnerable flow and one benign flow for every sanitizer or wrapper exception.
242+
- [ ] Fixture evidence records the expected result, rule or query family, and scan output for each true-positive and true-negative sample.
242243

243244
#### 3.3 Semgrep Taint Mode and Safe-Wrapper Review
244245

@@ -605,10 +606,10 @@ jobs:
605606

606607
### Dataflow and False-Positive Evidence
607608

608-
| Tool | Flow Class | Source/Sink Evidence | Sanitizer/Wrapper Evidence | Vulnerable Fixture | Benign Fixture | Gap |
609-
|------|------------|----------------------|-----------------------------|--------------------|----------------|-----|
610-
| Semgrep | Command injection | `request.args` -> `subprocess.run(shell=True)` | `validate_report_id()` + arg-array execution | `tests/sast/command-injection-vuln.py` | `tests/sast/command-injection-safe.py` | None |
611-
| CodeQL | SQL injection | Express query -> `db.raw()` | `parseSearchTerm()` + query builder | `qltest/sql-vuln.js` | `qltest/sql-safe.js` | Missing custom helper model |
609+
| Tool | Flow Class | Source/Sink Evidence | Sanitizer/Wrapper Evidence | Vulnerable Fixture | Benign Fixture | Scan Evidence | Gap |
610+
|------|------------|----------------------|-----------------------------|--------------------|----------------|---------------|-----|
611+
| Semgrep | Command injection | `request.args` -> `subprocess.run(shell=True)` | `validate_report_id()` + arg-array execution | `tests/sast/command-injection-vuln.py` | `tests/sast/command-injection-safe.py` | <rule id, command, true-positive/true-negative output> | None |
612+
| CodeQL | SQL injection | Express query -> `db.raw()` | `parseSearchTerm()` + query builder | `qltest/sql-vuln.js` | `qltest/sql-safe.js` | <query id, database/query command, result path> | Missing custom helper model |
612613

613614
### Scope Boundary Evidence
614615

@@ -714,5 +715,7 @@ This skill processes SAST configuration files, custom rules, and code patterns t
714715
715716
## Changelog
716717
718+
- **1.1.1** -- Added explicit fixture evidence expectations for true-positive
719+
and true-negative SAST samples.
717720
- **1.1.0** -- Added Semgrep taint-mode and CodeQL custom dataflow review gates, safe-wrapper false-positive evidence, generated-code and monorepo scan-boundary checks, and report fields for vulnerable/benign fixture evidence.
718721
- **1.0.0** -- Initial release. Full coverage of SAST configuration review against OWASP ASVS 4.0.3 and CWE Top 25, with Semgrep and CodeQL patterns.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# SAST Fixture Evidence
2+
3+
These fixtures give reviewers compact true-positive and true-negative samples
4+
for the dataflow checks described by `sast-config`. Use them to verify that a
5+
custom Semgrep rule or CodeQL query detects vulnerable flows without flagging
6+
validated wrappers or parameterized query builders.
7+
8+
| Fixture | Expected Result | Flow Class | Evidence to Record |
9+
|---------|-----------------|------------|--------------------|
10+
| `vulnerable/command-injection-taint.py` | True positive | Flask request argument reaches `subprocess.run(..., shell=True)` | Rule/query id and finding output |
11+
| `benign/validated-command-wrapper.py` | True negative | Flask request argument is decimal-validated and passed as an argument array | Rule/query id and no-finding output |
12+
| `vulnerable/express-raw-sql-flow.js` | True positive | Express query parameter reaches raw SQL construction | Rule/query id and finding output |
13+
| `benign/express-query-builder.js` | True negative | Express query parameter flows through parser plus query builder API | Rule/query id and no-finding output |
14+
15+
When a review accepts a sanitizer or wrapper as safe, cite the matching benign
16+
fixture path and the scan output that stayed quiet. When a rule claims
17+
source-to-sink coverage, cite the matching vulnerable fixture path and the
18+
finding output that proves the flow is detected.

0 commit comments

Comments
 (0)