You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor: add normalized id field to all three alert sources
Each source now has a pre-computed `id` field so Claude can deduplicate
with simple string matching instead of inferring IDs:
- Trivy: extracted into trivy-alerts.json with id = VulnerabilityID
- Dependabot: id = cve_id (preferred) or ghsa_id (fallback)
- CodeQL: id = "codeql:" + rule_id
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
--json-schema '{"type":"object","properties":{"cves":{"type":"array","items":{"type":"object","properties":{"cveId":{"type":"string","description":"CVE ID, GHSA ID, or codeql:<rule-id>"},"severity":{"type":"string","enum":["CRITICAL","HIGH","MEDIUM","LOW"]},"source":{"type":"string","enum":["trivy","dependabot","codeql","trivy+dependabot"],"description":"Which scanner(s) reported this finding"},"title":{"type":"string","description":"Short summary for the Linear issue title"},"description":{"type":"string","description":"Markdown analysis: affected packages, direct vs transitive, remediation steps, and references"},"affectedPackage":{"type":"string"},"linearIssueExists":{"type":"boolean"}},"required":["cveId","severity","source","title","description","affectedPackage","linearIssueExists"]}}},"required":["cves"]}'
389
401
prompt: |
390
402
You are a security engineer triaging vulnerabilities and security findings for the Sourcebot Docker image.
391
-
You have three data sources to analyze:
403
+
You have three data sources to analyze. Each is a JSON array where every entry has a pre-computed
404
+
`id` field for deterministic deduplication:
392
405
393
-
1. **Trivy scan results** in `trivy-results.json` — container image vulnerability scan (JSON format with `Results[].Vulnerabilities[]` array)
394
-
2. **Dependabot alerts** in `dependabot-alerts.json` — GitHub dependency vulnerability alerts
395
-
3. **CodeQL alerts** in `codeql-alerts.json` — GitHub code scanning findings
406
+
1. **Trivy scan results** in `trivy-alerts.json` — each entry has `id` (CVE ID, e.g., `CVE-2024-1234`)
407
+
2. **Dependabot alerts** in `dependabot-alerts.json` — each entry has `id` (CVE ID or GHSA ID)
408
+
3. **CodeQL alerts** in `codeql-alerts.json` — each entry has `id` (prefixed, e.g., `codeql:js/sql-injection`)
396
409
397
410
## Your Task
398
411
399
-
1. Read and analyze all three data sources. For **each unique finding**, produce a separate entry
400
-
in the `cves` array.
412
+
1. Read and analyze all three data sources. For **each unique `id`**, produce a separate entry
413
+
in the `cves` array. Use the `id` field as the `cveId`.
401
414
402
-
2. **Deduplication**: Trivy and Dependabot may report the same CVE. If a CVE ID appears in both
403
-
Trivy results and Dependabot alerts, merge them into a single entry with `source: "trivy+dependabot"`.
404
-
Combine information from both sources in the description. CodeQL alerts are always unique — they
405
-
use rule IDs, not CVE IDs.
415
+
2. **Deduplication**: If the same `id` appears in both `trivy-alerts.json` and `dependabot-alerts.json`,
416
+
merge them into a single entry with `source: "trivy+dependabot"`. Combine information from both
417
+
sources in the description. CodeQL `id` values are prefixed with `codeql:` so they never collide.
406
418
407
419
3. For **Trivy and Dependabot findings**:
408
-
- Use the CVE ID (e.g., `CVE-2024-1234`) as `cveId`. If a Dependabot alert only has a GHSA ID
409
-
and no CVE ID, use the GHSA ID (e.g., `GHSA-xxxx-xxxx-xxxx`) as `cveId`.
420
+
- Use the `id` field as `cveId`.
410
421
- Set `source` to `"trivy"`, `"dependabot"`, or `"trivy+dependabot"` as appropriate.
411
422
- Include the affected package, severity, remediation steps, and whether it is direct or transitive.
412
423
413
424
4. For **CodeQL findings**:
414
-
- Use `codeql:<rule_id>` as the `cveId` (e.g., `codeql:js/sql-injection`).
425
+
- Use the `id` field as `cveId` (already prefixed with `codeql:`).
415
426
- Set `source` to `"codeql"`.
416
427
- Include the file location (path and line numbers) and rule description in the `description`.
0 commit comments