Skip to content

feat(zap): Phase 3 ZAP DAST integration & reliability hardening - #7

Open
huangji6693-max wants to merge 1 commit into
BreachDirect:mainfrom
huangji6693-max:feat/phase3-zap-dast-reliability-2
Open

huangji6693-max wants to merge 1 commit into
BreachDirect:mainfrom
huangji6693-max:feat/phase3-zap-dast-reliability-2

Conversation

@huangji6693-max

@huangji6693-max huangji6693-max commented Oct 27, 2026 •

Copy link
Copy Markdown

Summary

Implements Phase 3 ZAP DAST integration and reliability hardening:

  • Spider & AJAX Spider Timeout Hardening (app/services/zap_client.py): Added configurable timeouts (scan_spider_timeout, scan_ajax_spider_timeout, scan_passive_timeout, scan_active_timeout) and graceful /action/stop/ termination when spider, AJAX spider, or active scan reaches its timeout budget.
  • Passive Scan Wait Optimisation (app/services/zap_client.py): Added adaptive polling and completion percentage callbacks (Passive scan: N records remaining (X%)) based on initial vs remaining record counts.
  • Active Scan Policy Profiles (app/services/zap_client.py, app/config.py): Added quick, standard, and deep policy profiles (ZAP_SCAN_POLICY_PROFILES & ZAPClient.get_policy_config).
  • Readiness & DEPENDENCY_UNAVAILABLE Contract (app/main.py, app/errors.py): Updated /ready to verify ZAP connectivity when SCANNER_MODE=zap, returning 503 with a structured DEPENDENCY_UNAVAILABLE error envelope when ZAP is down.
  • Graceful Orchestrator Fallback (app/services/scan_orchestrator.py): Added explicit warning logs when falling back to builtin mode if ZAP is unreachable or interrupted.
  • Tests & Runbook (tests/test_zap_phase3.py, README.md, docs/architecture.md): Added mocked ZAP API integration tests, timeout stop tests, DEPENDENCY_UNAVAILABLE contract tests, and docker compose ps runbook documentation.

Verification

  • pytest tests/ -v: 16 passed
  • ruff check app tests: All checks passed
  • bandit -r app -c bandit.yaml -ll -q: Clean

Closes #2


Payout Wallets

  • Stellar (XLM / USDC): GBYWLISGOUWQ43VQEGXX6KRGDZ3CKAFFK3JXVLXKDO5TIFJUJ3OHJYOZ
  • EVM / Base USDC: 0x380C97bcbcAEf29DAc2d0ba7E180F1b4A7F38fdd
  • Solana (USDC / SOL): AyXYaA9Nf4z5fpLKY6DmubWe6D2qveMd79w8pEDNHcDw

…iness checks

- Add ZAP active scan policy profiles (quick/standard/deep) and graceful stop-on-timeout hardening for spider, AJAX spider, and active scan in app/services/zap_client.py
- Optimize passive scan wait with percentage progress callbacks and adaptive polling
- Extend /ready in app/main.py to check ZAP connectivity when SCANNER_MODE=zap and return 503 DEPENDENCY_UNAVAILABLE when unreachable
- Log explicit fallback to builtin scanner in ScanOrchestrator when ZAP is unreachable or interrupted
- Add mocked ZAP API integration tests and DEPENDENCY_UNAVAILABLE contract test in tests/test_zap_phase3.py

Closes BreachDirect#2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Phase 3: ZAP DAST Integration & Reliability

1 participant