feat(pipeline): DAST findings are findings of the target (#998) #1008

Merged
sharang merged 1 commits from feat/dast-main-findings into main 2026-11-16 11:01:26 +00:00
Owner

Part 2 of #998 (point 2). Builds on #1007.

Problem: a target's DAST scan stored its findings in dast_findings only. They had no control refs and never reached the findings list, the issue tracker or the evidence pack.

Change:

  • New pipeline::dast_findings::as_finding turns a DAST finding into a finding of the target: scanner dast, ScanType::Dast, rule dast-<type>.
    • Fingerprint: the target plus the existing DAST fingerprint (dedup::compute_dast_fingerprint: canonical title, endpoint, method, parameter). A later scan finds the same weakness again instead of adding it twice.
    • CWE: normalised. Control refs come from the CWE, as for imported pentest findings (import::control_refs, now pub(crate)). The control map has no DAST tool bindings.
    • Description: names the endpoint, method and parameter. The request/response evidence stays with the DAST finding (DAST > Findings).
  • The DAST stage stores each new one, as the ICS probe does (skipping known fingerprints), and counts it in the run's new_findings_count.
  • Docs (features/dast.md): where DAST findings show up.

Tests:

  • unit: the mapping (CWE-942 → cra-ai-1), and which findings share a fingerprint.
  • compliance-agent/tests/dast_findings.rs, its own binary because it allows private targets for its process. A target whose live URL allows any CORS origin gets a dast finding with CWE-942 and cra-ai-1, and a second scan adds nothing. On main's pipeline code it fails.
  • Locally against Mongo 7: this test, the e2e DAST tests and clippy with CI's flags.

Not in this PR:

  • A missing CSP maps to CWE-693, which has no control in the CRA map. The acceptance ("a missing CSP with control refs") needs a binding there; that comes with point 3, the deterministic checks.
  • Findings a later scan no longer reports are not resolved yet, the same as for the ICS probe.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Q9inRcu428A2iNjDHPEAT9

Part 2 of #998 (point 2). Builds on #1007. **Problem:** a target's DAST scan stored its findings in `dast_findings` only. They had no control refs and never reached the findings list, the issue tracker or the evidence pack. **Change:** - New `pipeline::dast_findings::as_finding` turns a DAST finding into a finding of the target: scanner `dast`, `ScanType::Dast`, rule `dast-<type>`. - **Fingerprint:** the target plus the existing DAST fingerprint (`dedup::compute_dast_fingerprint`: canonical title, endpoint, method, parameter). A later scan finds the same weakness again instead of adding it twice. - **CWE:** normalised. Control refs come from the CWE, as for imported pentest findings (`import::control_refs`, now `pub(crate)`). The control map has no DAST tool bindings. - **Description:** names the endpoint, method and parameter. The request/response evidence stays with the DAST finding (**DAST > Findings**). - The DAST stage stores each new one, as the ICS probe does (skipping known fingerprints), and counts it in the run's `new_findings_count`. - Docs (`features/dast.md`): where DAST findings show up. **Tests:** - unit: the mapping (CWE-942 → `cra-ai-1`), and which findings share a fingerprint. - `compliance-agent/tests/dast_findings.rs`, its own binary because it allows private targets for its process. A target whose live URL allows any CORS origin gets a `dast` finding with CWE-942 and `cra-ai-1`, and a second scan adds nothing. On main's pipeline code it fails. - Locally against Mongo 7: this test, the `e2e` DAST tests and clippy with CI's flags. **Not in this PR:** - A missing CSP maps to CWE-693, which has no control in the CRA map. The acceptance ("a missing CSP with control refs") needs a binding there; that comes with point 3, the deterministic checks. - Findings a later scan no longer reports are not resolved yet, the same as for the ICS probe. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01Q9inRcu428A2iNjDHPEAT9
sharang added 1 commit 2026-11-16 10:40:04 +00:00
feat(pipeline): DAST findings are findings of the target (#998)
CI / Check (push) Skipped
CI / Detect Changes (pull_request) Skipped
CI / Deploy Dashboard (pull_request) Skipped
CI / Deploy Docs (pull_request) Skipped
CI / Deploy MCP (pull_request) Skipped
CI / Agent integration (pull_request) Successful in 4m45s
CI / Deploy Agent (pull_request) Skipped
CI / Check (pull_request) Successful in 21m4s
535c62ffb7
A target's DAST scan stored its findings in `dast_findings` only, so they
had no control refs and never reached the findings list, the issue
tracker or the evidence pack.

- New `pipeline::dast_findings::as_finding`: a DAST finding as a finding
  of the target (scanner `dast`, `ScanType::Dast`, rule `dast-<type>`).
  - Fingerprint: target + the existing DAST fingerprint (canonical title,
    endpoint, method, parameter), so a later scan finds it again instead
    of adding it twice.
  - CWE normalised; control refs from the CWE, as for imported pentest
    findings (`import::control_refs`, now `pub(crate)`).
  - The endpoint, method and parameter go into the description; the
    request/response evidence stays with the DAST finding.
- The DAST stage stores each new one (as the ICS probe does) and counts
  it in the run's new findings.
- Docs: where DAST findings show up.

Tests:
- unit: the mapping, and which findings share a fingerprint;
- `tests/dast_findings.rs`: a target whose live URL allows any CORS
  origin gets a `dast` CWE-942 finding with `cra-ai-1`, and a second scan
  adds nothing. It fails on main.

Part 2 of #998 (point 2).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q9inRcu428A2iNjDHPEAT9
sharang merged commit cdb84f0967 into main 2026-11-16 11:01:26 +00:00
sharang deleted branch feat/dast-main-findings 2026-11-16 11:01:26 +00:00
Sign in to join this conversation.