Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add docker compose #429

Open
wants to merge 7 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,6 @@
# JS
node_modules/
dist/

# Docker/Docker Compose
.env
37 changes: 36 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ Learn more:

## Using the HUD

### Downloading
### Usage

#### From Source Code
You can download ZAP enabled with the HUD from any of:

1. Download and run the latest [ZAP Weekly Release](https://github.com/zaproxy/zaproxy/wiki/Downloads#zap-weekly)
Expand All @@ -36,6 +38,39 @@ You'll see the HUD Radar icon ![Radar Icon](https://raw.githubusercontent.com/za

![Toolbar with Radar](https://raw.githubusercontent.com/zaproxy/zap-hud/develop/assets/images/toolbar_radar.png)

#### Docker Compose
Alternatively if you just want to run ZAP with zero setup and the HUD automatically installed and enabled with Docker you can use the included `docker/docker-compose.yml` to start the environment in a Docker container.

```
git clone https://github.com/zaproxy/zap-hud.git
cd zap-hud/docker
cp .env.example .env
```

Create a random API key of your choosing and add it to your `.env` file
```
ZAP_API_KEY=somevalue
```
Start `docker-compose` environment

```
docker-compose up -d
```

#### Docker Stand-Alone
If you'd like to run ZAP in a Docker container without cloning the repo and a `docker-compose` environment, you can run the following `docker` command, swapping out `CHANGE_ME` with your custom API Key value:

```
docker run -u zap -p 9090:9090 --rm -i owasp/zap2docker-weekly zap.sh -daemon -host 0.0.0.0 -port 9090 \
-config api.addrs.addr.name=.* -config api.addrs.addr.regex=true -config -config api.key=CHANGE_ME \
-config hud.enabledForDaemon=true
```

### Docker Usage Considerations
For more detailed instructions on configuring your browser to use CA certificates generated in a ephemeral Docker environment please see the official wiki entry:

[Using the HUD with ZAP in Docker](https://github.com/zaproxy/zap-hud/wiki/Using-the-HUD-with-ZAP-in-Docker)

### Starting the HUD
1. Quick Start: Select either `Firefox` or `Chrome` on the `Quick Start` tab and click on the `Launch Browser` button.

Expand Down
1 change: 1 addition & 0 deletions docker/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ZAP_API_KEY=
19 changes: 19 additions & 0 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
version: '3'
services:
zap-hud:
image: owasp/zap2docker-weekly
ports:
- 9090:9090
user: zap
env_file:
- .env
command: >
sh -c "
zap.sh
-daemon
-host 0.0.0.0
-port 9090
-config api.addrs.addr.name=.*
-config api.addrs.addr.regex=true
-config api.key=${ZAP_API_KEY}
-config hud.enabledForDaemon=true"