tpotce/installer/data/upstart/suricata.conf

40 lines
1.4 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-03-04 20:47:14 +00:00
# v16.03.3 by mo, DTAG, 2016-03-04 #
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-03-04 20:47:14 +00:00
# Remove any data from previous container if persistence is not enabled
if ! [ -f /data/persistence.on ];
then
rm -rf /data/suricata/* || true
mkdir -p /data/suricata/log
chmod 760 -R /data/suricata
chown tpot:tpot -R /data/suricata
fi
# Get IF, disable offloading, enable promiscious mode
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
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
2016-03-04 20:47:14 +00:00
# Delay next start to avoid rapid respawning
sleep 2
end script