Installation
Add to shard.yml
Add zap as a dependency in your shard.yml:
dependencies:
zap:
github: hahwul/zap.cr
Then run:
shards install
Require in Your Code
require "zap"
ZAP Setup
zap.cr connects to a running ZAP instance via its REST API. You can start ZAP in several ways:
Docker (Recommended)
docker run -u zap -p 8080:8080 \
ghcr.io/zaproxy/zaproxy:stable \
zap.sh -daemon -host 0.0.0.0 -port 8080 \
-config api.key=your-api-key \
-config api.addrs.addr.name=.* \
-config api.addrs.addr.regex=true
Desktop
- Download ZAP from zaproxy.org
- Launch ZAP
- Go to Tools > Options > API
- Note the API key
Headless
zap.sh -daemon -port 8080 -config api.key=your-api-key
Next Steps
Proceed to the Quick Start guide.