tpotce/docker/suricata/Dockerfile

41 lines
1.1 KiB
Text
Raw Normal View History

2022-03-08 17:29:03 +00:00
FROM alpine:edge
2019-06-07 13:00:20 +00:00
#
# Include dist
2022-03-08 17:29:03 +00:00
COPY dist/ /root/dist/
2019-06-07 13:00:20 +00:00
#
# Install packages
RUN apk --no-cache -U upgrade && \
apk --no-cache -U add \
ca-certificates \
curl \
file \
hiredis \
libcap \
wget \
suricata && \
2019-06-07 13:00:20 +00:00
#
# Setup user, groups and configs
addgroup -g 2000 suri && \
adduser -S -H -u 2000 -D -g 2000 suri && \
cp /root/dist/*.yaml /etc/suricata/ && \
cp /root/dist/*.conf /etc/suricata/ && \
cp /root/dist/*.bpf /etc/suricata/ && \
cp /root/dist/update.sh /usr/bin/ && \
2022-03-08 17:29:03 +00:00
chmod 644 /etc/suricata/*.config && \
chmod 755 -R /var/lib/suricata && \
chmod 755 /usr/bin/update.sh && \
2022-03-08 17:29:03 +00:00
chown -R root:suri /tmp /run && \
#
# Download the latest EmergingThreats OPEN ruleset
suricata-update update-sources && \
2022-03-08 17:29:03 +00:00
suricata-update --no-test --no-reload && \
2019-06-07 13:00:20 +00:00
#
# Clean up
2024-09-11 10:42:17 +00:00
rm -rf /root/* \
/tmp/* \
/var/cache/apk/*
2019-06-07 13:00:20 +00:00
#
# Start suricata
2018-09-11 12:19:26 +00:00
STOPSIGNAL SIGINT
CMD SURICATA_CAPTURE_FILTER=$(update.sh $OINKCODE) && exec suricata -v -F $SURICATA_CAPTURE_FILTER -i $(ip route | grep "^default" | awk '{ print $5 }')