Inspection / maintenance concern for Mzap::Client: discovery of active-scan
policies (so the --policy flag is usable) and Sites Tree export/prune for
ZAP 2.16+ differential/incremental scanning in CI.
Constants
ACCESS_API = "/
JSON/core/action/access
Url/"
AJAX_SPIDER_API = "/
JSON/ajax
Spider/action/scan/"
AJAX_SPIDER_STOP = "/
JSON/ajax
Spider/action/stop/"
AJAX_STATUS = "/
JSON/ajax
Spider/view/status/"
ALERTS_SUMMARY_API = "/
JSON/alert/view/alerts
Summary/"
ASCAN_API = "/
JSON/ascan/action/scan/"
ASCAN_SCANNERS_API = "/
JSON/ascan/view/scanners/"
ASCAN_STATUS = "/
JSON/ascan/view/status/"
ASCAN_STOP = "/
JSON/ascan/action/stop
AllScans/"
CLIENT_SPIDER_API = "/
JSON/client
Spider/action/scan/"
CLIENT_SPIDER_STAT = "/
JSON/client
Spider/view/status/"
CLIENT_SPIDER_STOP = "/
JSON/client
Spider/action/stop/"
ERROR_STATUSES = {"error", "failed", "failure", "aborted"}
EXPORT_SITES_TREE_API = "/
JSON/exim/action/export
SitesTree/"
GRAPHQL_IMPORT_FILE_API = "/
JSON/graphql/action/import
File/"
GRAPHQL_IMPORT_URL_API = "/
JSON/graphql/action/import
Url/"
HTML_REPORT_API = "/OTHER/core/other/htmlreport/"
OPENAPI_IMPORT_FILE_API = "/
JSON/openapi/action/import
File/"
OPENAPI_IMPORT_URL_API = "/
JSON/openapi/action/import
Url/"
PDF_REPORT_API = "/OTHER/core/other/pdfreport/"
POSTMAN_IMPORT_FILE_API = "/
JSON/postman/action/import
File/"
POSTMAN_IMPORT_URL_API = "/
JSON/postman/action/import
Url/"
PRUNE_SITES_TREE_API = "/
JSON/exim/action/prune
SitesTree/"
PSCAN_RECORDS_TO_SCAN = "/
JSON/pscan/view/records
ToScan/"
REPORT_GENERATE_API = "/
JSON/reports/action/generate/"
REPORT_TITLE = "mzap report"
RISK_LEVELS = {"informational" => 0, "low" => 1, "medium" => 2, "high" => 3}
RUNNING_STATUSES = {"running", "inprogress", "in_progress", "started", "busy"}
SCAN_POLICY_NAMES_API = "/
JSON/ascan/view/scan
PolicyNames/"
SOAP_IMPORT_FILE_API = "/
JSON/soap/action/import
File/"
SOAP_IMPORT_URL_API = "/
JSON/soap/action/import
Url/"
SPIDER_API = "/
JSON/spider/action/scan/"
SPIDER_STATUS = "/
JSON/spider/view/status/"
SPIDER_STOP = "/
JSON/spider/action/stop
AllScans/"
TEMPLATE_HTML = "traditional-html"
TEMPLATE_JSON = "traditional-json"
TEMPLATE_MD = "traditional-md"
TEMPLATE_PDF = "traditional-pdf"
Instance methods
active_scan(urls :
String, *, apis :
String, options :
Options, reporter :
Reporter =
Reporter.new) :
Bool Sourceajax_spider(urls :
String, *, apis :
String, options :
Options, reporter :
Reporter =
Reporter.new) :
Bool Sourceclient_spider(urls :
String, *, apis :
String, options :
Options, reporter :
Reporter =
Reporter.new) :
Bool Client Spider is the modern, browser-based crawler introduced in ZAP 2.16
(the "client" add-on). Requires ZAP >= 2.16 with the Client Side Integration
add-on installed; otherwise the scan dispatch surfaces a clear API error.
Sourceexport_sites_tree(apis :
String, *, file_path :
String, options :
Options, reporter :
Reporter =
Reporter.new) :
Nil Exports each host's Sites Tree to a file. NOTE: the path is resolved by the
ZAP daemon (not mzap), so on remote/Docker ZAP the file lands on the ZAP host.
Sourcelist_policies(apis :
String, *, policy :
String = "", options :
Options, reporter :
Reporter =
Reporter.new) :
Nil Lists active-scan policy names per host. When policy is given, reports the
scanner counts for that policy instead, so users can tune it.
Sourcepassive_scan(apis :
String, *, options :
Options, reporter :
Reporter =
Reporter.new) :
Bool Sourceprune_sites_tree(apis :
String, *, file_path :
String, options :
Options, reporter :
Reporter =
Reporter.new) :
Nil Prunes each host's Sites Tree using a previously exported file (daemon-side
path, see export_sites_tree).
Sourcestop_active_scan(apis :
String, *, options :
Options, reporter :
Reporter =
Reporter.new) :
Nil Sourcestop_ajax_spider(apis :
String, *, options :
Options, reporter :
Reporter =
Reporter.new) :
Nil Sourcestop_client_spider(apis :
String, *, options :
Options, reporter :
Reporter =
Reporter.new) :
Nil Sourcestop_spider(apis :
String, *, options :
Options, reporter :
Reporter =
Reporter.new) :
Nil Source