diff --git a/README.md b/README.md index fc1bf9b..1c41681 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,17 @@ 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) + + # Building your image ## Fetch files @@ -33,4 +44,16 @@ Edit the docker-compose.yml and change the following environment variables: ## Build the containers ``` # docker-compose build +or +# docker-compose -f docker-compose-nginx.yml build ``` + +## Run containers +``` +# docker-compose up +or +# docker-compose -f docker-compose-nginx.yml up +``` + + + diff --git a/docker-compose-nginx.yml b/docker-compose-nginx.yml new file mode 100644 index 0000000..845c7ea --- /dev/null +++ b/docker-compose-nginx.yml @@ -0,0 +1,61 @@ +version: '2' + +services: + proxy: + build: + context: misp-proxy + container_name: misp-proxy + depends_on: + - misp-web + hostname: misp-proxy + image: misp-proxy:latest + networks: + - misp-network + ports: + - 81:80 + - 4443:443 + + misp-web: + build: misp-web + depends_on: + - misp-db + container_name: misp-web + hostname: misp-web + image: misp-web:latest + restart: always + networks: + - misp-network + links: + - misp-db + volumes: + - /dev/urandom:/dev/random + - /data/misp:/var/www/MISP + environment: + - MYSQL_ROOT_PASSWORD=xxxxxxxx + - MYSQL_MISP_PASSWORD=xxxxxxxx + - MYSQL_HOST=misp-db + - MISP_ADMIN_EMAIL=admin@admin.test + - MISP_ADMIN_PASSPHRASE=xxxxxxxxx + - MISP_BASEURL=http:\/\/misp\.test + - POSTFIX_RELAY_HOST=relay.fqdn + - TIMEZONE=Europe/Brussels + + misp-db: + build: + context: misp-db + args: + MYSQL_MISP_PASSWORD: xxxxxxxx + container_name: misp-db + hostname: misp-db + image: misp-db:latest + restart: always + networks: + - misp-network + volumes: + - /data/mysql:/var/lib/mysql + environment: + - MYSQL_ROOT_PASSWORD=xxxxxxxx + +networks: + misp-network: + driver: bridge diff --git a/misp-proxy/Dockerfile b/misp-proxy/Dockerfile new file mode 100644 index 0000000..39e6962 --- /dev/null +++ b/misp-proxy/Dockerfile @@ -0,0 +1,13 @@ +FROM nginx:1.9 + +# default conf for proxy service +COPY ./default.conf /etc/nginx/conf.d/default.conf + +# NOT FOUND response +COPY ./backend-not-found.html /var/www/html/backend-not-found.html + +# Proxy and SSL configurations +COPY ./includes/ /etc/nginx/includes/ + +# Proxy SSL certificates +COPY ./ssl/ /etc/ssl/certs/nginx/ diff --git a/misp-proxy/backend-not-found.html b/misp-proxy/backend-not-found.html new file mode 100644 index 0000000..bebb95c --- /dev/null +++ b/misp-proxy/backend-not-found.html @@ -0,0 +1,6 @@ + +