Skip to content
Merged
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
18 changes: 18 additions & 0 deletions .github/workflows/test-chrome-docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Test Chrome in nightly Docker
on:
workflow_dispatch:
#schedule:
# TODO schedule

jobs:
publish:
name: Build Test Chrome Docker Image
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Build and test the image
run: |
cd docker/chrome
docker build -f Dockerfile --platform linux/amd64 -t zap-chrome .
# The no-sandbox option does appear to be needed
docker run --rm -v "$(pwd)":/zap/wrk/:rw zap-chrome zap.sh -cmd -autorun /zap/wrk/chrome.yaml -config selenium.chromeArgs.arg.argument=--no-sandbox
10 changes: 10 additions & 0 deletions docker/chrome/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM --platform=linux/amd64 zaproxy/zap-nightly:latest

USER root

RUN apt-get update && \
wget -q https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb && \
apt-get install -y ./google-chrome-stable_current_amd64.deb && \
rm -rf /var/lib/apt/lists/*

USER zap
5 changes: 5 additions & 0 deletions docker/chrome/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Chrome Docker Test Files

This directory contains files for testing adding Chrome to a ZAP Dokcer image, as detailed
in the FAQ: https://www.zaproxy.org/faq/how-do-i-use-chrome-with-zap-in-docker/

25 changes: 25 additions & 0 deletions docker/chrome/chrome.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
env:
contexts:
- name: "Chrome Headless Test"
urls:
- "https://demo.owasp-juice.shop"
parameters:
failOnError: true
failOnWarning: true
progressToStdout: true
jobs:
- parameters:
maxDuration: 1
numberOfBrowsers: 1
browserId: "chrome-headless"
tests:
- name: "At least one URL found"
onFail: "WARN"
statistic: "spiderAjax.urls.added"
site: ""
operator: ">="
value: 20
type: "stats"
name: "spiderAjax"
type: "spiderAjax"
Loading