tpotce/docker/dionaea/Dockerfile

106 lines
2.5 KiB
Text
Raw Normal View History

FROM debian:buster-slim
ENV DEBIAN_FRONTEND noninteractive
2020-01-02 17:37:08 +00:00
#
# Include dist
ADD dist/ /root/dist/
2020-01-02 17:37:08 +00:00
#
# Install dependencies and packages
RUN apt-get update -y && \
2018-05-04 21:31:33 +00:00
apt-get dist-upgrade -y && \
apt-get install -y --no-install-recommends \
build-essential \
ca-certificates \
check \
cmake \
cython3 \
git \
libcap2-bin \
libcurl4-openssl-dev \
libemu-dev \
libev-dev \
libglib2.0-dev \
libloudmouth1-dev \
libnetfilter-queue-dev \
libnl-3-dev \
libpcap-dev \
libssl-dev \
libtool \
libudns-dev \
procps \
python3 \
python3-dev \
python3-boto3 \
python3-bson \
python3-yaml \
fonts-liberation && \
2020-01-02 17:37:08 +00:00
#
# Get and install dionaea
# Latest master is unstable, SIP causes crashing
2021-01-19 10:59:32 +00:00
git clone --depth=1 https://github.com/dinotools/dionaea -b 0.11.0 /root/dionaea/ && \
cd /root/dionaea && \
#git checkout 1426750b9fd09c5bfeae74d506237333cd8505e2 && \
mkdir build && \
cd build && \
cmake -DCMAKE_INSTALL_PREFIX:PATH=/opt/dionaea .. && \
make && \
make install && \
2020-01-02 17:37:08 +00:00
#
# Setup user and groups
addgroup --gid 2000 dionaea && \
adduser --system --no-create-home --shell /bin/bash --uid 2000 --disabled-password --disabled-login --gid 2000 dionaea && \
2018-03-31 15:18:28 +00:00
setcap cap_net_bind_service=+ep /opt/dionaea/bin/dionaea && \
2020-01-02 17:37:08 +00:00
#
# Supply configs and set permissions
chown -R dionaea:dionaea /opt/dionaea/var && \
rm -rf /opt/dionaea/etc/dionaea/* && \
mv /root/dist/etc/* /opt/dionaea/etc/dionaea/ && \
2020-01-02 17:37:08 +00:00
#
# Setup runtime and clean up
apt-get purge -y \
build-essential \
ca-certificates \
check \
cmake \
cython3 \
git \
libcurl4-openssl-dev \
libemu-dev \
libev-dev \
libglib2.0-dev \
libloudmouth1-dev \
libnetfilter-queue-dev \
libnl-3-dev \
libpcap-dev \
libssl-dev \
libtool \
libudns-dev \
python3 \
python3-dev \
python3-boto3 \
python3-bson \
python3-yaml && \
2020-01-02 17:37:08 +00:00
#
apt-get install -y \
ca-certificates \
python3 \
python3-boto3 \
python3-bson \
python3-yaml \
libcurl4 \
libemu2 \
libev4 \
libglib2.0-0 \
libnetfilter-queue1 \
libnl-3-200 \
libpcap0.8 \
libpython3.7 \
libudns0 && \
2020-01-02 17:37:08 +00:00
#
apt-get autoremove --purge -y && \
apt-get clean && \
rm -rf /root/* /var/lib/apt/lists/* /tmp/* /var/tmp/*
2020-01-02 17:37:08 +00:00
#
# Start dionaea
2018-03-31 15:18:28 +00:00
USER dionaea:dionaea
CMD ["/opt/dionaea/bin/dionaea", "-u", "dionaea", "-g", "dionaea", "-c", "/opt/dionaea/etc/dionaea/dionaea.cfg"]