Repository navigation
feat(zap): Phase 3 ZAP DAST integration & reliability hardening - #7
Open
huangji6693-max wants to merge 1 commit into
Open
huangji6693-max wants to merge 1 commit into
huangji6693-max wants to merge 1 commit into
Conversation
…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
6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements Phase 3 ZAP DAST integration and reliability 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.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.app/services/zap_client.py,app/config.py): Addedquick,standard, anddeeppolicy profiles (ZAP_SCAN_POLICY_PROFILES&ZAPClient.get_policy_config).DEPENDENCY_UNAVAILABLEContract (app/main.py,app/errors.py): Updated/readyto verify ZAP connectivity whenSCANNER_MODE=zap, returning503with a structuredDEPENDENCY_UNAVAILABLEerror envelope when ZAP is down.app/services/scan_orchestrator.py): Added explicit warning logs when falling back tobuiltinmode if ZAP is unreachable or interrupted.tests/test_zap_phase3.py,README.md,docs/architecture.md): Added mocked ZAP API integration tests, timeout stop tests,DEPENDENCY_UNAVAILABLEcontract tests, anddocker compose psrunbook documentation.Verification
pytest tests/ -v: 16 passedruff check app tests: All checks passedbandit -r app -c bandit.yaml -ll -q: CleanCloses #2
Payout Wallets
GBYWLISGOUWQ43VQEGXX6KRGDZ3CKAFFK3JXVLXKDO5TIFJUJ3OHJYOZ0x380C97bcbcAEf29DAc2d0ba7E180F1b4A7F38fddAyXYaA9Nf4z5fpLKY6DmubWe6D2qveMd79w8pEDNHcDw