diff --git a/docker/Dockerfile b/docker/Dockerfile index d79b3a28..43300308 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -64,11 +64,11 @@ ADD conf/settings.js /opt/MozDef/meteor/app/lib/settings.js ADD conf/config.py /opt/MozDef/alerts/lib/config.py ADD conf/sampleData2MozDef.conf /opt/MozDef/examples/demo/sampleData2MozDef.conf ADD conf/mozdef.localloginenabled.css /opt/MozDef/meteor/public/css/mozdef.css +ADD conf/syncalerts.sh /opt/MozDef/examples/demo/syncalerts.sh # elasticsearch RUN (curl -L https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.3.2.tar.gz | tar -C /opt -xz \ && /bin/ln -s /opt/elasticsearch-1.3.2 /opt/elasticsearch \ - && /opt/elasticsearch/bin/plugin --install elasticsearch/marvel/latest \ && rm /opt/elasticsearch/config/elasticsearch.yml) # ADD conf/elasticsearch/elasticsearch.yml /opt/elasticsearch/config/ # BUG https://github.com/dotcloud/docker/issues/2446 ADD conf/elasticsearch.yml /opt/elasticsearch-1.3.2/config/ @@ -114,5 +114,5 @@ EXPOSE 8081 RUN apt-get clean && rm -rf /var/cache/apt/archives/* /var/lib/apt/lists/* # Launch rabbit and sleep 10s for it to start -CMD /etc/init.d/rabbitmq-server start && sleep 10 && /usr/bin/supervisord +#CMD /etc/init.d/rabbitmq-server start && sleep 10 && /usr/bin/supervisord diff --git a/docker/conf/supervisor.conf b/docker/conf/supervisor.conf index 3ae7ceeb..0a00e0f7 100644 --- a/docker/conf/supervisor.conf +++ b/docker/conf/supervisor.conf @@ -1,9 +1,13 @@ [supervisord] #Set true for debug -nodaemon=true +nodaemon=false autostart=true autorestart=true +[program:rabbitmq] +priority=1 +command=/etc/init.d/rabbitmq-server start + [program:elasticsearch] priority=2 command=/opt/elasticsearch/bin/elasticsearch @@ -14,10 +18,6 @@ command=/opt/elasticsearch/bin/elasticsearch #priority=2 #command=/usr/bin/mongod --smallfiles --dbpath /var/lib/mongodb/ -#[program:rabbitmq] -#priority=3 -#command=/usr/sbin/rabbitmq-server -#startsecs=10 [program:nginx] priority=4 @@ -32,7 +32,7 @@ command=/usr/local/bin/uwsgi --loop gevent --socket /run/uwsgi/apps/loginput.socket --wsgi-file index.py - --buffer-size 32768 --master --async 5 --enable-threads --listen 100 --uid root + --buffer-size 32768 --master --async 5 --listen 100 --uid root --pp /opt/MozDef/loginput --chmod-socket --logto /var/log/mozdef/uwsgi.loginput.log @@ -48,7 +48,7 @@ command=/usr/local/bin/uwsgi --loop gevent --socket /run/uwsgi/apps/rest.socket --wsgi-file index.py - --buffer-size 32768 --master --async 5 --enable-threads --listen 100 --uid root + --buffer-size 32768 --master --async 5 --listen 100 --uid root --pp /opt/MozDef/rest --chmod-socket --logto /var/log/mozdef/uwsgi.rest.log @@ -64,7 +64,7 @@ command=/usr/local/bin/uwsgi --socket /run/uwsgi/apps/esworker.socket --mule=esworker.py --mule - --buffer-size 32768 --master --async 5 --enable-threads --listen 100 --uid root + --buffer-size 32768 --master --async 5 --listen 100 --uid root --pp /opt/MozDef/mq --stats 127.0.0.1:9192 --logto /var/log/mozdef/uwsgi.esworker.log diff --git a/docker/conf/syncalerts.sh b/docker/conf/syncalerts.sh new file mode 100755 index 00000000..83064f11 --- /dev/null +++ b/docker/conf/syncalerts.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash +while true +do + /opt/MozDef/cron/syncAlertsToMongo.py + /opt/MozDef/cron/collectAttackers.py + sleep 10 +done