Problem: point 4 asked to pass the target's open SAST findings to the DAST scan as hints. No DAST agent reads its hints (DastContext::sast_hints is only ever filled with empty lists), so that would change nothing. Agreed instead: link each DAST finding to its code finding. The pentest report and the dashboard already show DastFinding::linked_sast_finding_id (file, line, snippet), but nothing set it.
Change:
New pipeline::dast_findings::linked_code_finding returns the one finding of the target with the same CWE (normalised on both sides). With no CWE, or with no finding or several sharing it, there is no link: a CWE alone does not say which of several it is.
The DAST stage loads the target's open findings that have a place in the code and a CWE (statuses open, triaged, needs_review, scanner not dast) once per DAST target, and links each DAST finding before storing it. If they cannot be read, the DAST findings are stored unlinked (logged).
Docs (features/dast.md): when a DAST finding is linked.
Tests:
unit: the one match is linked; no CWE, another CWE, or two candidates give no link.
compliance-agent/tests/dast_findings.rs: with an open CWE-942 code finding seeded, the scan's CORS finding is stored linked to it. Without the linking the test fails.
Locally against Mongo 7: this test, the e2e DAST tests, and clippy with CI's flags.
Part 4 of #998 (point 4).
**Problem:** point 4 asked to pass the target's open SAST findings to the DAST scan as hints. No DAST agent reads its hints (`DastContext::sast_hints` is only ever filled with empty lists), so that would change nothing. Agreed instead: link each DAST finding to its code finding. The pentest report and the dashboard already show `DastFinding::linked_sast_finding_id` (file, line, snippet), but nothing set it.
**Change:**
- New `pipeline::dast_findings::linked_code_finding` returns the one finding of the target with the same CWE (normalised on both sides). With no CWE, or with no finding or several sharing it, there is no link: a CWE alone does not say which of several it is.
- The DAST stage loads the target's open findings that have a place in the code and a CWE (statuses `open`, `triaged`, `needs_review`, scanner not `dast`) once per DAST target, and links each DAST finding before storing it. If they cannot be read, the DAST findings are stored unlinked (logged).
- Docs (`features/dast.md`): when a DAST finding is linked.
**Tests:**
- unit: the one match is linked; no CWE, another CWE, or two candidates give no link.
- `compliance-agent/tests/dast_findings.rs`: with an open CWE-942 code finding seeded, the scan's CORS finding is stored linked to it. Without the linking the test fails.
- Locally against Mongo 7: this test, the `e2e` DAST tests, and clippy with CI's flags.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01Q9inRcu428A2iNjDHPEAT9
#998 point 4 asked to pass the target's open SAST findings to the DAST
scan as hints. No DAST agent reads its hints, so that would change
nothing. `DastFinding::linked_sast_finding_id` is read by the pentest
report and the dashboard (file, line, snippet), but nothing set it.
- New `pipeline::dast_findings::linked_code_finding`: the one finding of
the target with the same CWE. No CWE, none or several with it: no link,
since a CWE alone does not say which of several it is.
- The DAST stage loads the target's open findings with a place in the
code and a CWE (statuses open, triaged, needs_review) once per DAST
target and links each DAST finding before storing it.
- Docs: when a DAST finding is linked.
Tests:
- unit: the one match is linked; no CWE, another CWE or two candidates
give no link.
- `tests/dast_findings.rs`: with an open CWE-942 code finding seeded, the
scan's CORS finding is stored linked to it. It fails without the link.
Part 4 of #998 (point 4, agreed as linking instead of hints).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q9inRcu428A2iNjDHPEAT9
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Part 4 of #998 (point 4).
Problem: point 4 asked to pass the target's open SAST findings to the DAST scan as hints. No DAST agent reads its hints (
DastContext::sast_hintsis only ever filled with empty lists), so that would change nothing. Agreed instead: link each DAST finding to its code finding. The pentest report and the dashboard already showDastFinding::linked_sast_finding_id(file, line, snippet), but nothing set it.Change:
pipeline::dast_findings::linked_code_findingreturns the one finding of the target with the same CWE (normalised on both sides). With no CWE, or with no finding or several sharing it, there is no link: a CWE alone does not say which of several it is.open,triaged,needs_review, scanner notdast) once per DAST target, and links each DAST finding before storing it. If they cannot be read, the DAST findings are stored unlinked (logged).features/dast.md): when a DAST finding is linked.Tests:
compliance-agent/tests/dast_findings.rs: with an open CWE-942 code finding seeded, the scan's CORS finding is stored linked to it. Without the linking the test fails.e2eDAST tests, and clippy with CI's flags.🤖 Generated with Claude Code
https://claude.ai/code/session_01Q9inRcu428A2iNjDHPEAT9