2014-04-16 22:40:15 +04:00
|
|
|
# This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
# Copyright (c) 2014 Mozilla Corporation
|
|
|
|
#
|
|
|
|
# Contributors:
|
|
|
|
# Yohann Lepage yohann@lepage.info
|
|
|
|
# Anthony Verez averez@mozilla.com
|
|
|
|
|
2015-05-29 22:32:46 +03:00
|
|
|
FROM debian:stable
|
2014-04-01 08:06:49 +04:00
|
|
|
|
2014-07-29 02:24:52 +04:00
|
|
|
MAINTAINER Jeff Bryner <jbryner@mozilla.com>
|
2014-04-01 08:06:49 +04:00
|
|
|
|
|
|
|
ENV DEBIAN_FRONTEND noninteractive
|
|
|
|
|
|
|
|
# Locales
|
2014-05-06 02:02:40 +04:00
|
|
|
RUN (apt-get clean \
|
|
|
|
&& apt-key update \
|
2014-04-23 22:24:55 +04:00
|
|
|
&& apt-get -q -y update --fix-missing \
|
|
|
|
&& apt-get -q -y update \
|
2014-04-01 08:06:49 +04:00
|
|
|
&& apt-get install -q -y apt-utils \
|
|
|
|
&& apt-get install -q -y locales)
|
|
|
|
|
|
|
|
ADD conf/locale.gen /etc/locale.gen
|
|
|
|
RUN (locale-gen \
|
|
|
|
&& locale-gen en_US.UTF-8 \
|
|
|
|
&& dpkg-reconfigure locales)
|
|
|
|
|
|
|
|
ENV LANGUAGE en_US.UTF-8
|
|
|
|
ENV LANG en_US.UTF-8
|
|
|
|
ENV LC_ALL en_US.UTF-8
|
|
|
|
ENV LC_CTYPE en_US.UTF-8
|
|
|
|
|
|
|
|
RUN apt-get install -q -y openjdk-7-jre
|
|
|
|
|
|
|
|
# rabbit mq
|
|
|
|
RUN apt-get install -q -y rabbitmq-server
|
2014-05-06 21:00:56 +04:00
|
|
|
RUN rabbitmq-plugins enable rabbitmq_management
|
2014-04-01 08:06:49 +04:00
|
|
|
# mongodb
|
|
|
|
RUN apt-get install -q -y mongodb
|
|
|
|
# nodejs
|
|
|
|
RUN apt-get install -q -y nodejs npm git
|
|
|
|
# nginx
|
|
|
|
RUN (apt-get install -q -y nginx-full \
|
|
|
|
&& rm /etc/nginx/nginx.conf)
|
|
|
|
ADD conf/nginx.conf /etc/nginx/
|
|
|
|
|
|
|
|
|
|
|
|
#Mozdef
|
2014-07-01 01:55:00 +04:00
|
|
|
RUN (apt-get install -q -y python2.7-dev python-pip curl supervisor wget libmysqlclient-dev\
|
2015-03-10 18:46:48 +03:00
|
|
|
&& pip install -U pip \
|
2014-05-07 04:08:50 +04:00
|
|
|
&& curl -L https://github.com/jeffbryner/MozDef/archive/master.tar.gz |tar -C /opt -xz \
|
|
|
|
&& /bin/ln -s /opt/MozDef-master /opt/MozDef \
|
2014-04-01 08:06:49 +04:00
|
|
|
&& cd /opt/MozDef && /usr/bin/pip install --verbose --use-mirrors --timeout 30 -r requirements.txt \
|
2015-05-21 00:15:54 +03:00
|
|
|
&& /usr/bin/pip install --verbose --use-mirrors --timeout 30 uwsgi celery \
|
2014-04-01 08:06:49 +04:00
|
|
|
&& mkdir /var/log/mozdef \
|
|
|
|
&& mkdir -p /run/uwsgi/apps/ \
|
|
|
|
&& touch /run/uwsgi/apps/loginput.socket && chmod 666 /run/uwsgi/apps/loginput.socket \
|
2014-05-06 21:00:56 +04:00
|
|
|
&& touch /run/uwsgi/apps/rest.socket && chmod 666 /run/uwsgi/apps/rest.socket \
|
2016-11-29 20:34:11 +03:00
|
|
|
&& mkdir -p /opt/mozdef/envs/mozdef/bot/ && cd /opt/mozdef/envs/mozdef/bot/ \
|
2014-05-06 21:00:56 +04:00
|
|
|
&& wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz && gzip -d GeoLiteCity.dat.gz)
|
2014-04-01 08:06:49 +04:00
|
|
|
ADD conf/supervisor.conf /etc/supervisor/conf.d/supervisor.conf
|
2014-07-18 10:17:00 +04:00
|
|
|
ADD conf/settings.js /opt/MozDef/meteor/app/lib/settings.js
|
|
|
|
ADD conf/config.py /opt/MozDef/alerts/lib/config.py
|
2014-10-03 02:52:27 +04:00
|
|
|
ADD conf/sampleData2MozDef.conf /opt/MozDef/examples/demo/sampleData2MozDef.conf
|
2015-02-23 20:37:01 +03:00
|
|
|
ADD conf/mozdef.localloginenabled.css /opt/MozDef/meteor/public/css/mozdef.css
|
2015-05-20 22:54:00 +03:00
|
|
|
ADD conf/syncalerts.sh /opt/MozDef/examples/demo/syncalerts.sh
|
2014-04-01 08:06:49 +04:00
|
|
|
|
|
|
|
# elasticsearch
|
2014-09-14 16:34:37 +04:00
|
|
|
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 \
|
2014-04-01 08:06:49 +04:00
|
|
|
&& rm /opt/elasticsearch/config/elasticsearch.yml)
|
|
|
|
# ADD conf/elasticsearch/elasticsearch.yml /opt/elasticsearch/config/ # BUG https://github.com/dotcloud/docker/issues/2446
|
2014-09-14 16:34:37 +04:00
|
|
|
ADD conf/elasticsearch.yml /opt/elasticsearch-1.3.2/config/
|
2014-04-01 08:06:49 +04:00
|
|
|
|
|
|
|
|
|
|
|
# Kibana
|
2014-09-14 16:34:37 +04:00
|
|
|
RUN (curl -L https://download.elasticsearch.org/kibana/kibana/kibana-3.1.0.tar.gz |tar -C /opt -xz \
|
|
|
|
&& /bin/ln -s /opt/kibana-3.1.0 /opt/kibana)
|
2014-08-06 10:46:18 +04:00
|
|
|
#can't add from the local relative dir, so add from github
|
|
|
|
ADD https://raw.githubusercontent.com/jeffbryner/MozDef/master/examples/kibana/dashboards/alert.js /opt/kibana/app/dashboards/alert.js
|
|
|
|
ADD https://raw.githubusercontent.com/jeffbryner/MozDef/master/examples/kibana/dashboards/event.js /opt/kibana/app/dashboards/event.js
|
2014-04-01 08:06:49 +04:00
|
|
|
|
|
|
|
# Meteor
|
|
|
|
RUN (curl -L https://install.meteor.com/ | /bin/sh \
|
|
|
|
&& npm install -g meteorite \
|
|
|
|
&& ln -s /usr/bin/nodejs /usr/bin/node \
|
2015-01-16 02:23:57 +03:00
|
|
|
&& cd /opt/MozDef/meteor )
|
2014-04-01 08:06:49 +04:00
|
|
|
|
|
|
|
|
|
|
|
# VOLUMES
|
|
|
|
# Elasticsearch
|
|
|
|
VOLUME ['/var/lib/elasticsearch','/var/log/elasticsearch']
|
|
|
|
# Mongodb
|
|
|
|
VOLUME ['/var/lib/mongodb','/var/log/mongodb']
|
|
|
|
# Nginx
|
|
|
|
VOLUME ['/var/log/nginx','/var/log/mozdef']
|
2014-08-02 02:19:18 +04:00
|
|
|
# Quick share resource
|
|
|
|
VOLUME ['/tmp/share','/tmp/share']
|
2014-04-01 08:06:49 +04:00
|
|
|
|
|
|
|
# PORTS
|
|
|
|
# METEOR
|
|
|
|
EXPOSE 3000
|
|
|
|
# Elasticsearch
|
|
|
|
EXPOSE 9200
|
|
|
|
# Kibana
|
|
|
|
EXPOSE 9090
|
|
|
|
# LOGINPUT
|
|
|
|
EXPOSE 8080
|
|
|
|
# REST
|
|
|
|
EXPOSE 8081
|
|
|
|
|
|
|
|
# CLEAN
|
|
|
|
RUN apt-get clean && rm -rf /var/cache/apt/archives/* /var/lib/apt/lists/*
|
|
|
|
|
2017-06-15 22:56:47 +03:00
|
|
|
# Launch rabbit and sleep 10s for it to start
|
|
|
|
#CMD /etc/init.d/rabbitmq-server start && sleep 10 && /usr/bin/supervisord
|
2014-04-23 22:24:55 +04:00
|
|
|
|