Migrating from APIsec to OWASP ZAP
What middleBrick covers
- Export and remap findings to ZAP alerts
- Rebuild CI/CD scanning with ZAP actions
- Support authenticated scans with tokens
- Configure exclusions and session contexts
- Maintain custom mappings for proprietary checks
- Schedule and tune ongoing scan routines
Purpose and scope of migration
This guide describes how to move from APIsec to OWASP ZAP when changing API security tools. It focuses on data, workflows, and integration points you can control. The guidance is neutral and factual, intended to reduce friction while setting clear expectations about what each platform does.
Migrating does not imply that one tool is superior. Instead, it highlights mapping capabilities, preserving scan cadence, and transferring relevant artifacts so teams can adopt OWASP ZAP without losing visibility.
Scan data and reporting export
Export findings from APIsec in a structured format, then import equivalent data into OWASP ZAP. Typical steps include generating JSON or CSV reports, preserving severity, location, and description fields, and mapping them to ZAP equivalents such as alerts and descriptions.
Use ZAP scripts or the ZAP API to create custom alerts that mirror prior classifications. Example of loading a JSON report and creating alerts programmatically:
import json
from zapv2 import ZAPv2
zap = ZAPv2(apikey='your-api-key', proxies={'http': 'http://localhost:8080', 'https': 'http://localhost:8080'})
with open('findings.json') as f:
data = json.load(f)
for item in data.get('findings', []):
zap.core.create_alert(source='migration', alert=item.get('name'), risk=item.get('severity', 'Medium'), description=item.get('description'), url=item.get('url', ''))Note that precise risk ratings may differ due to different scoring models; treat the first migration as a calibration exercise.
CI/CD and workflow integration
Reconstruct CI wiring by translating pipeline steps from APIsec to OWASP ZAP. If APIsec was invoked via CLI or webhooks, replicate the same triggers using ZAP’s CLI or Docker images. Common patterns include running a quick scan on pull requests and failing builds when high-severity alerts appear.
Example GitHub Action skeleton that runs ZAP in quick scan mode:
name: OWASP ZAP Scan
on: [pull_request]
jobs:
zap:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run ZAP quick scan
uses: zaproxy/[email protected]
with:
target: 'https://api.example.com'
rules_file_name: '.zap/rules.tsv'
fail_action: trueStore ZAP configuration as code, version it, and validate that the same endpoints are covered as before.
Known gaps and limitations
OWASP ZAP operates differently from a purely black-box scanner in certain respects. It can perform active tests such as SQL injection and command injection when configured, which may be outside the previous scope. Decide whether to enable or disable such tests based on environment safety and authorization.
ZAP requires running a proxy or agent to intercept and modify traffic, which introduces operational overhead compared to a fully external scanner. Session management, authentication token handling, and dynamic parameter handling may require additional setup using ZAP scripts or the authentication tab configurations.
Not all data exported from APIsec will have a direct equivalent in ZAP; you may need to maintain custom mappings for proprietary detection categories or adjust dashboards to reflect prior metrics.
Ongoing operations and maintenance
After migration, establish a routine for scanning frequency, alert review, and tuning. Use ZAP’s context and session files to manage authenticated areas and reduce false positives. Schedule regular updates of ZAP and its rule sets to keep detection current.
Configure alert thresholds and notification channels to match prior practices, such as routing high-severity findings to ticketing systems via ZAP’s webhook support. Periodically compare coverage against the previous scan set to confirm that no critical APIs were omitted.
Document exceptions for endpoints that cannot be scanned safely, and maintain an inventory of excluded paths to preserve trust in the program over time.