This repository has been archived by the owner on May 13, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 73
/
Copy pathDockerfile
53 lines (40 loc) · 1.99 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# Customized Owasp ZAP Dockerfile with support for authentication
FROM --platform=linux/amd64 softwaresecurityproject/zap-stable
LABEL maintainer="Ernst Noorlander <[email protected]>"
USER root
# Install and update all add-ons
RUN ./zap.sh -cmd -silent -addoninstallall
RUN ./zap.sh -cmd -silent -addonupdate
RUN cp /root/.ZAP/plugin/*.zap plugin/ || :
RUN mkdir /zap/wrk \
&& cd /opt \
&& wget -qO- -O geckodriver.tar.gz https://github.com/mozilla/geckodriver/releases/download/v0.30.0/geckodriver-v0.30.0-linux64.tar.gz \
&& tar -xvzf geckodriver.tar.gz \
&& chmod +x geckodriver \
&& ln -s /opt/geckodriver /usr/bin/geckodriver \
&& export PATH=$PATH:/usr/bin/geckodriver
# Set up the Chrome PPA
RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \
&& echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list
# Update the package list and install chrome
RUN apt-get update -y \
&& apt-get install -y jq \
&& apt-get install -y google-chrome-stable
# Download and install Chromedriver
ENV CHROMEDRIVER_DIR /chromedriver
RUN export LATEST_CHROMEDRIVER_RELEASE=$(curl -s https://googlechromelabs.github.io/chrome-for-testing/last-known-good-versions-with-downloads.json | jq '.channels.Stable') \
&& export LATEST_CHROMEDRIVER_URL=$(echo "$LATEST_CHROMEDRIVER_RELEASE" | jq -r '.downloads.chromedriver[] | select(.platform == "linux64") | .url') \
&& mkdir $CHROMEDRIVER_DIR \
&& wget -N "$LATEST_CHROMEDRIVER_URL" -P $CHROMEDRIVER_DIR \
&& unzip $CHROMEDRIVER_DIR/chromedriver-linux64.zip -d $CHROMEDRIVER_DIR \
&& mv $CHROMEDRIVER_DIR/chromedriver-linux64/* $CHROMEDRIVER_DIR
# Put Chromedriver into the PATH
ENV PATH $CHROMEDRIVER_DIR:$PATH
ADD . /zap/
ADD scripts /home/zap/.ZAP_D/scripts/scripts/active/
RUN chmod 777 /home/zap/.ZAP_D/scripts/scripts/active/ \
&& chown -R zap:zap /zap/
USER zap
RUN pip install -r /zap/requirements.txt
VOLUME /zap/wrk
WORKDIR /zap