tpotce/docker/ciscoasa/Dockerfile

49 lines
1.4 KiB
Text
Raw Normal View History

FROM alpine:3.19
2019-08-28 13:59:41 +00:00
#
# Include dist
2022-03-05 00:50:47 +00:00
COPY dist/ /root/dist/
2019-08-28 13:59:41 +00:00
#
2018-02-20 17:40:34 +00:00
# Setup env and apt
2022-03-05 00:50:47 +00:00
RUN apk --no-cache -U upgrade && \
apk --no-cache add build-base \
2018-03-25 18:35:32 +00:00
git \
2018-05-09 14:29:06 +00:00
libffi \
2018-03-25 18:35:32 +00:00
libffi-dev \
2018-05-09 14:29:06 +00:00
openssl \
2018-03-25 18:35:32 +00:00
openssl-dev \
2021-02-15 10:01:03 +00:00
py3-cryptography \
py3-pip \
2018-05-09 14:29:06 +00:00
python3 \
2018-05-04 16:29:55 +00:00
python3-dev && \
2019-08-28 13:59:41 +00:00
#
2018-02-20 17:40:34 +00:00
# Setup user
addgroup -g 2000 ciscoasa && \
adduser -S -s /bin/bash -u 2000 -D -g 2000 ciscoasa && \
2019-08-28 13:59:41 +00:00
#
2018-02-20 17:40:34 +00:00
# Get and install packages
mkdir -p /opt/ && \
cd /opt/ && \
git clone https://github.com/cymmetria/ciscoasa_honeypot && \
2018-02-20 17:40:34 +00:00
cd ciscoasa_honeypot && \
git checkout d6e91f1aab7fe6fc01fabf2046e76b68dd6dc9e2 && \
2022-03-24 17:54:56 +00:00
sed -i "s/git+git/git+https/g" requirements.txt && \
pip3 install --break-system-packages --no-cache-dir -r requirements.txt && \
cp /root/dist/asa_server.py /opt/ciscoasa_honeypot && \
2018-02-26 17:55:56 +00:00
chown -R ciscoasa:ciscoasa /opt/ciscoasa_honeypot && \
2019-08-28 13:59:41 +00:00
#
2018-02-20 17:40:34 +00:00
# Clean up
2018-03-30 21:47:59 +00:00
apk del --purge build-base \
git \
libffi-dev \
openssl-dev \
python3-dev && \
2018-05-04 16:29:55 +00:00
rm -rf /root/* && \
2022-03-05 00:50:47 +00:00
rm -rf /opt/ciscoasa_honeypot/.git && \
2018-05-04 16:29:55 +00:00
rm -rf /var/cache/apk/*
2019-08-28 13:59:41 +00:00
#
2018-05-04 16:29:55 +00:00
# Start ciscoasa
2018-09-11 12:19:26 +00:00
STOPSIGNAL SIGINT
WORKDIR /tmp/ciscoasa/
2018-03-30 21:47:59 +00:00
USER ciscoasa:ciscoasa
2018-05-09 16:43:37 +00:00
CMD cp -R /opt/ciscoasa_honeypot/* /tmp/ciscoasa && exec python3 asa_server.py --ike-port 5000 --enable_ssl --port 8443 --verbose >> /var/log/ciscoasa/ciscoasa.log 2>&1