Skip to content

Commit

Permalink
Modified Dockerfile to include ZAP
Browse files Browse the repository at this point in the history
Added requirements (should remove if not needed)
Updated port 8000 to 80 for ESS.py
  • Loading branch information
avinash-sudhodanan committed Nov 29, 2017
1 parent fd4b1ae commit 6af76b7
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 9 deletions.
23 changes: 16 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,20 +1,29 @@
# Use an official Python runtime as a parent image
FROM python:2.7.13
#From ZAP's docker image
FROM owasp/zap2docker-stable

# Set the working directory to /app
WORKDIR /app

# Copy the current directory contents into the container at /app
ADD . /app

USER root
# Install any needed packages specified in requirements.txt
RUN pip install -r requirements.txt
RUN pip install flask

# Install any needed packages specified in requirements.txt
RUN pip install flask-httpauth

# Install any needed packages specified in requirements.txt
RUN pip install requests

# Make port 80 available to the world outside this container
EXPOSE 80
EXPOSE 8000

#Run ZAP in daemon mode
RUN chmod +x ./../zap/zap.sh
CMD python ess.py & ./../zap/zap.sh -daemon -host 0.0.0.0 -port 8080 -config api.disablekey=true &&fg

# Define environment variable
ENV NAME World

# Run app.py when the container launches
CMD ["python", "ess.py"]
#CMD ["python", "ess.py"]
2 changes: 1 addition & 1 deletion ess.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import os

target = '0.0.0.0' #indicates in which IP address the API listents to
por = 8000 #indicates the port in
por = 80 #indicates the port in
api_version='r3' #represents the current version of the API
zap=ZAPv2() #call to the OWAZP ZAP python API library (https://github.com/zaproxy/zaproxy/wiki/ApiPython)
app = Flask(__name__, static_url_path = "")
Expand Down
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
flask
flask-httpauth
python-owasp-zap-v2.4
requests

0 comments on commit 6af76b7

Please sign in to comment.