2024-03-05 18:50:35 +00:00
|
|
|
FROM alpine:3.19
|
2019-06-04 14:21:35 +00:00
|
|
|
#
|
2019-05-31 17:52:39 +00:00
|
|
|
# Get and install dependencies & packages
|
2022-03-08 23:36:03 +00:00
|
|
|
RUN apk -U --no-cache add \
|
2024-03-05 18:50:35 +00:00
|
|
|
git \
|
|
|
|
libcap \
|
|
|
|
py3-libxml2 \
|
|
|
|
py3-lxml \
|
|
|
|
py3-pip \
|
|
|
|
python3 \
|
|
|
|
python3-dev \
|
|
|
|
tshark && \
|
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 && \
|
2020-09-04 12:37:28 +00:00
|
|
|
git clone https://github.com/0x4D31/fatt && \
|
2019-05-31 17:52:39 +00:00
|
|
|
cd fatt && \
|
2022-10-13 14:06:09 +00:00
|
|
|
git checkout c29e553514281e50781f86932b82337a5ada5640 && \
|
|
|
|
#git checkout 45cabf0b8b59162b99a1732d853efb01614563fe && \
|
2022-03-08 23:36:03 +00:00
|
|
|
#git checkout 314cd1ff7873b5a145a51ec4e85f6107828a2c79 && \
|
2019-06-01 17:47:14 +00:00
|
|
|
mkdir -p log && \
|
2021-09-30 19:39:59 +00:00
|
|
|
# pyshark >= 0.4.3 breaks fatt
|
2024-03-05 18:50:35 +00:00
|
|
|
pip3 install --break-system-packages pyshark==0.4.2.11 && \
|
2019-06-04 14:21:35 +00:00
|
|
|
#
|
2019-05-31 17:52:39 +00:00
|
|
|
# Setup configs
|
2022-03-08 23:36:03 +00:00
|
|
|
chgrp fatt /usr/bin/dumpcap && \
|
|
|
|
setcap cap_net_raw,cap_net_admin=+eip /usr/bin/dumpcap && \
|
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 && \
|
2022-03-08 23:36:03 +00:00
|
|
|
rm -rf /root/* /var/cache/apk/* /opt/fatt/.git
|
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
|
2022-03-08 23:36:03 +00:00
|
|
|
USER fatt:fatt
|
2021-01-06 17:05:09 +00:00
|
|
|
CMD python3 fatt.py -i $(/sbin/ip address show | /usr/bin/awk '/inet.*brd/{ print $NF; exit }') --print_output --json_logging -o log/fatt.log
|