tpotce/docker/suricata/Dockerfile

38 lines
1.1 KiB
Text
Raw Normal View History

2020-10-28 17:53:23 +00:00
FROM alpine:edge
2019-06-07 13:00:20 +00:00
#
# Include dist
ADD dist/ /root/dist/
2019-06-07 13:00:20 +00:00
#
# Install packages
2020-10-28 17:53:23 +00:00
RUN apk -U --no-cache add \
ca-certificates \
curl \
file \
2020-09-04 12:37:28 +00:00
hiredis \
libcap \
2020-10-28 17:53:23 +00:00
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 && \
chmod 644 /etc/suricata/*.config && \
cp /root/dist/*.yaml /etc/suricata/ && \
cp /root/dist/*.conf /etc/suricata/ && \
cp /root/dist/*.bpf /etc/suricata/ && \
2019-06-07 13:00:20 +00:00
#
# Download the latest EmergingThreats OPEN ruleset
cp /root/dist/update.sh /usr/bin/ && \
chmod 755 /usr/bin/update.sh && \
suricata-update update-sources && \
suricata-update --no-reload && \
2019-06-07 13:00:20 +00:00
#
# Clean up
rm -rf /root/* && \
2019-10-22 15:20:23 +00:00
rm -rf /tmp/* && \
rm -rf /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 $(/sbin/ip address show | /usr/bin/awk '/inet.*brd/{ print $NF; exit }')