-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
52 lines (41 loc) · 1.37 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
## BUILD
FROM maven AS log4jbuild
COPY log4j-exploit /log4j-exploit
WORKDIR /log4j-exploit
RUN set -x \
&& mvn -T 2 -f pom.xml clean compile assembly:single
FROM maven AS jndibuild
COPY jndi-exploit /jndi-exploit
WORKDIR /jndi-exploit
RUN set -x \
&& mvn -T 2 -f pom.xml clean compile assembly:single
########################################################################
FROM openjdk:11
# Defining default non-root user UID, GID, and name
ARG USER_UID="1000"
ARG USER_GID="1000"
ARG USER_NAME="ci"
ENV HOSTNAME="poc-shell"
ENV TZ="Asia/Kolkata"
ENV HOME="/home/$USER_NAME"
# Creating default non-user
RUN set -x \
&& groupadd -g $USER_GID $USER_NAME \
&& useradd -m -g $USER_GID -u $USER_UID $USER_NAME
# Installing basic packages
RUN set -x \
&& apt-get update \
&& apt-get install -y zip unzip curl lsof \
&& rm -rf /var/lib/apt/lists/* \
&& rm -rf /tmp/*
# Switching to non-root user
USER $USER_UID:$USER_GID
COPY assist.sh /apps/assist.sh
COPY --from=log4jbuild \
/log4j-exploit/target/log4j-exploit-1.0-SNAPSHOT-jar-with-dependencies.jar \
/apps/log4j-exploit/target/log4j-exploit-1.0-SNAPSHOT-jar-with-dependencies.jar
COPY --from=jndibuild \
/jndi-exploit/target/jndi-exploit-1.0-SNAPSHOT-jar-with-dependencies.jar \
/apps/jndi-exploit/target/jndi-exploit-1.0-SNAPSHOT-jar-with-dependencies.jar
WORKDIR /apps
CMD ["/bin/bash"]