OWASP ZAP DAST··6 min read

Running OWASP ZAP API DAST safely with -S passive mode and -O overrides

OpenAPI files frequently point to production server URLs by default. Learn how -S and -O keep automated ZAP API scans strictly inside staging.

Key takeaway

Always inspect spec server fields first, override hostnames with -O staging URLs, and start with -S safe mode before any active rules.

Two flags that prevent accidental production scans

Unlike baseline web scans, OWASP ZAP API scan scripts run API-Minimal active payloads unless you explicitly pass -S for safe mode. Combined with production URLs inside openapi.yaml servers entries, an unguarded run can send test mutations at live customers.

Safe-mode OpenAPI scan against staging
zap-api-scan.py -t /zap/wrk/openapi.yaml -f openapi \
  -O https://staging.example.com -S -J zap-api-safe.json -I