I believe the ajaxspider isn't properly crawling the modern site I'm trying to scan. I've tried a few things to troubleshoot like adding all the URLs to the automation job and changing the include paths. I'm brand new to zap, so feel free to respond like I'm 6. The command is being executed from a shell script on a linux vm but I see similar issue from the desktop client.
Job output log failing with <100./run_zap.sh
Starting ZAP Automation Plan...
Job spider/stats/null set name = Traditional Spider
Job spider/stats/null set type = stats
Job spider/stats/null set onFail = Info
Job spider/stats/null set statistic = automation.spider.urls.added
Job spider/stats/null set operator = >=
Job spider/stats/null set value = 100
Job spider adding test of type stats : Traditional Spider
Job spiderAjax set maxDuration = 5
Job spiderAjax set numberOfBrowsers = 2
Job spiderAjax set clickDefaultElems = true
Job spiderAjax set maxCrawlStates = 1,000
Job spiderAjax/stats/null set name = AJAX Spider
Job spiderAjax/stats/null set type = stats
Job spiderAjax/stats/null set onFail = Info
Job spiderAjax/stats/null set statistic = spiderAjax.urls.added
Job spiderAjax/stats/null set operator = >=
Job spiderAjax/stats/null set value = 100
Job spiderAjax adding test of type stats : AJAX Spider
Job report set template = traditional-pdf
Job report set reportDir = /opt/zap/ZAP_2.16.1/reports
Job report set reportTitle = Test Env Scan Report
Job passiveScan-config started
Job passiveScan-config finished, time taken: 00:00:00
Job spider started
Job spider requesting URL
https://test-login.acme.comJob spider requesting URL
https://test-conn.acme.comJob spider requesting URL
https://test-buy.acme.comJob spider requesting URL
https://test-link.acme.comJob spider requesting URL
https://test-ins.acme.comJob spider requesting URL
https://test-ask.acme.comJob spider requesting URL
https://test-admin.acme.comJob spider found 100 URLs
Job spider test of type stats passed: Traditional Spider [100 >= 100]
Job spider finished, time taken: 00:00:08
Job spiderAjax started
Job spiderAjax found 20 URLs
Job spiderAjax test of type stats failed: AJAX Spider [20 < 100]
Job spiderAjax finished, time taken: 00:00:49
Job passiveScan-wait started
Job passiveScan-wait finished, time taken: 00:01:17
Job report started
Job report generated report /opt/zap/ZAP_2.16.1/reports/2025-11-03-ZAP-Report-test-login.acme.com.pdf
Job report finished, time taken: 00:00:12
Automation plan succeeded!
my yaml:env:
contexts:
- name: test environment
urls:
-
https://test-login.acme.com -
https://test-conn.acme.com -
https://test-buy.acme.com -
https://test-link.acme.com -
https://test-inst.acme.com -
https://test-ask.acme.com -
https://test-admin.acme.com includePaths:
-
https://test-.*\.acme.com.*
authentication:
method: browser
parameters:
loginPageUrl:
https://test-login.acme.com/ loginPageWait: 10
browserId: firefox-headless
stepDelay: 0
diagnostics: false
steps: []
verification:
method: autodetect
loggedInRegex: \Q 200 OK\E
loggedOutRegex: \Q 401 Unauthorized\E
pollFrequency: 60
pollUnits: requests
pollUrl:
https://test-login.acme.com/apps/true pollPostData: ""
pollAdditionalHeaders:
- header: content-type
value: application/json
sessionManagement:
method: headers
parameters:
Authorization: "Bearer {%header:authorization%}"
technology: {}
structure: {}
users:
- name:
te...@yopmail.com credentials:
password: 'redacted'
username:
te...@yopmail.com parameters: {}
jobs:
- type: passiveScan-config
parameters: {}
- type: spider
parameters: {}
tests:
- name: Traditional Spider
type: stats
onFail: INFO
statistic: automation.spider.urls.added
operator: '>='
value: 100
- type: spiderAjax
parameters:
maxDuration: 5
numberOfBrowsers: 2
clickDefaultElems: true
maxCrawlStates: 1000
tests:
- name: AJAX Spider
type: stats
onFail: INFO
statistic: spiderAjax.urls.added
operator: '>='
value: 100
- type: passiveScan-wait
parameters: {}
- type: report
parameters:
template: traditional-pdf
reportDir: /opt/zap/ZAP_2.16.1/reports
# reportFile: "{{env ZAP_REPORT_FILENAME}}" (set via shell script using -config)
reportTitle: Test Env Scan Report