feat(dast): every scan runs the header, CSP, cookie and TLS checks (#998) #1009

Merged
sharang merged 2 commits from feat/dast-checks into main 2026-11-16 11:24:06 +00:00
Owner

Part 3 of #998 (point 3). Independent of #1008.

Problem: the security-header, Content-Security-Policy, cookie and TLS checks existed only as tools the LLM pentest could call. A DAST scan of a site without a CSP said nothing about it (#270).

Change:

  • New compliance_dast::checks::run_checks runs the four checks against the target's base URL. It uses the scan's client (with the target's login) and NetGuard. A check that cannot run is logged; the others still run.
  • The DAST scan runs them at the start of its vulnerability analysis and adds their findings to the run. With #1008 they also become findings of the target.
  • CORS stays with the API fuzzer agent, which every scan runs already. Running cors_checker as well would report the same problem twice under another title.
  • DNS/DMARC wait on #318, as the issue says.
  • Docs (features/dast.md): the Check step of a DAST scan.

Tests (compliance-dast/tests/checks.rs, a local fake site):

  • A site without a policy and with a flagless session cookie gets the missing-CSP and cookie findings. On main's scan code this test fails.
  • A site that sends a policy does not get the missing-CSP finding.
  • cargo test -p compliance-dast passes in full (the login tests count requests too), and clippy with CI's flags is clean.

Open, not in this PR: a missing CSP is reported as CWE-16, and the CRA control map binds no control to CWE-16 (or CWE-693). So the missing-CSP finding gets no control ref, and #998's acceptance needs that mapping decided.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Q9inRcu428A2iNjDHPEAT9

Part 3 of #998 (point 3). Independent of #1008. **Problem:** the security-header, Content-Security-Policy, cookie and TLS checks existed only as tools the LLM pentest could call. A DAST scan of a site without a CSP said nothing about it (#270). **Change:** - New `compliance_dast::checks::run_checks` runs the four checks against the target's base URL. It uses the scan's client (with the target's login) and NetGuard. A check that cannot run is logged; the others still run. - The DAST scan runs them at the start of its vulnerability analysis and adds their findings to the run. With #1008 they also become findings of the target. - CORS stays with the API fuzzer agent, which every scan runs already. Running `cors_checker` as well would report the same problem twice under another title. - DNS/DMARC wait on #318, as the issue says. - Docs (`features/dast.md`): the Check step of a DAST scan. **Tests** (`compliance-dast/tests/checks.rs`, a local fake site): - A site without a policy and with a flagless session cookie gets the missing-CSP and cookie findings. On main's scan code this test fails. - A site that sends a policy does not get the missing-CSP finding. - `cargo test -p compliance-dast` passes in full (the login tests count requests too), and clippy with CI's flags is clean. **Open, not in this PR:** a missing CSP is reported as CWE-16, and the CRA control map binds no control to CWE-16 (or CWE-693). So the missing-CSP finding gets no control ref, and #998's acceptance needs that mapping decided. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01Q9inRcu428A2iNjDHPEAT9
sharang added 1 commit 2026-11-16 10:50:12 +00:00
feat(dast): every scan runs the header, CSP, cookie and TLS checks (#998)
CI / Check (push) Skipped
CI / Detect Changes (pull_request) Skipped
CI / Deploy Agent (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 4m23s
CI / Check (pull_request) Canceled after 11m36s
80869b1759
The security-header, Content-Security-Policy, cookie and TLS checks
existed only as tools the LLM pentest could call. A DAST scan of a site
without a CSP therefore said nothing about it.

- New `compliance_dast::checks::run_checks`: the four checks against the
  target's base URL, with the scan's (logged-in) client and NetGuard. A
  check that cannot run is logged; the others still run.
- The scan runs them at the start of its vulnerability analysis and adds
  their findings to the run.
- CORS stays with the API fuzzer agent, which every scan runs already;
  running the CORS tool too would report the same problem twice.
- Docs: the Check step of a DAST scan.

Tests (`compliance-dast/tests/checks.rs`): a site without a policy and
with a flagless session cookie gets the missing-CSP and cookie findings
(fails on main); a site that sends a policy does not get the missing one.

Part 3 of #998 (point 3; DNS/DMARC wait on #318).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q9inRcu428A2iNjDHPEAT9
sharang added 1 commit 2026-11-16 11:01:34 +00:00
Merge branch 'main' into feat/dast-checks
CI / Check (push) Skipped
CI / Detect Changes (pull_request) Skipped
CI / Deploy Agent (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 4m28s
CI / Check (pull_request) Successful in 21m4s
4bb34bb458
sharang merged commit 0ad8bbc3c9 into main 2026-11-16 11:24:06 +00:00
sharang deleted branch feat/dast-checks 2026-11-16 11:24:06 +00:00
Sign in to join this conversation.