tpotce/installer/data/upstart/suricata.conf

37 lines
1.2 KiB
Text
Raw Normal View History

2015-01-27 16:46:52 +00:00
########################################################
2015-12-08 14:47:39 +00:00
# T-Pot #
2015-01-27 16:46:52 +00:00
# Suricata upstart script #
# #
2016-02-08 11:21:03 +00:00
# v16.03.2 by mo, DTAG, 2016-02-08 #
2015-01-27 16:46:52 +00:00
########################################################
description "Suricata"
author "mo"
2015-12-11 15:26:41 +00:00
start on started docker and filesystem
2015-01-27 16:46:52 +00:00
stop on runlevel [!2345]
respawn
pre-start script
# Remove any existing suricata containers
myCID=$(docker ps -a | grep suricata | awk '{ print $1 }')
if [ "$myCID" != "" ];
2015-08-07 20:32:15 +00:00
then docker rm -v $myCID;
2015-01-27 16:46:52 +00:00
fi
2016-02-06 03:13:32 +00:00
# Remove any data from previous container
2016-02-08 11:21:03 +00:00
rm -rf /data/suricata/* || true
2016-02-06 03:13:32 +00:00
mkdir -p /data/suricata/log
chmod 760 -R /data/suricata
chown tpot:tpot -R /data/suricata
2015-01-27 16:46:52 +00:00
myIF=$(route | grep default | awk '{ print $8 }')
/sbin/ethtool --offload $myIF rx off tx off
/sbin/ethtool -K $myIF gso off gro off
/sbin/ip link set $myIF promisc on
end script
script
# Delayed start to avoid rapid respawning
sleep 2
2015-12-11 15:26:41 +00:00
/usr/bin/docker run --name suricata --cap-add=NET_ADMIN --net=host --rm=true -v /data/suricata:/data/suricata dtagdevsec/suricata:latest1603
2015-01-27 16:46:52 +00:00
end script
post-start script
sleep $(((RANDOM % 5)+5))
end script