DAST: ZAP baseline/active scan as a deterministic detector under the agentic layer #235

Open
opened 2026-08-31 13:14:01 +00:00 by sharang · 0 comments
Owner

Why

Spec v0.2.1 (§4.1 row 5, R-D2): the in-house compliance-dast crate re-implements spidering and active checks that OWASP ZAP already does deterministically and with broader rule coverage. Keep the LLM agents on top (context-seeded exploitation, chaining, explanation) and put ZAP underneath for reproducible coverage — good for control evidence (deterministic detector → control-map LUT → grounded judge) and for the nightly regression (#188). Follows the Nuclei integration; same architecture.

Documented as a decided integration in docs/reference/tools.md (Planned integrations) and docs/features/control-mapping.md; this issue is the source-code half.

Scope

  1. Runner: zaproxy/zap-stable container as a Werkbank job (zap-baseline.py first, zap-full-scan.py behind the existing "destructive tests" flag). Never against production — only the target's declared LiveUrl / provisioned twin.
  2. Auth: map WebArtifactConfig auth (basic / bearer / cookie / form) to ZAP context/auth scripts; honour excluded paths and rate limit.
  3. Parser: ZAP JSON (or SARIF) report → Finding (rule_id = plugin id, cwe from cweid, evidence = URL + param + evidence string, severity from risk). Dedup with nuclei/agentic findings via existing fingerprinting (same URL + CWE + param).
  4. Control mapping: ZAP plugin-id/CWE rows in control-map/data/cra_control_map.json.
  5. Agentic layer: feed ZAP alerts into the DAST/pentest prompt as seed context; the agent verifies/exploits rather than rediscovers.
  6. Docs: promote ZAP from "Planned integrations" to the live tool list; update docs/features/dast.md and the control-mapping detector list.

Acceptance

  • Juice Shop demo target: ZAP baseline findings stored with CWE + control_refs; agent run shows them as seed context.
  • Authenticated (form) scan works against a demo target.
  • Reproducible: two consecutive baseline runs on an unchanged target produce the same finding set (basis for #188 golden baseline).
  • Deterministic detectors (semgrep, gitleaks, syft/osv, nuclei, ZAP, PLC linter) all listed in docs/features/control-mapping.md.

Depends on: Nuclei detector issue (shared runner + parser + LUT plumbing). Relates: #186, #188, werkbank#1. Spec: R-D2.

## Why Spec v0.2.1 (§4.1 row 5, R-D2): the in-house `compliance-dast` crate re-implements spidering and active checks that OWASP ZAP already does deterministically and with broader rule coverage. Keep the LLM agents on top (context-seeded exploitation, chaining, explanation) and put ZAP underneath for reproducible coverage — good for control evidence (deterministic detector → `control-map` LUT → grounded judge) and for the nightly regression (#188). Follows the Nuclei integration; same architecture. Documented as a decided integration in `docs/reference/tools.md` (Planned integrations) and `docs/features/control-mapping.md`; this issue is the source-code half. ## Scope 1. **Runner**: `zaproxy/zap-stable` container as a Werkbank job (`zap-baseline.py` first, `zap-full-scan.py` behind the existing "destructive tests" flag). Never against production — only the target's declared `LiveUrl` / provisioned twin. 2. **Auth**: map `WebArtifactConfig` auth (basic / bearer / cookie / form) to ZAP context/auth scripts; honour excluded paths and rate limit. 3. **Parser**: ZAP JSON (or SARIF) report → `Finding` (rule_id = plugin id, `cwe` from `cweid`, evidence = URL + param + evidence string, severity from risk). Dedup with nuclei/agentic findings via existing fingerprinting (same URL + CWE + param). 4. **Control mapping**: ZAP plugin-id/CWE rows in `control-map/data/cra_control_map.json`. 5. **Agentic layer**: feed ZAP alerts into the DAST/pentest prompt as seed context; the agent verifies/exploits rather than rediscovers. 6. **Docs**: promote ZAP from "Planned integrations" to the live tool list; update `docs/features/dast.md` and the control-mapping detector list. ## Acceptance - [ ] Juice Shop demo target: ZAP baseline findings stored with CWE + control_refs; agent run shows them as seed context. - [ ] Authenticated (form) scan works against a demo target. - [ ] Reproducible: two consecutive baseline runs on an unchanged target produce the same finding set (basis for #188 golden baseline). - [ ] Deterministic detectors (semgrep, gitleaks, syft/osv, nuclei, ZAP, PLC linter) all listed in `docs/features/control-mapping.md`. Depends on: Nuclei detector issue (shared runner + parser + LUT plumbing). Relates: #186, #188, werkbank#1. Spec: R-D2.
sharang added the enhancement label 2026-08-31 13:14:01 +00:00
sharang added this to the R1 · Dynamic & OT depth milestone 2026-09-20 20:23:37 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: platform/pruefwerk#235