From fae93e536855aae80cee6680cbbc57670dde3770 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Bonhomme?= Date: Thu, 17 Aug 2017 08:05:29 +0200 Subject: [PATCH] Install MISP modules and start the discovery server at boot. --- bootstrap.sh | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/bootstrap.sh b/bootstrap.sh index a47e4c8..a943304 100644 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -4,9 +4,9 @@ DBHOST='localhost' DBNAME='misp' DBUSER_ADMIN='root' -DBPASSWORD_ADMIN='$(openssl rand -hex 32)' +DBPASSWORD_ADMIN="$(openssl rand -hex 32)" DBUSER_MISP='misp' -DBPASSWORD_MISP='$(openssl rand -hex 32)' +DBPASSWORD_MISP="$(openssl rand -hex 32)" # Webserver configuration PATH_TO_MISP='/var/www/MISP' @@ -313,7 +313,30 @@ systemctl enable workers.service > /dev/null systemctl restart workers.service > /dev/null -echo -e "\n--- Restarting Apache ---\n" +echo -e "\n--- Installing MISP modules... ---\n" +apt-get install -y python3-dev python3-pip libpq5 libjpeg-dev > /dev/null 2>&1 +cd /usr/local/src/ +git clone https://github.com/MISP/misp-modules.git +cd misp-modules +pip3 install -I -r REQUIREMENTS > /dev/null 2>&1 +pip3 install -I . > /dev/null 2>&1 +cat > /etc/systemd/system/misp-modules.service < /dev/null +systemctl restart misp-modules.service > /dev/null + + +echo -e "\n--- Restarting Apache... ---\n" systemctl restart apache2 > /dev/null 2>&1 sleep 5