DAST is a scan stage whose findings join the Prüfobjekt's findings #998

Closed
opened 2026-11-14 09:47:25 +00:00 by sharang · 1 comment
Owner

Part of the DAST/pentest dogfooding work.

Problem:

  • maybe_trigger_dast starts each DAST scan in a detached tokio::spawn. The scan run never waits for it, and a failure is only a log line.
  • Results go into dast_findings only: not into the main findings, so no control_refs, no Heute, no issue tracker, no evidence pack.
  • run_scan gets Vec::new() as SAST hints.
  • Only five agents run in a scan (SQLi, XSS, auth bypass, SSRF, API fuzzer). The header, CSP, cookie, TLS, CORS, DNS/DMARC and console-log checks exist but only the LLM pentest can call them. A scan of our dashboard therefore says nothing about its missing Content-Security-Policy (#270).
  • The "Exploitation" phase is recorded as completed but does nothing.

Change:

  1. DAST is a real stage of the scan run: awaited, with done/skipped/failed and a reason like the other stages. A failure fails the stage, not the run.
  2. DAST findings become findings of the Prüfobjekt (CWE, fingerprint dedup, control mapping), keeping the DAST evidence.
  3. Run the deterministic checks (headers, CSP, cookies, TLS, CORS, plus DNS/DMARC once #318 lands) in every scan.
  4. Pass the Prüfobjekt's open SAST findings as hints.
  5. Drop the empty Exploitation phase or make it verify findings.

Acceptance: a scan of a web Prüfobjekt with a live URL shows a DAST stage, and its findings (incl. a missing CSP) appear in the findings list with control refs. A DAST error shows as a failed stage in the run.

Part of the DAST/pentest dogfooding work. **Problem:** - `maybe_trigger_dast` starts each DAST scan in a detached `tokio::spawn`. The scan run never waits for it, and a failure is only a log line. - Results go into `dast_findings` only: not into the main findings, so no `control_refs`, no Heute, no issue tracker, no evidence pack. - `run_scan` gets `Vec::new()` as SAST hints. - Only five agents run in a scan (SQLi, XSS, auth bypass, SSRF, API fuzzer). The header, CSP, cookie, TLS, CORS, DNS/DMARC and console-log checks exist but only the LLM pentest can call them. A scan of our dashboard therefore says nothing about its missing Content-Security-Policy (#270). - The "Exploitation" phase is recorded as completed but does nothing. **Change:** 1. DAST is a real stage of the scan run: awaited, with done/skipped/failed and a reason like the other stages. A failure fails the stage, not the run. 2. DAST findings become findings of the Prüfobjekt (CWE, fingerprint dedup, control mapping), keeping the DAST evidence. 3. Run the deterministic checks (headers, CSP, cookies, TLS, CORS, plus DNS/DMARC once #318 lands) in every scan. 4. Pass the Prüfobjekt's open SAST findings as hints. 5. Drop the empty Exploitation phase or make it verify findings. **Acceptance:** a scan of a web Prüfobjekt with a live URL shows a DAST stage, and its findings (incl. a missing CSP) appear in the findings list with control refs. A DAST error shows as a failed stage in the run.
Author
Owner

Done. All parts are merged to main and on stage.

Point PR What changed
1, 5 #1007 DAST is an awaited stage of the scan run, with a 20-minute limit per DAST target. A DAST scan that fails or times out is recorded as the dast stage with tool_failed ("DAST did not complete"); the run itself completes. The empty Exploitation phase is gone.
2 #1008 DAST findings are findings of the target (scanner dast, CWE, fingerprint dedup across scans, control refs from the CWE). The request/response evidence stays with the DAST finding.
3 #1009 Every DAST scan runs the security-header, CSP, cookie and TLS checks. CORS stays with the API fuzzer, which every scan runs.
4 #1010 No DAST agent reads sast_hints, so instead each DAST finding is linked (linked_sast_finding_id) to the target's one open code finding with the same CWE. The pentest report and dashboard already show that link.
– #1011 Control map: a dast binding for CWE-16 / CWE-693 on cra-ai-1, attach_only, so a missing CSP carries a control ref without making the control count as checked.

Acceptance:

  • Integration test against a local site without a CSP: the scan's "Missing Content-Security-Policy header" is a finding of the target with control refs cra-ai-1, on main 246e2c4.
  • A DAST error shows as a failed dast stage in the run (#1007's test).

Not done here: the DNS/DMARC checks wait on #318. 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

**Done.** All parts are merged to main and on stage. | Point | PR | What changed | |---|---|---| | 1, 5 | #1007 | DAST is an awaited stage of the scan run, with a 20-minute limit per DAST target. A DAST scan that fails or times out is recorded as the `dast` stage with `tool_failed` ("DAST did not complete"); the run itself completes. The empty Exploitation phase is gone. | | 2 | #1008 | DAST findings are findings of the target (scanner `dast`, CWE, fingerprint dedup across scans, control refs from the CWE). The request/response evidence stays with the DAST finding. | | 3 | #1009 | Every DAST scan runs the security-header, CSP, cookie and TLS checks. CORS stays with the API fuzzer, which every scan runs. | | 4 | #1010 | No DAST agent reads `sast_hints`, so instead each DAST finding is linked (`linked_sast_finding_id`) to the target's one open code finding with the same CWE. The pentest report and dashboard already show that link. | | – | #1011 | Control map: a `dast` binding for CWE-16 / CWE-693 on `cra-ai-1`, `attach_only`, so a missing CSP carries a control ref without making the control count as checked. | **Acceptance:** - Integration test against a local site without a CSP: the scan's "Missing Content-Security-Policy header" is a finding of the target with control refs `cra-ai-1`, on main `246e2c4`. - A DAST error shows as a failed `dast` stage in the run (#1007's test). **Not done here:** the DNS/DMARC checks wait on #318. 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
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: platform/pruefwerk#998