mirror of https://github.com/MISP/ansible
Add misp-module automatic installation
parent
d837c82cf0
commit
24454c64d6
10
README.md
10
README.md
|
@ -1,6 +1,10 @@
|
||||||
MISP - Ansible installation script
|
MISP - Ansible installation script
|
||||||
----------------------------------------
|
----------------------------------------
|
||||||
|
|
||||||
|
- V0.2
|
||||||
|
* Data location management
|
||||||
|
* misp-modules installation
|
||||||
|
|
||||||
- V0.1
|
- V0.1
|
||||||
* Nginx support only
|
* Nginx support only
|
||||||
* Backup script provided
|
* Backup script provided
|
||||||
|
@ -13,6 +17,12 @@ Instructions
|
||||||
ansible-playbook -i <host>, misp.yml -k -K -u <user>
|
ansible-playbook -i <host>, misp.yml -k -K -u <user>
|
||||||
```
|
```
|
||||||
|
|
||||||
|
- If you want to move the MISP data location to <path> (MySQL database, MISP files and tmp), add the following parameter to ansible-playbook:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
--extra-vars "data_location=<path>"
|
||||||
|
```
|
||||||
|
|
||||||
- Update the self-signed certificate in /etc/nginx/ssl
|
- Update the self-signed certificate in /etc/nginx/ssl
|
||||||
- Create and export your GPG key:
|
- Create and export your GPG key:
|
||||||
|
|
||||||
|
|
3
misp.yml
3
misp.yml
|
@ -28,3 +28,6 @@
|
||||||
- name: enable_auto_backup
|
- name: enable_auto_backup
|
||||||
prompt: "Do you want to enable automatic backup everyday ? (y/n)"
|
prompt: "Do you want to enable automatic backup everyday ? (y/n)"
|
||||||
private: no
|
private: no
|
||||||
|
- name: install_modules
|
||||||
|
prompt: "Do you want to install misp-modules ? (y/n)"
|
||||||
|
private: no
|
|
@ -326,14 +326,20 @@
|
||||||
state: directory
|
state: directory
|
||||||
mode: "g=u"
|
mode: "g=u"
|
||||||
|
|
||||||
############ BACKUP ###########
|
####### BACKUP #######
|
||||||
|
|
||||||
- name: Configure and enable MISP backup
|
- name: Configure and enable MISP backup
|
||||||
include: backup.yml
|
include: backup.yml
|
||||||
when: enable_auto_backup == 'y'
|
when: enable_auto_backup == 'y'
|
||||||
|
|
||||||
####### NEW DATA LOCATION #####
|
####### NEW DATA LOCATION #######
|
||||||
|
|
||||||
- name: Change DATA location of MISP
|
- name: Change DATA location of MISP
|
||||||
include: new_data_location.yml
|
include: new_data_location.yml
|
||||||
when: data_location != '/opt/misp-server/misp/app'
|
when: data_location != '/opt/misp-server/misp/app'
|
||||||
|
|
||||||
|
####### MISP-MODULES #######
|
||||||
|
|
||||||
|
- name: Install misp-modules
|
||||||
|
include: modules.yml
|
||||||
|
when: install_modules == 'y'
|
|
@ -0,0 +1,50 @@
|
||||||
|
############################################
|
||||||
|
##### MISP-MODULES ####
|
||||||
|
############################################
|
||||||
|
|
||||||
|
- name: Install all needed packages
|
||||||
|
apt:
|
||||||
|
pkg: "{{ item }}"
|
||||||
|
state: latest
|
||||||
|
update_cache: yes
|
||||||
|
with_items:
|
||||||
|
- python3-dev
|
||||||
|
- python3-pip
|
||||||
|
- libpq5
|
||||||
|
- libjpeg-dev
|
||||||
|
- libjpeg8-dev
|
||||||
|
|
||||||
|
- name: Clone MISP-MODULES git
|
||||||
|
become: true
|
||||||
|
git:
|
||||||
|
repo: "https://github.com/MISP/misp-modules.git"
|
||||||
|
dest: "/usr/local/src/misp-modules"
|
||||||
|
recursive: yes
|
||||||
|
force: no
|
||||||
|
update: no
|
||||||
|
accept_hostkey: yes
|
||||||
|
|
||||||
|
- name: Install MISP-MODULES requirements
|
||||||
|
become: true
|
||||||
|
pip:
|
||||||
|
executable: pip3
|
||||||
|
requirements: "/usr/local/src/misp-modules/REQUIREMENTS"
|
||||||
|
environment:
|
||||||
|
TMPDIR: /opt/misp-server/tmp
|
||||||
|
register: mispmodules_requirements
|
||||||
|
|
||||||
|
- name: Upgrade MISP-MODULES requirements
|
||||||
|
become: True
|
||||||
|
args:
|
||||||
|
chdir: "/usr/local/src/misp-modules"
|
||||||
|
shell: "{{ item }}"
|
||||||
|
with_items:
|
||||||
|
- pip3 install --upgrade .
|
||||||
|
when: mysql_init.changed
|
||||||
|
|
||||||
|
- name: Check MISP worker autolaunch at boot
|
||||||
|
lineinfile:
|
||||||
|
state: present
|
||||||
|
dest: /etc/rc.local
|
||||||
|
insertbefore: "exit 0"
|
||||||
|
line: "sudo -u www-data misp-modules -s"
|
Loading…
Reference in New Issue