Merge pull request #329 from 8ear/8ear-add-mkdocs-documentation

Update mkdocs documentation
pull/334/head
Alexandre Dulaunoy 2019-09-02 19:56:51 +02:00 committed by GitHub
commit f28a642f11
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 59 additions and 18 deletions

View File

@ -1,26 +1,43 @@
## How to install and start MISP modules (in a Python virtualenv)? ## How to install and start MISP modules (in a Python virtualenv)?
~~~~bash ~~~~bash
sudo apt-get install python3-dev python3-pip libpq5 libjpeg-dev tesseract-ocr libpoppler-cpp-dev imagemagick virtualenv libopencv-dev zbar-tools libzbar0 libzbar-dev libfuzzy-dev SUDO_WWW="sudo -u www-data"
# With virtualenv: sudo -u www-data virtualenv -p python3 /var/www/MISP/venv
sudo apt-get install -y \
git \
libpq5 \
libjpeg-dev \
tesseract-ocr \
libpoppler-cpp-dev \
imagemagick virtualenv \
libopencv-dev \
zbar-tools \
libzbar0 \
libzbar-dev \
libfuzzy-dev
# BEGIN with virtualenv:
$SUDO_WWW virtualenv -p python3 /var/www/MISP/venv
# END with virtualenv
cd /usr/local/src/ cd /usr/local/src/
sudo git clone https://github.com/MISP/misp-modules.git sudo git clone https://github.com/MISP/misp-modules.git
cd misp-modules cd misp-modules
# BEGIN with virtualenv: # BEGIN with virtualenv:
sudo -u www-data /var/www/MISP/venv/bin/pip install -I -r REQUIREMENTS $SUDO_WWW /var/www/MISP/venv/bin/pip install -I -r REQUIREMENTS
sudo -u www-data /var/www/MISP/venv/bin/pip install . $SUDO_WWW /var/www/MISP/venv/bin/pip install .
# END with virtualenv # END with virtualenv
# BEGIN without virtualenv: # BEGIN without virtualenv:
pip install -I -r REQUIREMENTS sudo pip install -I -r REQUIREMENTS
pip install . sudo pip install .
# END without virtualenv # END without virtualenv
# To start after reboot: # Start misp-modules as a service
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 sudo cp etc/systemd/system/misp-modules.service /etc/systemd/system/
sudo systemctl daemon-reload
# Start the Module: sudo systemctl enable --now misp-modules
/var/www/MISP/venv/bin/misp-modules -l 127.0.0.1 -s & #to start the modules /var/www/MISP/venv/bin/misp-modules -l 127.0.0.1 -s & #to start the modules
~~~~ ~~~~
@ -29,15 +46,25 @@ sudo sed -i -e '$i \sudo -u www-data /var/www/MISP/venv/bin/misp-modules -l 127.
As of this writing, the official RHEL repositories only contain Ruby 2.0.0 and Ruby 2.1 or higher is required. As such, this guide installs Ruby 2.2 from the SCL repository. As of this writing, the official RHEL repositories only contain Ruby 2.0.0 and Ruby 2.1 or higher is required. As such, this guide installs Ruby 2.2 from the SCL repository.
~~~~bash ~~~~bash
sudo yum install rh-ruby22 SUDO_WWW="sudo -u apache"
sudo yum install openjpeg-devel sudo yum install \
sudo yum install rubygem-rouge rubygem-asciidoctor zbar-devel opencv-devel gcc-c++ pkgconfig poppler-cpp-devel python-devel redhat-rpm-config rh-ruby22 \
cd /var/www/MISP openjpeg-devel \
git clone https://github.com/MISP/misp-modules.git rubygem-rouge \
rubygem-asciidoctor \
zbar-devel \
opencv-devel \
gcc-c++ \
pkgconfig \
poppler-cpp-devel \
python-devel \
redhat-rpm-config
cd /usr/local/src/
sudo git clone https://github.com/MISP/misp-modules.git
cd misp-modules cd misp-modules
sudo -u apache /usr/bin/scl enable rh-python36 "virtualenv -p python3 /var/www/MISP/venv" $SUDO_WWW /usr/bin/scl enable rh-python36 "virtualenv -p python3 /var/www/MISP/venv"
sudo -u apache /var/www/MISP/venv/bin/pip install -U -I -r REQUIREMENTS $SUDO_WWW /var/www/MISP/venv/bin/pip install -U -I -r REQUIREMENTS
sudo -u apache /var/www/MISP/venv/bin/pip install -U . $SUDO_WWW /var/www/MISP/venv/bin/pip install -U .
~~~~ ~~~~
Create the service file /etc/systemd/system/misp-modules.service : Create the service file /etc/systemd/system/misp-modules.service :
@ -68,6 +95,14 @@ systemctl enable --now misp-modules
## How to use an MISP modules Docker container ## How to use an MISP modules Docker container
### Docker build
~~~~bash
docker build -t misp-modules \
--build-arg BUILD_DATE=$(date -u +"%Y-%m-%d") \
docker/
~~~~
### Docker run ### Docker run
~~~~bash ~~~~bash
@ -91,6 +126,12 @@ services:
misp-modules: misp-modules:
# https://hub.docker.com/r/dcso/misp-dockerized-misp-modules # https://hub.docker.com/r/dcso/misp-dockerized-misp-modules
image: dcso/misp-dockerized-misp-modules:3 image: dcso/misp-dockerized-misp-modules:3
# Local image:
#image: misp-modules
#build:
# context: docker/
environment: environment:
# Redis # Redis
REDIS_BACKEND: misp-redis REDIS_BACKEND: misp-redis