2020-02-25 16:59:22 +00:00
|
|
|
FROM alpine:latest
|
2019-06-04 14:21:35 +00:00
|
|
|
#
|
2019-05-31 17:52:39 +00:00
|
|
|
# Include dist
|
|
|
|
#ADD dist/ /root/dist/
|
2019-06-04 14:21:35 +00:00
|
|
|
#
|
2019-05-31 17:52:39 +00:00
|
|
|
# Get and install dependencies & packages
|
2019-12-27 20:52:23 +00:00
|
|
|
RUN sed -i 's/dl-cdn/dl-2/g' /etc/apk/repositories && \
|
|
|
|
apk -U add \
|
2019-05-31 17:52:39 +00:00
|
|
|
git \
|
|
|
|
py3-libxml2 \
|
|
|
|
py3-lxml \
|
2020-06-25 16:14:37 +00:00
|
|
|
py3-pip \
|
2019-05-31 17:52:39 +00:00
|
|
|
python3 \
|
|
|
|
python3-dev && \
|
|
|
|
apk -U add tshark --repository http://dl-3.alpinelinux.org/alpine/edge/community/ && \
|
2019-06-04 14:21:35 +00:00
|
|
|
#
|
2019-05-31 17:52:39 +00:00
|
|
|
# Setup user
|
|
|
|
addgroup -g 2000 fatt && \
|
|
|
|
adduser -S -s /bin/ash -u 2000 -D -g 2000 fatt && \
|
2019-06-04 14:21:35 +00:00
|
|
|
#
|
2019-05-31 17:52:39 +00:00
|
|
|
# Install fatt
|
2019-06-01 17:47:14 +00:00
|
|
|
mkdir -p /opt && \
|
|
|
|
cd /opt && \
|
2019-05-31 17:52:39 +00:00
|
|
|
git clone --depth=1 https://github.com/0x4D31/fatt && \
|
|
|
|
cd fatt && \
|
2019-06-01 17:47:14 +00:00
|
|
|
mkdir -p log && \
|
2019-05-31 17:52:39 +00:00
|
|
|
pip3 install pyshark==0.4.2.2 && \
|
2019-06-04 14:21:35 +00:00
|
|
|
#
|
2019-05-31 17:52:39 +00:00
|
|
|
# Setup configs
|
2019-06-01 17:47:14 +00:00
|
|
|
chown fatt:fatt -R /opt/fatt/* && \
|
2019-06-04 14:21:35 +00:00
|
|
|
#
|
2019-05-31 17:52:39 +00:00
|
|
|
# Clean up
|
|
|
|
apk del --purge git \
|
|
|
|
python3-dev && \
|
|
|
|
rm -rf /root/* && \
|
|
|
|
rm -rf /var/cache/apk/*
|
2019-06-04 14:21:35 +00:00
|
|
|
#
|
2019-05-31 17:52:39 +00:00
|
|
|
# Start fatt
|
|
|
|
STOPSIGNAL SIGINT
|
2019-06-01 17:47:14 +00:00
|
|
|
ENV PYTHONPATH /opt/fatt
|
|
|
|
WORKDIR /opt/fatt
|
2019-05-31 17:52:39 +00:00
|
|
|
CMD python3 fatt.py -i $(/sbin/ip address | grep '^2: ' | awk '{ print $2 }' | tr -d [:punct:]) --print_output --json_logging -o log/fatt.log
|