Created
April 12, 2018 00:59
-
-
Save jermdw/ec45c08e991b27211f2e38d3df843b3a to your computer and use it in GitHub Desktop.
Suricata Dockerfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM alpine | |
# Include dist | |
ADD dist/ /root/dist/ | |
# Install packages | |
RUN apk -U upgrade && \ | |
apk add bash \ | |
ca-certificates \ | |
file \ | |
libcap \ | |
procps \ | |
wget && \ | |
apk -U add --repository http://dl-cdn.alpinelinux.org/alpine/edge/community \ | |
suricata && \ | |
# Setup user, groups and configs | |
addgroup -g 2000 suri && \ | |
adduser -S -H -u 2000 -D -g 2000 suri && \ | |
mv /root/dist/suricata.yaml /etc/suricata/suricata.yaml && \ | |
mv /root/dist/capture-filter.bpf /etc/suricata/capture-filter.bpf && \ | |
# Download the latest EmergingThreats ruleset, replace rulebase and enable all rules | |
cp /root/dist/update.sh /usr/bin/ && \ | |
chmod 755 /usr/bin/update.sh && \ | |
update.sh OPEN && \ | |
# Clean up | |
rm -rf /root/* && \ | |
rm -rf /var/cache/apk/* | |
# Start suricata | |
CMD update.sh $OINKCODE && suricata -v -F /etc/suricata/capture-filter.bpf -i $(/sbin/ip address | grep '^2: ' | awk '{ print $2 }' | tr -d [:punct:]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment