generated from Ostorlab/template_agent
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
48 lines (37 loc) · 1.7 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
#Stage 1.
FROM adoptopenjdk/openjdk13:debianslim as tsunami_builder
## Install dependencies
RUN apt-get update && apt-get install -y --no-install-recommends git ca-certificates
# Clone the plugins repo
WORKDIR /usr/tsunami/repos
RUN git clone --depth 1 "https://github.com/google/tsunami-security-scanner-plugins"
# Build plugins
WORKDIR /usr/tsunami/repos/tsunami-security-scanner-plugins/google
RUN chmod +x build_all.sh && ./build_all.sh
RUN mkdir /usr/tsunami/plugins && cp build/plugins/*.jar /usr/tsunami/plugins
# Compile the Tsunami scanner
RUN git clone --depth 1 "https://github.com/google/tsunami-security-scanner.git" /usr/repos/tsunami-security-scanner
WORKDIR /usr/repos/tsunami-security-scanner
RUN ./gradlew shadowJar \
&& cp $(find "./" -name 'tsunami-main-*-cli.jar') /usr/tsunami/tsunami.jar \
&& cp ./tsunami.yaml /usr/tsunami
FROM ubuntu:22.04
ENV DEBIAN_FRONTEND=noninteractive
# Install dependencies
RUN apt-get update && apt-get install -y software-properties-common \
&& add-apt-repository ppa:deadsnakes/ppa \
&& apt-get remove -y python*
RUN apt update && apt install -y --no-install-recommends nmap ncrack ca-certificates openjdk-11-jre wireguard-tools openresolv iptables iproute2 python3.11 python3.11-dev python3-pip && rm -rf /var/lib/apt/lists/*
COPY --from=tsunami_builder /usr/tsunami /usr/tsunami
RUN mkdir -p /usr/tsunami/logs
RUN mkdir /install
WORKDIR /install
RUN python3.11 -m pip install --upgrade pip
COPY requirement.txt /requirement.txt
RUN python3.11 -m pip install -r /requirement.txt
RUN mkdir -p /app/agent
ENV PYTHONPATH=/app
COPY agent /app/agent
COPY ostorlab.yaml /app/agent/ostorlab.yaml
WORKDIR /app/agent
CMD ["python3.11", "/app/agent/tsunami_agent.py"]