chg: [doc] Updated Debian Install

pull/4824/head
Steve Clement 2019-07-02 11:09:01 +09:00
parent 14262364a0
commit 3991d3982b
No known key found for this signature in database
GPG Key ID: 69A20F509BE4AEE9
3 changed files with 49 additions and 15 deletions

View File

@ -370,8 +370,10 @@ checkUsrLocalSrc () {
echo "/usr/local/src does not exist, creating."
mkdir -p /usr/local/src
sudo chmod 2775 /usr/local/src
# FIXME: This might fail on distros with no staff user
sudo chown root:staff /usr/local/src
# TODO: Better handling /usr/local/src permissions
if [[ "$(cat /etc/group |grep staff > /dev/null 2>&1)" == "0" ]]; then
sudo chown root:staff /usr/local/src
fi
fi
}

View File

@ -10,6 +10,11 @@ viper () {
sudo apt-get install \
libssl-dev swig python3-ssdeep p7zip-full unrar-free sqlite python3-pyclamd exiftool radare2 \
python3-magic python3-sqlalchemy python3-prettytable libffi-dev libfreetype6-dev libpng-dev -qy
if [[ -f "/etc/debian_version" ]]; then
if [[ "$(cat /etc/debian_version)" == "9.9" ]]; then
sudo apt-get install libpython3.5-dev -qy
fi
fi
echo "Cloning Viper"
$SUDO_USER git clone https://github.com/viper-framework/viper.git
sudo chown -R $MISP_USER:$MISP_USER viper

View File

@ -5,10 +5,12 @@
------------------------------------
!!! notice
Maintained and tested by @SteveClement on 20190425
Maintained and tested by @SteveClement on 20190702
!!! warning
This install document is **NOT** working as expected. There are Python issues as we "only" have python 3.5 but need at least python 3.6
This install document is compiles a custom Python 3.7 meaning some things might be unexpected.
Debian stretch has Python 3.5 but we need at least python 3.6
### 1/ Minimal Debian install
-------------------------
@ -22,6 +24,9 @@
```bash
PHP_ETC_BASE=/etc/php/7.0
PHP_INI=${PHP_ETC_BASE}/apache2/php.ini
sudo adduser $MISP_USER staff
sudo adduser $MISP_USER $WWW_USER
```
{!generic/sudo_etckeeper.md!}
@ -31,7 +36,7 @@ PHP_INI=${PHP_ETC_BASE}/apache2/php.ini
#### Make sure your system is up2date
```bash
sudo apt update
sudo apt -y dist-upgrade
sudo apt dist-upgrade -y
```
#### install postfix, there will be some questions. (optional)
@ -56,16 +61,20 @@ You need to update python3.5 to python3.7 for [PyMISP](https://github.com/MISP/P
FIXME: The below breaks redis-server and mariadb-server
```bash
# Manual Python3.7.3 install
sudo apt update
sudo apt install make build-essential libssl-dev zlib1g-dev libbz2-dev \
# Manual Python3.7.3 install in $HOME
sudo apt-get install -y make build-essential libssl-dev zlib1g-dev libbz2-dev \
libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev \
xz-utils tk-dev libffi-dev liblzma-dev -qqy
mkdir -p code ; cd code ; wget https://www.python.org/ftp/python/3.7.3/Python-3.7.3.tar.xz ; tar xfvJ Python-3.7.3.tar.xz ; cd Python-3.7.3 ; ./configure --enable-optimizations ; make -j8 ; sudo make altinstall
sudo update-alternatives --install /usr/bin/python python /usr/local/bin/python3.7 50
sudo update-alternatives --install /usr/bin/python python /usr/bin/python2.7 40
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.5 30
mkdir -p ~/opt/python3
cd /tmp
wget https://www.python.org/ftp/python/3.7.3/Python-3.7.3.tar.xz
tar xvfJ Python-3.7.3.tar.xz
rm Python-3.7.3.tar.xz
cd Python-3.7.3
# --enable-optimizations will run tests to optimize the resulting python binary, this takes time and is expected
./configure --enable-optimizations --with-ensurepip=install --prefix="$HOME"/opt/python3
make -j3
make altinstall
sudo apt install virtualenv -qqy
```
@ -78,7 +87,7 @@ jq ntp ntpdate imagemagick tesseract-ocr \
libxml2-dev libxslt1-dev zlib1g-dev \
net-tools -qqy
sudo apt install libapache2-mod-php php php-cli php-mbstring php-dev php-json php-xml php-mysql php-opcache php-readline php-redis php-gnupg php-gd -qqy
sudo apt install libapache2-mod-php php php-cli php-mbstring php-dev php-json php-xml php-mysql php7.0-opcache php-readline php-redis php-gnupg php-gd -qqy
sudo apt install \
mariadb-client \
@ -150,7 +159,7 @@ $SUDO_WWW git submodule foreach --recursive git config core.filemode false
$SUDO_WWW git config core.filemode false
# Create a python3 virtualenv
$SUDO_WWW virtualenv -p python3.7 ${PATH_TO_MISP}/venv
$SUDO_WWW virtualenv -p ~/opt/python3/bin/python3.7 ${PATH_TO_MISP}/venv
# make pip happy
sudo mkdir /var/www/.cache/
@ -170,11 +179,29 @@ cd $PATH_TO_MISP/app/files/scripts/python-stix
$SUDO_WWW ${PATH_TO_MISP}/venv/bin/pip install .
cd $PATH_TO_MISP/app/files/scripts/python-maec
$SUDO_WWW ${PATH_TO_MISP}/venv/bin/pip install .
# install STIX2.0 library to support STIX 2.0 export:
cd ${PATH_TO_MISP}/cti-python-stix2
$SUDO_WWW ${PATH_TO_MISP}/venv/bin/pip install .
# install PyMISP
cd $PATH_TO_MISP/PyMISP
$SUDO_WWW ${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 zmq needed by mispzmq
$SUDO_WWW ${PATH_TO_MISP}/venv/bin/pip install zmq
# install python-magic
$SUDO_WWW ${PATH_TO_MISP}/venv/bin/pip install python-magic
# install plyara
$SUDO_WWW ${PATH_TO_MISP}/venv/bin/pip install plyara
# Install Crypt_GPG and Console_CommandLine
sudo pear install ${PATH_TO_MISP}/INSTALL/dependencies/Console_CommandLine/package.xml
sudo pear install ${PATH_TO_MISP}/INSTALL/dependencies/Crypt_GPG/package.xml