From 4378f1744c6ea0395699bad852e61d4b94256561 Mon Sep 17 00:00:00 2001 From: Steve Clement Date: Mon, 11 Feb 2019 16:15:59 +0900 Subject: [PATCH] fix: [installer] Kali still had bugs. Most fixed --- INSTALL/INSTALL.debian.sh | 34 ++++++++++++++++++++++----- INSTALL/INSTALL.debian.tpl.sh | 24 +++++++++++++++---- docs/generic/MISP_CAKE_init.md | 3 +++ docs/generic/misp-dashboard-debian.md | 2 ++ docs/generic/misp-modules-debian.md | 5 ++-- 5 files changed, 56 insertions(+), 12 deletions(-) diff --git a/INSTALL/INSTALL.debian.sh b/INSTALL/INSTALL.debian.sh index bdc22014a..342e9462e 100755 --- a/INSTALL/INSTALL.debian.sh +++ b/INSTALL/INSTALL.debian.sh @@ -887,6 +887,9 @@ coreCAKE () { # Setup some more MISP default via cake CLI + # The default install is Python in a virtualenv, setting accordingly + $SUDO_WWW $CAKE Admin setSetting "MISP.python_bin" "${PATH_TO_MISP}/venv/bin/python" + # Tune global time outs $SUDO_WWW $CAKE Admin setSetting "Session.autoRegenerate" 0 $SUDO_WWW $CAKE Admin setSetting "Session.timeout" 600 @@ -1063,9 +1066,10 @@ backgroundWorkers () { # Main MISP Modules install function mispmodules () { - sudo sed -i -e '$i \sudo -u www-data ${PATH_TO_MISP}/venv/bin/misp-modules -l 127.0.0.1 -s > /tmp/misp-modules_rc.local.log &\n' /etc/rc.local + # FIXME: this is broken, ${PATH_TO_MISP} is litteral + sudo sed -i -e '$i \sudo -u www-data /var/www/MISP/venv/bin/misp-modules -l 127.0.0.1 -s > /tmp/misp-modules_rc.local.log &\n' /etc/rc.local cd /usr/local/src/ -## TODO: checkUsrLocalSrc in main doc + ## TODO: checkUsrLocalSrc in main doc git clone https://github.com/MISP/misp-modules.git cd misp-modules # some misp-modules dependencies @@ -1119,6 +1123,8 @@ mispmodules () { # Main MISP Dashboard install function mispDashboard () { + # Install pyzmq to main MISP venv + $SUDO_WWW ${PATH_TO_MISP}/venv/bin/pip install pyzmq cd /var/www sudo mkdir misp-dashboard sudo chown www-data:www-data misp-dashboard @@ -1426,8 +1432,6 @@ installMISPubuntuSupported () { # Run cake CLI for the core installation - functionLocation('') coreCAKE - # TODO: Move this to Core Cake - sudo -H -u www-data $CAKE Admin setSetting "MISP.python_bin" "${PATH_TO_MISP}/venv/bin/python" # Update Galaxies, Template Objects, Warning Lists, Notice Lists, Taxonomies - functionLocation('') updateGOWNT @@ -1520,27 +1524,45 @@ installMISPonKali () { debug "Installing python-cybox" cd $PATH_TO_MISP/app/files/scripts/python-cybox sudo -H -u www-data ${PATH_TO_MISP}/venv/bin/pip install . + debug "Installing python-stix" cd $PATH_TO_MISP/app/files/scripts/python-stix sudo -H -u www-data ${PATH_TO_MISP}/venv/bin/pip install . - # install STIX2.0 library to support STIX 2.0 export: + + debug "Install maec" + cd $PATH_TO_MISP/app/files/scripts/python-maec + sudo -H -u www-data ${PATH_TO_MISP}/venv/bin/pip install . + + # install STIX2.0 library to support STIX 2.0 export debug "Installing cti-python-stix2" cd ${PATH_TO_MISP}/cti-python-stix2 sudo -H -u www-data ${PATH_TO_MISP}/venv/bin/pip install -I . + debug "Installing mixbox" cd $PATH_TO_MISP/app/files/scripts/mixbox sudo -H -u www-data ${PATH_TO_MISP}/venv/bin/pip install . + # install PyMISP debug "Installing PyMISP" cd $PATH_TO_MISP/PyMISP sudo -H -u www-data ${PATH_TO_MISP}/venv/bin/pip install . + # install pydeep + $SUDO_WWW ${PATH_TO_MISP}/venv/bin/pip install git+https://github.com/kbandla/pydeep.git + + # install lief + $SUDO_WWW ${PATH_TO_MISP}/venv/bin/pip install https://github.com/lief-project/packages/raw/lief-master-latest/pylief-0.9.0.dev.zip + + # install python-magic + $SUDO_WWW ${PATH_TO_MISP}/venv/bin/pip install python-magic + # Install Crypt_GPG and Console_CommandLine debug "Installing pear Console_CommandLine" pear install ${PATH_TO_MISP}/INSTALL/dependencies/Console_CommandLine/package.xml debug "Installing pear Crypt_GPG" pear install ${PATH_TO_MISP}/INSTALL/dependencies/Crypt_GPG/package.xml + debug "Installing composer with php 7.3 updates" composer73 @@ -1643,11 +1665,11 @@ installMISPonKali () { setupGnuPG chmod +x $PATH_TO_MISP/app/Console/worker/start.sh + sudo $PATH_TO_MISP/app/Console/worker/start.sh debug "Running Core Cake commands" coreCAKE dashboardCake - sudo -H -u www-data $CAKE Admin setSetting "MISP.python_bin" "${PATH_TO_MISP}/venv/bin/python" debug "Update: Galaxies, Template Objects, Warning Lists, Notice Lists, Taxonomies" updateGOWNT diff --git a/INSTALL/INSTALL.debian.tpl.sh b/INSTALL/INSTALL.debian.tpl.sh index 06e05444e..45636d317 100755 --- a/INSTALL/INSTALL.debian.tpl.sh +++ b/INSTALL/INSTALL.debian.tpl.sh @@ -217,8 +217,6 @@ installMISPubuntuSupported () { # Run cake CLI for the core installation - functionLocation('') coreCAKE - # TODO: Move this to Core Cake - sudo -H -u www-data $CAKE Admin setSetting "MISP.python_bin" "${PATH_TO_MISP}/venv/bin/python" # Update Galaxies, Template Objects, Warning Lists, Notice Lists, Taxonomies - functionLocation('') updateGOWNT @@ -311,27 +309,45 @@ installMISPonKali () { debug "Installing python-cybox" cd $PATH_TO_MISP/app/files/scripts/python-cybox sudo -H -u www-data ${PATH_TO_MISP}/venv/bin/pip install . + debug "Installing python-stix" cd $PATH_TO_MISP/app/files/scripts/python-stix sudo -H -u www-data ${PATH_TO_MISP}/venv/bin/pip install . - # install STIX2.0 library to support STIX 2.0 export: + + debug "Install maec" + cd $PATH_TO_MISP/app/files/scripts/python-maec + sudo -H -u www-data ${PATH_TO_MISP}/venv/bin/pip install . + + # install STIX2.0 library to support STIX 2.0 export debug "Installing cti-python-stix2" cd ${PATH_TO_MISP}/cti-python-stix2 sudo -H -u www-data ${PATH_TO_MISP}/venv/bin/pip install -I . + debug "Installing mixbox" cd $PATH_TO_MISP/app/files/scripts/mixbox sudo -H -u www-data ${PATH_TO_MISP}/venv/bin/pip install . + # install PyMISP debug "Installing PyMISP" cd $PATH_TO_MISP/PyMISP sudo -H -u www-data ${PATH_TO_MISP}/venv/bin/pip install . + # install pydeep + $SUDO_WWW ${PATH_TO_MISP}/venv/bin/pip install git+https://github.com/kbandla/pydeep.git + + # install lief + $SUDO_WWW ${PATH_TO_MISP}/venv/bin/pip install https://github.com/lief-project/packages/raw/lief-master-latest/pylief-0.9.0.dev.zip + + # install python-magic + $SUDO_WWW ${PATH_TO_MISP}/venv/bin/pip install python-magic + # Install Crypt_GPG and Console_CommandLine debug "Installing pear Console_CommandLine" pear install ${PATH_TO_MISP}/INSTALL/dependencies/Console_CommandLine/package.xml debug "Installing pear Crypt_GPG" pear install ${PATH_TO_MISP}/INSTALL/dependencies/Crypt_GPG/package.xml + debug "Installing composer with php 7.3 updates" composer73 @@ -434,11 +450,11 @@ installMISPonKali () { setupGnuPG chmod +x $PATH_TO_MISP/app/Console/worker/start.sh + sudo $PATH_TO_MISP/app/Console/worker/start.sh debug "Running Core Cake commands" coreCAKE dashboardCake - sudo -H -u www-data $CAKE Admin setSetting "MISP.python_bin" "${PATH_TO_MISP}/venv/bin/python" debug "Update: Galaxies, Template Objects, Warning Lists, Notice Lists, Taxonomies" updateGOWNT diff --git a/docs/generic/MISP_CAKE_init.md b/docs/generic/MISP_CAKE_init.md index 11d3b700c..6d43a0cee 100644 --- a/docs/generic/MISP_CAKE_init.md +++ b/docs/generic/MISP_CAKE_init.md @@ -10,6 +10,9 @@ coreCAKE () { # Setup some more MISP default via cake CLI + # The default install is Python in a virtualenv, setting accordingly + $SUDO_WWW $CAKE Admin setSetting "MISP.python_bin" "${PATH_TO_MISP}/venv/bin/python" + # Tune global time outs $SUDO_WWW $CAKE Admin setSetting "Session.autoRegenerate" 0 $SUDO_WWW $CAKE Admin setSetting "Session.timeout" 600 diff --git a/docs/generic/misp-dashboard-debian.md b/docs/generic/misp-dashboard-debian.md index 1ec699c53..4e0da96f0 100644 --- a/docs/generic/misp-dashboard-debian.md +++ b/docs/generic/misp-dashboard-debian.md @@ -4,6 +4,8 @@ # # Main MISP Dashboard install function mispDashboard () { + # Install pyzmq to main MISP venv + $SUDO_WWW ${PATH_TO_MISP}/venv/bin/pip install pyzmq cd /var/www sudo mkdir misp-dashboard sudo chown www-data:www-data misp-dashboard diff --git a/docs/generic/misp-modules-debian.md b/docs/generic/misp-modules-debian.md index 281756f15..19e3f0e0e 100644 --- a/docs/generic/misp-modules-debian.md +++ b/docs/generic/misp-modules-debian.md @@ -4,9 +4,10 @@ # # Main MISP Modules install function mispmodules () { - sudo sed -i -e '$i \sudo -u www-data ${PATH_TO_MISP}/venv/bin/misp-modules -l 127.0.0.1 -s > /tmp/misp-modules_rc.local.log &\n' /etc/rc.local + # FIXME: this is broken, ${PATH_TO_MISP} is litteral + sudo sed -i -e '$i \sudo -u www-data /var/www/MISP/venv/bin/misp-modules -l 127.0.0.1 -s > /tmp/misp-modules_rc.local.log &\n' /etc/rc.local cd /usr/local/src/ -## TODO: checkUsrLocalSrc in main doc + ## TODO: checkUsrLocalSrc in main doc git clone https://github.com/MISP/misp-modules.git cd misp-modules # some misp-modules dependencies