tpotce/docker/honeypots/Dockerfile

64 lines
1.6 KiB
Text
Raw Normal View History

2022-01-19 00:46:04 +00:00
FROM alpine:3.15
2021-11-18 19:55:44 +00:00
#
# Include dist
2022-03-08 23:36:03 +00:00
COPY dist/ /root/dist/
2021-11-18 19:55:44 +00:00
#
# Install packages
2022-03-08 23:36:03 +00:00
RUN apk -U --no-cache add \
2021-11-18 19:55:44 +00:00
build-base \
freetds \
freetds-dev \
gcc \
git \
hiredis \
jpeg-dev \
libcap \
libffi-dev \
libpq \
musl-dev \
openssl \
openssl-dev \
postgresql-dev \
py3-pip \
python3 \
python3-dev \
zlib-dev && \
#
# Install honeypots from GitHub and setup
mkdir -p /opt \
/var/log/honeypots && \
cd /opt/ && \
git clone https://github.com/qeeqbox/honeypots && \
2021-11-18 19:55:44 +00:00
cd honeypots && \
git checkout bee3147cf81837ba7639f1e27fe34d717ecccf29 && \
2021-11-18 19:55:44 +00:00
pip3 install --upgrade pip && \
2022-01-11 15:43:45 +00:00
pip3 install --ignore-installed hiredis packaging && \
2021-11-18 19:55:44 +00:00
pip3 install . && \
setcap cap_net_bind_service=+ep /usr/bin/python3.9 && \
#
# Setup user, groups and configs
addgroup -g 2000 honeypots && \
adduser -S -H -s /bin/ash -u 2000 -D -g 2000 honeypots && \
chown honeypots:honeypots -R /opt/honeypots && \
chown honeypots:honeypots -R /var/log/honeypots && \
mv /root/dist/config.json /opt/honeypots/ && \
#
# Clean up
apk del --purge build-base \
freetds-dev \
git \
jpeg-dev \
libffi-dev \
openssl-dev \
postgresql-dev \
python3-dev \
zlib-dev && \
2022-03-08 23:36:03 +00:00
rm -rf /root/* /var/cache/apk/* /opt/honeypots/.git
2021-11-18 19:55:44 +00:00
#
# Start honeypots
STOPSIGNAL SIGINT
USER honeypots:honeypots
WORKDIR /opt/honeypots/
CMD python3 -E -m honeypots --setup all --config config.json