2015-01-27 16:46:52 +00:00
|
|
|
########################################################
|
|
|
|
# T-Pot Community Edition #
|
|
|
|
# Suricata upstart script #
|
|
|
|
# #
|
2015-11-02 11:13:46 +00:00
|
|
|
# v0.53 by mo, DTAG, 2015-11-02 #
|
2015-01-27 16:46:52 +00:00
|
|
|
########################################################
|
|
|
|
|
|
|
|
description "Suricata"
|
|
|
|
author "mo"
|
2015-11-02 11:13:46 +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
|
|
|
|
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
|
2015-08-07 20:32:15 +00:00
|
|
|
sleep $(((RANDOM % 5)+5))
|
|
|
|
/usr/bin/docker run --name suricata --cap-add=NET_ADMIN --net=host --rm=true -v /data/suricata/ dtagdevsec/suricata
|
2015-01-27 16:46:52 +00:00
|
|
|
end script
|
2015-11-02 11:13:46 +00:00
|
|
|
post-start script
|
|
|
|
sleep $(((RANDOM % 5)+5))
|
|
|
|
end script
|