소스 검색

Add misp-module automatic installation

pull/3/head
Mathieu Deloitte 4 년 전
부모
커밋
24454c64d6
4개의 변경된 파일71개의 추가작업 그리고 2개의 파일을 삭제
  1. +10
    -0
      README.md
  2. +3
    -0
      misp.yml
  3. +8
    -2
      roles/misp/tasks/main.yml
  4. +50
    -0
      roles/misp/tasks/modules.yml

+ 10
- 0
README.md 파일 보기

@@ -1,6 +1,10 @@
MISP - Ansible installation script
----------------------------------------

- V0.2
* Data location management
* misp-modules installation

- V0.1
* Nginx support only
* Backup script provided
@@ -13,6 +17,12 @@ Instructions
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
- Create and export your GPG key:



+ 3
- 0
misp.yml 파일 보기

@@ -27,4 +27,7 @@
private: yes
- name: enable_auto_backup
prompt: "Do you want to enable automatic backup everyday ? (y/n)"
private: no
- name: install_modules
prompt: "Do you want to install misp-modules ? (y/n)"
private: no

+ 8
- 2
roles/misp/tasks/main.yml 파일 보기

@@ -326,14 +326,20 @@
state: directory
mode: "g=u"

############ BACKUP ###########
####### BACKUP #######

- name: Configure and enable MISP backup
include: backup.yml
when: enable_auto_backup == 'y'

####### NEW DATA LOCATION #####
####### NEW DATA LOCATION #######

- name: Change DATA location of MISP
include: new_data_location.yml
when: data_location != '/opt/misp-server/misp/app'

####### MISP-MODULES #######

- name: Install misp-modules
include: modules.yml
when: install_modules == 'y'

+ 50
- 0
roles/misp/tasks/modules.yml 파일 보기

@@ -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"

불러오는 중...
취소
저장