GitHub
ESC

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 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

  1. Download ZAP from zaproxy.org
  2. Launch ZAP
  3. Go to Tools > Options > API
  4. Note the API key

Headless

zap.sh -daemon -port 8080 -config api.key=your-api-key

Next Steps

Proceed to the Quick Start guide.