diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..0a8e73f --- /dev/null +++ b/.travis.yml @@ -0,0 +1,16 @@ +language: minimal + +env: + - DOCKER_COMPOSE_VERSION=1.24.0 + +before_install: + - sudo rm /usr/local/bin/docker-compose + - curl -L -o ~/docker-compose https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` + - sudo mv ~/docker-compose /usr/local/bin + - sudo chmod +x /usr/local/bin/docker-compose + - bash -c "[ -f .travis.yml ] || echo 'Could not find docker-compose'" + + +script: + - docker-compose build + - docker-compose -f docker-compose-nginx.yml build diff --git a/README.md b/README.md index 1c594fc..235afd3 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,8 @@ MISP Docker =========== +[![](https://travis-ci.org/yaleman/misp-docker.svg?branch=master)](https://travis-ci.org/yaleman/misp-docker) + The files in this repository are used to create a Docker container running a [MISP](http://www.misp-project.org) ("Malware Information Sharing Platform") instance. I rewrote the Docker file to split the components in multiple containers (which is more in the philosophy of Docker). Therefore there is no longer a Dockerfile in the root directory. @@ -15,16 +17,14 @@ The build is based on Ubuntu and will install all the required components. The f * Creation of the MySQL database * Generation of the admin PGP key - -# Optional NGINX config - -Included is an optional Docker Compose file 'docker-compose-nginx.yml' to spin up a reverse proxy to sit in front of MISP. - ## Config * add your "*.crt" and "*.key" files to the ./misp-proxy/ssl folder If not implementing SSL (not recommended) then simply comment out the appropriate lines in the "./misp-proxy/default.conf" file. * Update "server_name" in default.conf file (will implement ENVIRONMENT VARIABLE in the future) +# Optional NGINX config + +Included is an optional Docker Compose file 'docker-compose-nginx.yml' to spin up a reverse proxy to sit in front of MISP. # Building your image diff --git a/web/Dockerfile b/web/Dockerfile index 4ed51d3..cbd2650 100644 --- a/web/Dockerfile +++ b/web/Dockerfile @@ -79,6 +79,12 @@ RUN php -r "unlink('composer-setup.php');" # END FIX RUN php composer.phar config vendor-dir Vendor + +RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" +RUN php -r "if (hash_file('sha384', 'composer-setup.php') === '48e3236262b34d30969dca3c37281b3b4bbe3221bda826ac6a9a62d6444cdb0dcd0615698a5cbe587c3f0fe57a54d8f5') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" +RUN php composer-setup.php +RUN php -r "unlink('composer-setup.php');" + RUN php composer.phar install --ignore-platform-reqs USER root RUN phpenmod redis @@ -136,6 +142,9 @@ RUN rm -rf warninglists && git clone https://github.com/MISP/misp-warninglists.g RUN rm -rf taxonomies && git clone https://github.com/MISP/misp-taxonomies.git ./taxonomies RUN chown -R www-data:www-data misp-objects misp-galaxy warninglists taxonomies +# Install MISP build requirements +RUN sudo apt-get -y install libpoppler58 libpoppler-dev libpoppler-cpp-dev + # Install MISP Modules WORKDIR /opt RUN apt-get install -y python3 python3-pip libjpeg-dev @@ -144,11 +153,17 @@ RUN pip install --upgrade pip # END FIX RUN git clone https://github.com/MISP/misp-modules.git WORKDIR /opt/misp-modules -# Requirements Fix +RUN pip3 install --upgrade pip RUN cat REQUIREMENTS | sed 's/aiohttp==3.4.4/aiohttp/g' > REQUIREMENTS -# END FIX RUN pip3 install --upgrade --ignore-installed urllib3 -RUN pip3 install --upgrade --ignore-installed requests +RUN pip3 install --upgrade --ignore-installed requests + +RUN sed -i 's/aiohttp.*/aiohttp/g' REQUIREMENTS +RUN sed -i 's/functools.*//g' REQUIREMENTS +RUN sed -i 's/async-timeout.*/async-timeout/g' REQUIREMENTS +RUN sed -i 's/url-normalize.*/url-normalize/g' REQUIREMENTS +RUN sed -i 's/^\(yarl\)\=.*/\1/g' REQUIREMENTS +RUN sed -i 's/^\(sigmatools\)\=.*/\1/' REQUIREMENTS RUN pip3 install -I -r REQUIREMENTS RUN pip3 install -I . RUN echo "sudo -u www-data misp-modules -s -l 127.0.0.1 &" >>/etc/rc.local @@ -181,7 +196,6 @@ RUN echo 'command=/bin/bash -c "misp-modules -s -l 127.0.0.1"' >> /etc/superviso RUN echo 'user = www-data' >> /etc/supervisor/conf.d/supervisord.conf RUN echo 'startsecs = 0' >> /etc/supervisor/conf.d/supervisord.conf RUN echo 'autorestart = false' >> /etc/supervisor/conf.d/supervisord.conf - # Modify syslog configuration RUN sed -i -E 's/^(\s*)system\(\);/\1unix-stream("\/dev\/log");/' /etc/syslog-ng/syslog-ng.conf