Fix for problem discovered by @XizzoR, where GPG key was empty and not actually being created in latest version

pull/8/head
Ventz Petkov 2019-03-16 14:35:30 -04:00
parent b063e3bcd5
commit 68b6b5a5be
3 changed files with 10 additions and 3 deletions

View File

@ -45,7 +45,7 @@ git clone https://github.com/harvard-itsecurity/docker-misp.git
cd docker-misp cd docker-misp
# modify build.sh, specifically for: # modify build.sh, specifically for:
# 1.) all passwords (MYSQL) # 1.) all passwords (MYSQL, GPG)
# 2.) change at LEAST "MISP_FQDN" to your FQDN (domain) # 2.) change at LEAST "MISP_FQDN" to your FQDN (domain)
# Build the docker image - will take a bit, but it's a one time thing! # Build the docker image - will take a bit, but it's a one time thing!
@ -98,6 +98,7 @@ You can customize the ```build.sh``` script to pass custom:
* POSTFIX_RELAY_HOST * POSTFIX_RELAY_HOST
* MISP_FQDN * MISP_FQDN
* MISP_EMAIL * MISP_EMAIL
* MISP_GPG_PASSWORD
See build.sh for an example on how to customize and build your own image with custom defaults. See build.sh for an example on how to customize and build your own image with custom defaults.
@ -137,5 +138,7 @@ Jeremy Barlow: @jbarlow-mcafee - Cleanup, configs, conveniences, python 2 vs 3 c
Matt Saunders: @matt-saunders - Fixed all install warnings and errors Matt Saunders: @matt-saunders - Fixed all install warnings and errors
Matija Čoklica: @XizzoR - Discovered problem where GPG key was empty
# Help/Questions/Comments: # Help/Questions/Comments:
For help or more info, feel free to contact Ventz Petkov: ventz_petkov@harvard.edu For help or more info, feel free to contact Ventz Petkov: ventz_petkov@harvard.edu

View File

@ -6,4 +6,5 @@ docker build \
--build-arg POSTFIX_RELAY_HOST=localhost \ --build-arg POSTFIX_RELAY_HOST=localhost \
--build-arg MISP_FQDN=localhost \ --build-arg MISP_FQDN=localhost \
--build-arg MISP_EMAIL=admin@localhost \ --build-arg MISP_EMAIL=admin@localhost \
--build-arg MISP_GPG_PASSWORD=ChangeThisDefaultPasswordXuJBao5Q2bps89LWFqWkKgDZwAFpNHvc \
-t harvarditsecurity/misp container -t harvarditsecurity/misp container

View File

@ -6,6 +6,7 @@ ARG MYSQL_MISP_PASSWORD=ChangeThisDefaultPassworda9564ebc3289b7a14551baf8ad5ec60
ARG POSTFIX_RELAY_HOST=localhost ARG POSTFIX_RELAY_HOST=localhost
ARG MISP_FQDN=localhost ARG MISP_FQDN=localhost
ARG MISP_EMAIL=admin@localhost ARG MISP_EMAIL=admin@localhost
ARG MISP_GPG_PASSWORD=ChangeThisDefaultPasswordXuJBao5Q2bps89LWFqWkKgDZwAFpNHvc
# Dir you need to override to keep data on reboot/new container: # Dir you need to override to keep data on reboot/new container:
VOLUME /var/lib/mysql VOLUME /var/lib/mysql
@ -181,11 +182,13 @@ RUN sed -i -e 's/db login/misp/g' /var/www/MISP/app/Config/database.php ; \
echo "Name-Real: MISP" >> /tmp/config_gpg ; \ echo "Name-Real: MISP" >> /tmp/config_gpg ; \
echo "Name-Email: $MISP_EMAIL" >> /tmp/config_gpg ; \ echo "Name-Email: $MISP_EMAIL" >> /tmp/config_gpg ; \
echo "Expire-Date: 0" >> /tmp/config_gpg ; \ echo "Expire-Date: 0" >> /tmp/config_gpg ; \
#echo "%no-protection" >> /tmp/config_gpg ; \
echo "Passphrase: $MISP_GPG_PASSWORD" >> /tmp/config_gpg ; \
chmod 700 /tmp/config_gpg ; \ chmod 700 /tmp/config_gpg ; \
sudo rm -f /dev/random ; \ sudo rm -f /dev/random ; \
sudo mknod -m 0666 /dev/random c 1 9 ; \ sudo mknod -m 0666 /dev/random c 1 9 ; \
sudo echo RNGDOPTIONS="--random-device /dev/urandom --rng-device /dev/urandom" | sudo tee /etc/default/rng-tools ; \ #sudo echo RNGDOPTIONS="--random-device /dev/urandom --rng-device /dev/urandom" | sudo tee /etc/default/rng-tools ; \
sudo echo HRNGDEVICE=/dev/urandom | sudo tee /etc/default/rng-tools ; \ sudo echo HRNGDEVICE=/dev/urandom | sudo tee -a /etc/default/rng-tools ; \
sudo /etc/init.d/rng-tools restart ; \ sudo /etc/init.d/rng-tools restart ; \
sudo rngd -f -r /dev/urandom ; \ sudo rngd -f -r /dev/urandom ; \
chown www-data /tmp/config_gpg ; \ chown www-data /tmp/config_gpg ; \