Files
tpotce/installer/data/upstart/suricata.conf

37 lines
1.2 KiB
Plaintext
Raw Normal View History

2015-01-27 17:46:52 +01:00
########################################################
2015-12-08 15:47:39 +01:00
# T-Pot #
2015-01-27 17:46:52 +01:00
# Suricata upstart script #
# #
2016-02-08 12:21:03 +01:00
# v16.03.2 by mo, DTAG, 2016-02-08 #
2015-01-27 17:46:52 +01:00
########################################################
description "Suricata"
author "mo"
2015-12-11 16:26:41 +01:00
start on started docker and filesystem
2015-01-27 17:46:52 +01: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 22:32:15 +02:00
then docker rm -v $myCID;
2015-01-27 17:46:52 +01:00
fi
2016-02-06 04:13:32 +01:00
# Remove any data from previous container
2016-02-08 12:21:03 +01:00
rm -rf /data/suricata/* || true
2016-02-06 04:13:32 +01:00
mkdir -p /data/suricata/log
chmod 760 -R /data/suricata
chown tpot:tpot -R /data/suricata
2015-01-27 17:46:52 +01: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 16:26:41 +01: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 17:46:52 +01:00
end script
post-start script
sleep $(((RANDOM % 5)+5))
end script