Merge branch '2.4' of https://github.com/MISP/MISP into rework_stix

pull/6022/head
chrisr3d 2020-05-23 05:24:08 +02:00
commit 634dc66434
11 changed files with 144 additions and 140 deletions

View File

@ -2901,30 +2901,30 @@ installMISPonKali () {
fixRedis fixRedis
debug "git clone, submodule update everything" debug "git clone, submodule update everything"
sudo mkdir $PATH_TO_MISP sudo mkdir ${PATH_TO_MISP}
sudo chown $WWW_USER:$WWW_USER $PATH_TO_MISP sudo chown ${WWW_USER}:${WWW_USER} ${PATH_TO_MISP}
cd $PATH_TO_MISP cd ${PATH_TO_MISP}
false; while [[ $? -ne 0 ]]; do $SUDO_WWW git clone https://github.com/MISP/MISP.git $PATH_TO_MISP; done false; while [[ $? -ne 0 ]]; do ${SUDO_WWW} git clone https://github.com/MISP/MISP.git ${PATH_TO_MISP}; done
$SUDO_WWW git config core.filemode false ${SUDO_WWW} git config core.filemode false
cd $PATH_TO_MISP cd ${PATH_TO_MISP}
false; while [[ $? -ne 0 ]]; do $SUDO_WWW git submodule update --progress --init --recursive; done false; while [[ $? -ne 0 ]]; do ${SUDO_WWW} git submodule update --progress --init --recursive; done
# Make git ignore filesystem permission differences for submodules # Make git ignore filesystem permission differences for submodules
$SUDO_WWW git submodule foreach --recursive git config core.filemode false ${SUDO_WWW} git submodule foreach --recursive git config core.filemode false
cd $PATH_TO_MISP/app/files/scripts cd ${PATH_TO_MISP}/app/files/scripts
false; while [[ $? -ne 0 ]]; do $SUDO_WWW git clone https://github.com/CybOXProject/python-cybox.git; done false; while [[ $? -ne 0 ]]; do ${SUDO_WWW} git clone https://github.com/CybOXProject/python-cybox.git; done
false; while [[ $? -ne 0 ]]; do $SUDO_WWW git clone https://github.com/STIXProject/python-stix.git; done false; while [[ $? -ne 0 ]]; do ${SUDO_WWW} git clone https://github.com/STIXProject/python-stix.git; done
false; while [[ $? -ne 0 ]]; do $SUDO_WWW git clone https://github.com/CybOXProject/mixbox.git; done false; while [[ $? -ne 0 ]]; do ${SUDO_WWW} git clone https://github.com/CybOXProject/mixbox.git; done
false; while [[ $? -ne 0 ]]; do $SUDO_WWW git clone https://github.com/MAECProject/python-maec.git; done false; while [[ $? -ne 0 ]]; do ${SUDO_WWW} git clone https://github.com/MAECProject/python-maec.git; done
sudo mkdir /var/www/.cache/ sudo mkdir /var/www/.cache/
MISP_USER_HOME=$(sudo -Hiu $MISP_USER env | grep HOME |cut -f 2 -d=) MISP_USER_HOME=$(sudo -Hiu $MISP_USER env | grep HOME |cut -f 2 -d=)
sudo mkdir $MISP_USER_HOME/.cache sudo mkdir $MISP_USER_HOME/.cache
sudo chown $MISP_USER:$MISP_USER $MISP_USER_HOME/.cache sudo chown $MISP_USER:$MISP_USER $MISP_USER_HOME/.cache
sudo chown $WWW_USER:$WWW_USER /var/www/.cache sudo chown ${WWW_USER}:${WWW_USER} /var/www/.cache
## Not really needed... ## Not really needed...
## debug "Generating rc.local" ## debug "Generating rc.local"
@ -2932,64 +2932,64 @@ installMISPonKali () {
debug "Setting up main MISP virtualenv" debug "Setting up main MISP virtualenv"
# Needs virtualenv # Needs virtualenv
$SUDO_WWW virtualenv -p python3 ${PATH_TO_MISP}/venv ${SUDO_WWW} virtualenv -p python3 ${PATH_TO_MISP}/venv
## FIXME: The current stat of misp-dashboard is broken, disabling any use. ## FIXME: The current stat of misp-dashboard is broken, disabling any use.
##debug "Installing MISP dashboard" ##debug "Installing MISP dashboard"
##mispDashboard ##mispDashboard
debug "Installing python-cybox" debug "Installing python-cybox"
cd $PATH_TO_MISP/app/files/scripts/python-cybox cd ${PATH_TO_MISP}/app/files/scripts/python-cybox
$SUDO_WWW ${PATH_TO_MISP}/venv/bin/pip install . ${SUDO_WWW} ${PATH_TO_MISP}/venv/bin/pip install .
debug "Installing python-stix" debug "Installing python-stix"
cd $PATH_TO_MISP/app/files/scripts/python-stix cd ${PATH_TO_MISP}/app/files/scripts/python-stix
$SUDO_WWW ${PATH_TO_MISP}/venv/bin/pip install . ${SUDO_WWW} ${PATH_TO_MISP}/venv/bin/pip install .
debug "Install maec" debug "Install maec"
cd $PATH_TO_MISP/app/files/scripts/python-maec cd ${PATH_TO_MISP}/app/files/scripts/python-maec
$SUDO_WWW ${PATH_TO_MISP}/venv/bin/pip install . ${SUDO_WWW} ${PATH_TO_MISP}/venv/bin/pip install .
# install STIX2.0 library to support STIX 2.0 export # install STIX2.0 library to support STIX 2.0 export
debug "Installing cti-python-stix2" debug "Installing cti-python-stix2"
# install STIX2.0 library to support STIX 2.0 export: # install STIX2.0 library to support STIX 2.0 export:
cd ${PATH_TO_MISP}/cti-python-stix2 cd ${PATH_TO_MISP}/cti-python-stix2
$SUDO_WWW ${PATH_TO_MISP}/venv/bin/pip install . ${SUDO_WWW} ${PATH_TO_MISP}/venv/bin/pip install .
debug "Installing mixbox" debug "Installing mixbox"
cd $PATH_TO_MISP/app/files/scripts/mixbox cd ${PATH_TO_MISP}/app/files/scripts/mixbox
$SUDO_WWW ${PATH_TO_MISP}/venv/bin/pip install . ${SUDO_WWW} ${PATH_TO_MISP}/venv/bin/pip install .
# install PyMISP # install PyMISP
debug "Installing PyMISP" debug "Installing PyMISP"
cd $PATH_TO_MISP/PyMISP cd ${PATH_TO_MISP}/PyMISP
$SUDO_WWW ${PATH_TO_MISP}/venv/bin/pip install . ${SUDO_WWW} ${PATH_TO_MISP}/venv/bin/pip install .
# install pydeep # install pydeep
false; while [[ $? -ne 0 ]]; do $SUDO_WWW ${PATH_TO_MISP}/venv/bin/pip install git+https://github.com/kbandla/pydeep.git; done false; while [[ $? -ne 0 ]]; do ${SUDO_WWW} ${PATH_TO_MISP}/venv/bin/pip install git+https://github.com/kbandla/pydeep.git; done
# install lief # install lief
$SUDO_WWW ${PATH_TO_MISP}/venv/bin/pip install lief ${SUDO_WWW} ${PATH_TO_MISP}/venv/bin/pip install lief
# install python-magic # install python-magic
$SUDO_WWW ${PATH_TO_MISP}/venv/bin/pip install python-magic ${SUDO_WWW} ${PATH_TO_MISP}/venv/bin/pip install python-magic
# install plyara # install plyara
$SUDO_WWW ${PATH_TO_MISP}/venv/bin/pip install plyara ${SUDO_WWW} ${PATH_TO_MISP}/venv/bin/pip install plyara
# install zmq needed by mispzmq # install zmq needed by mispzmq
$SUDO_WWW ${PATH_TO_MISP}/venv/bin/pip install zmq ${SUDO_WWW} ${PATH_TO_MISP}/venv/bin/pip install zmq
debug "Installing cake" debug "Installing cake"
composer composer
$SUDO_WWW cp -fa $PATH_TO_MISP/INSTALL/setup/config.php $PATH_TO_MISP/app/Plugin/CakeResque/Config/config.php ${SUDO_WWW} cp -fa ${PATH_TO_MISP}/INSTALL/setup/config.php ${PATH_TO_MISP}/app/Plugin/CakeResque/Config/config.php
sudo chown -R $WWW_USER:$WWW_USER $PATH_TO_MISP sudo chown -R ${WWW_USER}:${WWW_USER} ${PATH_TO_MISP}
sudo chmod -R 750 $PATH_TO_MISP sudo chmod -R 750 ${PATH_TO_MISP}
sudo chmod -R g+ws $PATH_TO_MISP/app/tmp sudo chmod -R g+ws ${PATH_TO_MISP}/app/tmp
sudo chmod -R g+ws $PATH_TO_MISP/app/files sudo chmod -R g+ws ${PATH_TO_MISP}/app/files
sudo chmod -R g+ws $PATH_TO_MISP/app/files/scripts/tmp sudo chmod -R g+ws ${PATH_TO_MISP}/app/files/scripts/tmp
debug "Setting up database" debug "Setting up database"
if [[ ! -e /var/lib/mysql/misp/users.ibd ]]; then if [[ ! -e /var/lib/mysql/misp/users.ibd ]]; then
@ -3022,7 +3022,7 @@ installMISPonKali () {
enableServices enableServices
debug "Populating database" debug "Populating database"
$SUDO_WWW cat $PATH_TO_MISP/INSTALL/MYSQL.sql | mysql -u $DBUSER_MISP -p$DBPASSWORD_MISP $DBNAME ${SUDO_WWW} cat ${PATH_TO_MISP}/INSTALL/MYSQL.sql | mysql -u $DBUSER_MISP -p$DBPASSWORD_MISP $DBNAME
echo "<?php echo "<?php
class DATABASE_CONFIG { class DATABASE_CONFIG {
@ -3039,7 +3039,7 @@ installMISPonKali () {
'prefix' => '', 'prefix' => '',
'encoding' => 'utf8', 'encoding' => 'utf8',
); );
}" | $SUDO_WWW tee $PATH_TO_MISP/app/Config/database.php }" | ${SUDO_WWW} tee ${PATH_TO_MISP}/app/Config/database.php
else else
echo "There might be a database already existing here: /var/lib/mysql/misp/users.ibd" echo "There might be a database already existing here: /var/lib/mysql/misp/users.ibd"
echo "Skipping any creations…" echo "Skipping any creations…"
@ -3069,15 +3069,15 @@ installMISPonKali () {
sudo systemctl restart apache2 sudo systemctl restart apache2
debug "Setting up logrotate" debug "Setting up logrotate"
sudo cp $PATH_TO_MISP/INSTALL/misp.logrotate /etc/logrotate.d/misp sudo cp ${PATH_TO_MISP}/INSTALL/misp.logrotate /etc/logrotate.d/misp
sudo chmod 0640 /etc/logrotate.d/misp sudo chmod 0640 /etc/logrotate.d/misp
$SUDO_WWW cp -a $PATH_TO_MISP/app/Config/bootstrap.default.php $PATH_TO_MISP/app/Config/bootstrap.php ${SUDO_WWW} cp -a ${PATH_TO_MISP}/app/Config/bootstrap.default.php ${PATH_TO_MISP}/app/Config/bootstrap.php
$SUDO_WWW cp -a $PATH_TO_MISP/app/Config/core.default.php $PATH_TO_MISP/app/Config/core.php ${SUDO_WWW} cp -a ${PATH_TO_MISP}/app/Config/core.default.php ${PATH_TO_MISP}/app/Config/core.php
$SUDO_WWW cp -a $PATH_TO_MISP/app/Config/config.default.php $PATH_TO_MISP/app/Config/config.php ${SUDO_WWW} cp -a ${PATH_TO_MISP}/app/Config/config.default.php ${PATH_TO_MISP}/app/Config/config.php
sudo chown -R $WWW_USER:$WWW_USER $PATH_TO_MISP/app/Config sudo chown -R ${WWW_USER}:${WWW_USER} ${PATH_TO_MISP}/app/Config
sudo chmod -R 750 $PATH_TO_MISP/app/Config sudo chmod -R 750 ${PATH_TO_MISP}/app/Config
debug "Setting up GnuPG" debug "Setting up GnuPG"
setupGnuPG setupGnuPG

View File

@ -1,5 +1,5 @@
; Generated by RHash v1.3.9 on 2020-05-17 at 03:12.57 ; Generated by RHash v1.3.9 on 2020-05-22 at 16:25.08
; Written by Kravchenko Aleksey (Akademgorodok) - http://rhash.sf.net/ ; Written by Kravchenko Aleksey (Akademgorodok) - http://rhash.sf.net/
; ;
; 132940 03:12.57 2020-05-17 INSTALL.sh ; 133066 16:25.07 2020-05-22 INSTALL.sh
INSTALL.sh 89D2EC44902AE611FB65EC5CF30FD8685F713ECD 4D2C48FBF6D668A0FF35B01DE88BAA656943C13A1CEB148C09DD333299E894B3 9BC9C39F584346C8EC1DBF87DBF0E1952EF1736DF22E6BE233A60968F751E2C1C5A8E36CE34BE5696D6EE61D8E1079FA 0AD43002838AF3EB559FC2493A9F9B9FFC1E9592311E0866A46ADA3FB3D0D2AF419B06EB42454184E4DDEDDFAC281C07148E4C61277F933D942ABCEA7CF976CA INSTALL.sh 79EF825B019669270DBCA0DD922C1E3DE6DA3D89 22A82CD073DA3312DF51089884DE4F3AF88ECD0E359D4C048915178C366327EC 4DA7D94FB036B2CC02120C1AC5AEBA9B57E4200FFC2940CB5BF8D9FE8C8600C72888DD2093590E7E77BB3A9F38D7F656 AA0CFD458A4B5CD84103EB641F59FFBBBB740890CB433108C6E0B8912F795DC521E3C75BD563496088862798D90A5C4D20B862ABA5152A84F62C037E889C3ED3

View File

@ -1 +1 @@
89d2ec44902ae611fb65ec5cf30fd8685f713ecd INSTALL.sh 79ef825b019669270dbca0dd922c1e3de6da3d89 INSTALL.sh

View File

@ -1 +1 @@
4d2c48fbf6d668a0ff35b01de88baa656943c13a1ceb148c09dd333299e894b3 INSTALL.sh 22a82cd073da3312df51089884de4f3af88ecd0e359d4c048915178c366327ec INSTALL.sh

View File

@ -1 +1 @@
9bc9c39f584346c8ec1dbf87dbf0e1952ef1736df22e6be233a60968f751e2c1c5a8e36ce34be5696d6ee61d8e1079fa INSTALL.sh 4da7d94fb036b2cc02120c1ac5aeba9b57e4200ffc2940cb5bf8d9fe8c8600c72888dd2093590e7e77bb3a9f38d7f656 INSTALL.sh

View File

@ -1 +1 @@
0ad43002838af3eb559fc2493a9f9b9ffc1e9592311e0866a46ada3fb3d0d2af419b06eb42454184e4ddeddfac281c07148e4c61277f933d942abcea7cf976ca INSTALL.sh aa0cfd458a4b5cd84103eb641f59ffbbbb740890cb433108c6e0b8912f795dc521e3c75bd563496088862798d90a5c4d20b862aba5152a84f62c037e889c3ed3 INSTALL.sh

View File

@ -433,30 +433,30 @@ installMISPonKali () {
fixRedis fixRedis
debug "git clone, submodule update everything" debug "git clone, submodule update everything"
sudo mkdir $PATH_TO_MISP sudo mkdir ${PATH_TO_MISP}
sudo chown $WWW_USER:$WWW_USER $PATH_TO_MISP sudo chown ${WWW_USER}:${WWW_USER} ${PATH_TO_MISP}
cd $PATH_TO_MISP cd ${PATH_TO_MISP}
false; while [[ $? -ne 0 ]]; do $SUDO_WWW git clone https://github.com/MISP/MISP.git $PATH_TO_MISP; done false; while [[ $? -ne 0 ]]; do ${SUDO_WWW} git clone https://github.com/MISP/MISP.git ${PATH_TO_MISP}; done
$SUDO_WWW git config core.filemode false ${SUDO_WWW} git config core.filemode false
cd $PATH_TO_MISP cd ${PATH_TO_MISP}
false; while [[ $? -ne 0 ]]; do $SUDO_WWW git submodule update --progress --init --recursive; done false; while [[ $? -ne 0 ]]; do ${SUDO_WWW} git submodule update --progress --init --recursive; done
# Make git ignore filesystem permission differences for submodules # Make git ignore filesystem permission differences for submodules
$SUDO_WWW git submodule foreach --recursive git config core.filemode false ${SUDO_WWW} git submodule foreach --recursive git config core.filemode false
cd $PATH_TO_MISP/app/files/scripts cd ${PATH_TO_MISP}/app/files/scripts
false; while [[ $? -ne 0 ]]; do $SUDO_WWW git clone https://github.com/CybOXProject/python-cybox.git; done false; while [[ $? -ne 0 ]]; do ${SUDO_WWW} git clone https://github.com/CybOXProject/python-cybox.git; done
false; while [[ $? -ne 0 ]]; do $SUDO_WWW git clone https://github.com/STIXProject/python-stix.git; done false; while [[ $? -ne 0 ]]; do ${SUDO_WWW} git clone https://github.com/STIXProject/python-stix.git; done
false; while [[ $? -ne 0 ]]; do $SUDO_WWW git clone https://github.com/CybOXProject/mixbox.git; done false; while [[ $? -ne 0 ]]; do ${SUDO_WWW} git clone https://github.com/CybOXProject/mixbox.git; done
false; while [[ $? -ne 0 ]]; do $SUDO_WWW git clone https://github.com/MAECProject/python-maec.git; done false; while [[ $? -ne 0 ]]; do ${SUDO_WWW} git clone https://github.com/MAECProject/python-maec.git; done
sudo mkdir /var/www/.cache/ sudo mkdir /var/www/.cache/
MISP_USER_HOME=$(sudo -Hiu $MISP_USER env | grep HOME |cut -f 2 -d=) MISP_USER_HOME=$(sudo -Hiu $MISP_USER env | grep HOME |cut -f 2 -d=)
sudo mkdir $MISP_USER_HOME/.cache sudo mkdir $MISP_USER_HOME/.cache
sudo chown $MISP_USER:$MISP_USER $MISP_USER_HOME/.cache sudo chown $MISP_USER:$MISP_USER $MISP_USER_HOME/.cache
sudo chown $WWW_USER:$WWW_USER /var/www/.cache sudo chown ${WWW_USER}:${WWW_USER} /var/www/.cache
## Not really needed... ## Not really needed...
## debug "Generating rc.local" ## debug "Generating rc.local"
@ -464,64 +464,64 @@ installMISPonKali () {
debug "Setting up main MISP virtualenv" debug "Setting up main MISP virtualenv"
# Needs virtualenv # Needs virtualenv
$SUDO_WWW virtualenv -p python3 ${PATH_TO_MISP}/venv ${SUDO_WWW} virtualenv -p python3 ${PATH_TO_MISP}/venv
## FIXME: The current stat of misp-dashboard is broken, disabling any use. ## FIXME: The current stat of misp-dashboard is broken, disabling any use.
##debug "Installing MISP dashboard" ##debug "Installing MISP dashboard"
##mispDashboard ##mispDashboard
debug "Installing python-cybox" debug "Installing python-cybox"
cd $PATH_TO_MISP/app/files/scripts/python-cybox cd ${PATH_TO_MISP}/app/files/scripts/python-cybox
$SUDO_WWW ${PATH_TO_MISP}/venv/bin/pip install . ${SUDO_WWW} ${PATH_TO_MISP}/venv/bin/pip install .
debug "Installing python-stix" debug "Installing python-stix"
cd $PATH_TO_MISP/app/files/scripts/python-stix cd ${PATH_TO_MISP}/app/files/scripts/python-stix
$SUDO_WWW ${PATH_TO_MISP}/venv/bin/pip install . ${SUDO_WWW} ${PATH_TO_MISP}/venv/bin/pip install .
debug "Install maec" debug "Install maec"
cd $PATH_TO_MISP/app/files/scripts/python-maec cd ${PATH_TO_MISP}/app/files/scripts/python-maec
$SUDO_WWW ${PATH_TO_MISP}/venv/bin/pip install . ${SUDO_WWW} ${PATH_TO_MISP}/venv/bin/pip install .
# install STIX2.0 library to support STIX 2.0 export # install STIX2.0 library to support STIX 2.0 export
debug "Installing cti-python-stix2" debug "Installing cti-python-stix2"
# install STIX2.0 library to support STIX 2.0 export: # install STIX2.0 library to support STIX 2.0 export:
cd ${PATH_TO_MISP}/cti-python-stix2 cd ${PATH_TO_MISP}/cti-python-stix2
$SUDO_WWW ${PATH_TO_MISP}/venv/bin/pip install . ${SUDO_WWW} ${PATH_TO_MISP}/venv/bin/pip install .
debug "Installing mixbox" debug "Installing mixbox"
cd $PATH_TO_MISP/app/files/scripts/mixbox cd ${PATH_TO_MISP}/app/files/scripts/mixbox
$SUDO_WWW ${PATH_TO_MISP}/venv/bin/pip install . ${SUDO_WWW} ${PATH_TO_MISP}/venv/bin/pip install .
# install PyMISP # install PyMISP
debug "Installing PyMISP" debug "Installing PyMISP"
cd $PATH_TO_MISP/PyMISP cd ${PATH_TO_MISP}/PyMISP
$SUDO_WWW ${PATH_TO_MISP}/venv/bin/pip install . ${SUDO_WWW} ${PATH_TO_MISP}/venv/bin/pip install .
# install pydeep # install pydeep
false; while [[ $? -ne 0 ]]; do $SUDO_WWW ${PATH_TO_MISP}/venv/bin/pip install git+https://github.com/kbandla/pydeep.git; done false; while [[ $? -ne 0 ]]; do ${SUDO_WWW} ${PATH_TO_MISP}/venv/bin/pip install git+https://github.com/kbandla/pydeep.git; done
# install lief # install lief
$SUDO_WWW ${PATH_TO_MISP}/venv/bin/pip install lief ${SUDO_WWW} ${PATH_TO_MISP}/venv/bin/pip install lief
# install python-magic # install python-magic
$SUDO_WWW ${PATH_TO_MISP}/venv/bin/pip install python-magic ${SUDO_WWW} ${PATH_TO_MISP}/venv/bin/pip install python-magic
# install plyara # install plyara
$SUDO_WWW ${PATH_TO_MISP}/venv/bin/pip install plyara ${SUDO_WWW} ${PATH_TO_MISP}/venv/bin/pip install plyara
# install zmq needed by mispzmq # install zmq needed by mispzmq
$SUDO_WWW ${PATH_TO_MISP}/venv/bin/pip install zmq ${SUDO_WWW} ${PATH_TO_MISP}/venv/bin/pip install zmq
debug "Installing cake" debug "Installing cake"
composer composer
$SUDO_WWW cp -fa $PATH_TO_MISP/INSTALL/setup/config.php $PATH_TO_MISP/app/Plugin/CakeResque/Config/config.php ${SUDO_WWW} cp -fa ${PATH_TO_MISP}/INSTALL/setup/config.php ${PATH_TO_MISP}/app/Plugin/CakeResque/Config/config.php
sudo chown -R $WWW_USER:$WWW_USER $PATH_TO_MISP sudo chown -R ${WWW_USER}:${WWW_USER} ${PATH_TO_MISP}
sudo chmod -R 750 $PATH_TO_MISP sudo chmod -R 750 ${PATH_TO_MISP}
sudo chmod -R g+ws $PATH_TO_MISP/app/tmp sudo chmod -R g+ws ${PATH_TO_MISP}/app/tmp
sudo chmod -R g+ws $PATH_TO_MISP/app/files sudo chmod -R g+ws ${PATH_TO_MISP}/app/files
sudo chmod -R g+ws $PATH_TO_MISP/app/files/scripts/tmp sudo chmod -R g+ws ${PATH_TO_MISP}/app/files/scripts/tmp
debug "Setting up database" debug "Setting up database"
if [[ ! -e /var/lib/mysql/misp/users.ibd ]]; then if [[ ! -e /var/lib/mysql/misp/users.ibd ]]; then
@ -554,7 +554,7 @@ installMISPonKali () {
enableServices enableServices
debug "Populating database" debug "Populating database"
$SUDO_WWW cat $PATH_TO_MISP/INSTALL/MYSQL.sql | mysql -u $DBUSER_MISP -p$DBPASSWORD_MISP $DBNAME ${SUDO_WWW} cat ${PATH_TO_MISP}/INSTALL/MYSQL.sql | mysql -u $DBUSER_MISP -p$DBPASSWORD_MISP $DBNAME
echo "<?php echo "<?php
class DATABASE_CONFIG { class DATABASE_CONFIG {
@ -571,7 +571,7 @@ installMISPonKali () {
'prefix' => '', 'prefix' => '',
'encoding' => 'utf8', 'encoding' => 'utf8',
); );
}" | $SUDO_WWW tee $PATH_TO_MISP/app/Config/database.php }" | ${SUDO_WWW} tee ${PATH_TO_MISP}/app/Config/database.php
else else
echo "There might be a database already existing here: /var/lib/mysql/misp/users.ibd" echo "There might be a database already existing here: /var/lib/mysql/misp/users.ibd"
echo "Skipping any creations…" echo "Skipping any creations…"
@ -601,15 +601,15 @@ installMISPonKali () {
sudo systemctl restart apache2 sudo systemctl restart apache2
debug "Setting up logrotate" debug "Setting up logrotate"
sudo cp $PATH_TO_MISP/INSTALL/misp.logrotate /etc/logrotate.d/misp sudo cp ${PATH_TO_MISP}/INSTALL/misp.logrotate /etc/logrotate.d/misp
sudo chmod 0640 /etc/logrotate.d/misp sudo chmod 0640 /etc/logrotate.d/misp
$SUDO_WWW cp -a $PATH_TO_MISP/app/Config/bootstrap.default.php $PATH_TO_MISP/app/Config/bootstrap.php ${SUDO_WWW} cp -a ${PATH_TO_MISP}/app/Config/bootstrap.default.php ${PATH_TO_MISP}/app/Config/bootstrap.php
$SUDO_WWW cp -a $PATH_TO_MISP/app/Config/core.default.php $PATH_TO_MISP/app/Config/core.php ${SUDO_WWW} cp -a ${PATH_TO_MISP}/app/Config/core.default.php ${PATH_TO_MISP}/app/Config/core.php
$SUDO_WWW cp -a $PATH_TO_MISP/app/Config/config.default.php $PATH_TO_MISP/app/Config/config.php ${SUDO_WWW} cp -a ${PATH_TO_MISP}/app/Config/config.default.php ${PATH_TO_MISP}/app/Config/config.php
sudo chown -R $WWW_USER:$WWW_USER $PATH_TO_MISP/app/Config sudo chown -R ${WWW_USER}:${WWW_USER} ${PATH_TO_MISP}/app/Config
sudo chmod -R 750 $PATH_TO_MISP/app/Config sudo chmod -R 750 ${PATH_TO_MISP}/app/Config
debug "Setting up GnuPG" debug "Setting up GnuPG"
setupGnuPG setupGnuPG

View File

@ -1265,7 +1265,9 @@ class UsersController extends AppController
if ($this->Session->check('Auth.User')) { if ($this->Session->check('Auth.User')) {
$this->User->extralog($this->Auth->user(), "logout"); $this->User->extralog($this->Auth->user(), "logout");
} }
$this->Flash->info(__('Good-Bye')); if (!Configure::read('Plugin.CustomAuth_custom_logout')) {
$this->Flash->info(__('Good-Bye'));
}
$user = $this->User->find('first', array( $user = $this->User->find('first', array(
'conditions' => array( 'conditions' => array(
'User.id' => $this->Auth->user('id') 'User.id' => $this->Auth->user('id')

View File

@ -156,7 +156,7 @@ class Server extends AppModel
'Push' => 'MISP/app/Console/cake Server push [user_id] [server_id]', 'Push' => 'MISP/app/Console/cake Server push [user_id] [server_id]',
'Cache feeds for quick lookups' => 'MISP/app/Console/cake Server cacheFeed [user_id] [feed_id|all|csv|text|misp]', 'Cache feeds for quick lookups' => 'MISP/app/Console/cake Server cacheFeed [user_id] [feed_id|all|csv|text|misp]',
'Fetch feeds as local data' => 'MISP/app/Console/cake Server fetchFeed [user_id] [feed_id|all|csv|text|misp]', 'Fetch feeds as local data' => 'MISP/app/Console/cake Server fetchFeed [user_id] [feed_id|all|csv|text|misp]',
'Run enrichment' => 'MISP/app/Console/cake Event enrichEvent [user_id] [event_id] [json_encoded_module_list]', 'Run enrichment' => 'MISP/app/Console/cake Event enrichment [user_id] [event_id] [json_encoded_module_list]',
'Test' => 'MISP/app/Console/cake Server test [server_id]', 'Test' => 'MISP/app/Console/cake Server test [server_id]',
'List' => 'MISP/app/Console/cake Server list' 'List' => 'MISP/app/Console/cake Server list'
), ),

View File

@ -14,9 +14,7 @@
?> ?>
</ul> </ul>
</div> </div>
<div class="tabMenu tabMenuFiltersBlock noPrint" style="padding-right:0px !important;">
<span id="filter_header" class="attribute_filter_header">Filters: </span>AAA
</div>
<table class="table table-striped table-hover table-condensed"> <table class="table table-striped table-hover table-condensed">
<tr> <tr>
<th class="short"><?php echo $this->Paginator->sort('key', __('Key'));?></th> <th class="short"><?php echo $this->Paginator->sort('key', __('Key'));?></th>
@ -26,8 +24,13 @@
foreach ($list as $item): foreach ($list as $item):
?> ?>
<tr> <tr>
<td class="short"><?php echo h($item['GalaxyElement']['key']); ?>&nbsp; <td class="short"><?= h($item['GalaxyElement']['key']); ?></td>
</td><td class="short"><?php echo h($item['GalaxyElement']['value']); ?>&nbsp;</td> <td class="short"><?php if ($item['GalaxyElement']['key'] === 'refs') {
echo '<a href="' . h($item['GalaxyElement']['value']) . '" rel="noreferrer">' . h($item['GalaxyElement']['value']) . '</a>';
} else {
echo h($item['GalaxyElement']['value']);
}
?></td>
</tr> </tr>
<?php <?php
endforeach; endforeach;

View File

@ -134,45 +134,44 @@ installCore () {
debug "Installing ${LBLUE}MISP${NC} core" debug "Installing ${LBLUE}MISP${NC} core"
# Download MISP using git in the /var/www/ directory. # Download MISP using git in the /var/www/ directory.
sudo mkdir ${PATH_TO_MISP} sudo mkdir ${PATH_TO_MISP}
sudo chown $WWW_USER:$WWW_USER ${PATH_TO_MISP} sudo chown ${WWW_USER}:${WWW_USER} ${PATH_TO_MISP}
cd ${PATH_TO_MISP} cd ${PATH_TO_MISP}
$SUDO_WWW git clone https://github.com/MISP/MISP.git ${PATH_TO_MISP} false; while [[ $? -ne 0 ]]; do ${SUDO_WWW} git clone https://github.com/MISP/MISP.git ${PATH_TO_MISP}; done
$SUDO_WWW git submodule update --init --recursive false; while [[ $? -ne 0 ]]; do ${SUDO_WWW} git submodule update --progress --init --recursive; done
# Make git ignore filesystem permission differences for submodules # Make git ignore filesystem permission differences for submodules
$SUDO_WWW git submodule foreach --recursive git config core.filemode false ${SUDO_WWW} git submodule foreach --recursive git config core.filemode false
# Make git ignore filesystem permission differences # Make git ignore filesystem permission differences
$SUDO_WWW git config core.filemode false ${SUDO_WWW} git config core.filemode false
# Create a python3 virtualenv # Create a python3 virtualenv
$SUDO_WWW virtualenv -p python3 ${PATH_TO_MISP}/venv ${SUDO_WWW} virtualenv -p python3 ${PATH_TO_MISP}/venv
# make pip happy # make pip happy
sudo mkdir /var/www/.cache/ sudo mkdir /var/www/.cache/
sudo chown $WWW_USER:$WWW_USER /var/www/.cache sudo chown ${WWW_USER}:${WWW_USER} /var/www/.cache
cd ${PATH_TO_MISP}/app/files/scripts cd ${PATH_TO_MISP}/app/files/scripts
$SUDO_WWW git clone https://github.com/CybOXProject/python-cybox.git false; while [[ $? -ne 0 ]]; do ${SUDO_WWW} git clone https://github.com/CybOXProject/python-cybox.git; done
$SUDO_WWW git clone https://github.com/STIXProject/python-stix.git false; while [[ $? -ne 0 ]]; do ${SUDO_WWW} git clone https://github.com/STIXProject/python-stix.git; done
$SUDO_WWW git clone https://github.com/MAECProject/python-maec.git false; while [[ $? -ne 0 ]]; do ${SUDO_WWW} git clone https://github.com/MAECProject/python-maec.git; done
false; while [[ $? -ne 0 ]]; do ${SUDO_WWW} git clone https://github.com/CybOXProject/mixbox.git; done
# install mixbox to accommodate the new STIX dependencies:
$SUDO_WWW git clone https://github.com/CybOXProject/mixbox.git
cd ${PATH_TO_MISP}/app/files/scripts/mixbox cd ${PATH_TO_MISP}/app/files/scripts/mixbox
$SUDO_WWW ${PATH_TO_MISP}/venv/bin/pip install . ${SUDO_WWW} ${PATH_TO_MISP}/venv/bin/pip install .
cd ${PATH_TO_MISP}/app/files/scripts/python-cybox cd ${PATH_TO_MISP}/app/files/scripts/python-cybox
$SUDO_WWW ${PATH_TO_MISP}/venv/bin/pip install . ${SUDO_WWW} ${PATH_TO_MISP}/venv/bin/pip install .
cd ${PATH_TO_MISP}/app/files/scripts/python-stix cd ${PATH_TO_MISP}/app/files/scripts/python-stix
$SUDO_WWW ${PATH_TO_MISP}/venv/bin/pip install . ${SUDO_WWW} ${PATH_TO_MISP}/venv/bin/pip install .
cd $PATH_TO_MISP/app/files/scripts/python-maec cd ${PATH_TO_MISP}/app/files/scripts/python-maec
$SUDO_WWW ${PATH_TO_MISP}/venv/bin/pip install . ${SUDO_WWW} ${PATH_TO_MISP}/venv/bin/pip install .
# install STIX2.0 library to support STIX 2.0 export: # install STIX2.0 library to support STIX 2.0 export:
cd ${PATH_TO_MISP}/cti-python-stix2 cd ${PATH_TO_MISP}/cti-python-stix2
$SUDO_WWW ${PATH_TO_MISP}/venv/bin/pip install . ${SUDO_WWW} ${PATH_TO_MISP}/venv/bin/pip install .
# install PyMISP # install PyMISP
cd ${PATH_TO_MISP}/PyMISP cd ${PATH_TO_MISP}/PyMISP
$SUDO_WWW ${PATH_TO_MISP}/venv/bin/pip install . ${SUDO_WWW} ${PATH_TO_MISP}/venv/bin/pip install .
# FIXME: Remove libfaup etc once the egg has the library baked-in # FIXME: Remove libfaup etc once the egg has the library baked-in
sudo apt-get install cmake libcaca-dev liblua5.3-dev -y sudo apt-get install cmake libcaca-dev liblua5.3-dev -y
cd /tmp cd /tmp
@ -192,19 +191,19 @@ installCore () {
sudo ldconfig sudo ldconfig
# install pydeep # install pydeep
$SUDO_WWW ${PATH_TO_MISP}/venv/bin/pip install git+https://github.com/kbandla/pydeep.git false; while [[ $? -ne 0 ]]; do ${SUDO_WWW} ${PATH_TO_MISP}/venv/bin/pip install git+https://github.com/kbandla/pydeep.git; done
# install lief # install lief
$SUDO_WWW ${PATH_TO_MISP}/venv/bin/pip install lief ${SUDO_WWW} ${PATH_TO_MISP}/venv/bin/pip install lief
# install zmq needed by mispzmq # install zmq needed by mispzmq
$SUDO_WWW ${PATH_TO_MISP}/venv/bin/pip install zmq redis ${SUDO_WWW} ${PATH_TO_MISP}/venv/bin/pip install zmq redis
# install python-magic # install python-magic
$SUDO_WWW ${PATH_TO_MISP}/venv/bin/pip install python-magic ${SUDO_WWW} ${PATH_TO_MISP}/venv/bin/pip install python-magic
# install plyara # install plyara
$SUDO_WWW ${PATH_TO_MISP}/venv/bin/pip install plyara ${SUDO_WWW} ${PATH_TO_MISP}/venv/bin/pip install plyara
} }
# <snippet-end 1_mispCoreInstall.sh> # <snippet-end 1_mispCoreInstall.sh>
``` ```
@ -221,15 +220,15 @@ installCake () {
cd ${PATH_TO_MISP}/app cd ${PATH_TO_MISP}/app
# Make composer cache happy # Make composer cache happy
# /!\ composer on Ubuntu when invoked with sudo -u doesn't set $HOME to /var/www but keeps it /home/misp \!/ # /!\ composer on Ubuntu when invoked with sudo -u doesn't set $HOME to /var/www but keeps it /home/misp \!/
sudo mkdir /var/www/.composer ; sudo chown $WWW_USER:$WWW_USER /var/www/.composer sudo mkdir /var/www/.composer ; sudo chown ${WWW_USER}:${WWW_USER} /var/www/.composer
$SUDO_WWW php composer.phar install ${SUDO_WWW} php composer.phar install
# Enable CakeResque with php-redis # Enable CakeResque with php-redis
sudo phpenmod redis sudo phpenmod redis
sudo phpenmod gnupg sudo phpenmod gnupg
# To use the scheduler worker for scheduled tasks, do the following: # To use the scheduler worker for scheduled tasks, do the following:
$SUDO_WWW cp -fa ${PATH_TO_MISP}/INSTALL/setup/config.php ${PATH_TO_MISP}/app/Plugin/CakeResque/Config/config.php ${SUDO_WWW} cp -fa ${PATH_TO_MISP}/INSTALL/setup/config.php ${PATH_TO_MISP}/app/Plugin/CakeResque/Config/config.php
# If you have multiple MISP instances on the same system, don't forget to have a different Redis per MISP instance for the CakeResque workers # If you have multiple MISP instances on the same system, don't forget to have a different Redis per MISP instance for the CakeResque workers
# The default Redis port can be updated in Plugin/CakeResque/Config/config.php # The default Redis port can be updated in Plugin/CakeResque/Config/config.php
@ -249,7 +248,7 @@ permissions () {
sudo chmod -R 750 ${PATH_TO_MISP} sudo chmod -R 750 ${PATH_TO_MISP}
sudo chmod -R g+ws ${PATH_TO_MISP}/app/tmp sudo chmod -R g+ws ${PATH_TO_MISP}/app/tmp
sudo chmod -R g+ws ${PATH_TO_MISP}/app/files sudo chmod -R g+ws ${PATH_TO_MISP}/app/files
sudo chmod -R g+ws $PATH_TO_MISP/app/files/scripts/tmp sudo chmod -R g+ws ${PATH_TO_MISP}/app/files/scripts/tmp
} }
# <snippet-end 2_permissions.sh> # <snippet-end 2_permissions.sh>
``` ```
@ -423,10 +422,10 @@ logRotation () {
configMISP () { configMISP () {
debug "Generating ${LBLUE}MISP${NC} config files" debug "Generating ${LBLUE}MISP${NC} config files"
# There are 4 sample configuration files in ${PATH_TO_MISP}/app/Config that need to be copied # There are 4 sample configuration files in ${PATH_TO_MISP}/app/Config that need to be copied
$SUDO_WWW cp -a ${PATH_TO_MISP}/app/Config/bootstrap.default.php ${PATH_TO_MISP}/app/Config/bootstrap.php ${SUDO_WWW} cp -a ${PATH_TO_MISP}/app/Config/bootstrap.default.php ${PATH_TO_MISP}/app/Config/bootstrap.php
$SUDO_WWW cp -a ${PATH_TO_MISP}/app/Config/database.default.php ${PATH_TO_MISP}/app/Config/database.php ${SUDO_WWW} cp -a ${PATH_TO_MISP}/app/Config/database.default.php ${PATH_TO_MISP}/app/Config/database.php
$SUDO_WWW cp -a ${PATH_TO_MISP}/app/Config/core.default.php ${PATH_TO_MISP}/app/Config/core.php ${SUDO_WWW} cp -a ${PATH_TO_MISP}/app/Config/core.default.php ${PATH_TO_MISP}/app/Config/core.php
$SUDO_WWW cp -a ${PATH_TO_MISP}/app/Config/config.default.php ${PATH_TO_MISP}/app/Config/config.php ${SUDO_WWW} cp -a ${PATH_TO_MISP}/app/Config/config.default.php ${PATH_TO_MISP}/app/Config/config.php
echo "<?php echo "<?php
class DATABASE_CONFIG { class DATABASE_CONFIG {
@ -443,7 +442,7 @@ configMISP () {
'prefix' => '', 'prefix' => '',
'encoding' => 'utf8', 'encoding' => 'utf8',
); );
}" | $SUDO_WWW tee $PATH_TO_MISP/app/Config/database.php }" | ${SUDO_WWW} tee ${PATH_TO_MISP}/app/Config/database.php
# Important! Change the salt key in ${PATH_TO_MISP}/app/Config/config.php # Important! Change the salt key in ${PATH_TO_MISP}/app/Config/config.php
# The salt key must be a string at least 32 bytes long. # The salt key must be a string at least 32 bytes long.
@ -452,7 +451,7 @@ configMISP () {
# delete the user from mysql and log in again using the default admin credentials (admin@admin.test / admin) # delete the user from mysql and log in again using the default admin credentials (admin@admin.test / admin)
# and make sure the file permissions are still OK # and make sure the file permissions are still OK
sudo chown -R $WWW_USER:$WWW_USER ${PATH_TO_MISP}/app/Config sudo chown -R ${WWW_USER}:${WWW_USER} ${PATH_TO_MISP}/app/Config
sudo chmod -R 750 ${PATH_TO_MISP}/app/Config sudo chmod -R 750 ${PATH_TO_MISP}/app/Config
} }
# <snippet-end 2_configMISP.sh> # <snippet-end 2_configMISP.sh>
@ -472,7 +471,7 @@ configMISP () {
backgroundWorkers () { backgroundWorkers () {
debug "Setting up background workers" debug "Setting up background workers"
# To make the background workers start on boot # To make the background workers start on boot
sudo chmod +x $PATH_TO_MISP/app/Console/worker/start.sh sudo chmod +x ${PATH_TO_MISP}/app/Console/worker/start.sh
if [ ! -e /etc/rc.local ] if [ ! -e /etc/rc.local ]
then then
@ -524,7 +523,7 @@ echo "User (misp) DB Password: $DBPASSWORD_MISP"
----------------- -----------------
#### MISP has a new pub/sub feature, using ZeroMQ. To enable it, simply run the following command #### MISP has a new pub/sub feature, using ZeroMQ. To enable it, simply run the following command
```bash ```bash
$SUDO_WWW ${PATH_TO_MISP}/venv/bin/pip install pyzmq ${SUDO_WWW} ${PATH_TO_MISP}/venv/bin/pip install pyzmq
``` ```
#### MISP has a feature for publishing events to Kafka. To enable it, simply run the following commands #### MISP has a feature for publishing events to Kafka. To enable it, simply run the following commands