-
Notifications
You must be signed in to change notification settings - Fork 22
/
malwoverview.sls
71 lines (65 loc) · 2.21 KB
/
malwoverview.sls
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# Name: malwoverview
# Website: https://github.com/alexandreborges/malwoverview
# Description: Query public repositories of malware data (e.g., VirusTotal, HybridAnalysis).
# Category: Gather and Analyze Data
# Author: Alexandre Borges
# License: GNU General Public License v3: https://github.com/alexandreborges/malwoverview/blob/master/LICENSE
# Notes: malwoverview, add API keys to ~/.malwapi.conf
{%- if grains['oscodename'] == "bionic" %}
{%- set python3_version="python3.6" %}
{%- else %}
{%- set python3_version="python3.8" %}
{% endif %}
{%- set user = salt['pillar.get']('remnux_user', 'remnux') -%}
{% if user == "root" %}
{% set home = "/root" %}
{% else %}
{% set home = "/home/" + user %}
{% endif %}
include:
- remnux.python3-packages.pip
- remnux.packages.git
- remnux.config.user
- remnux.packages.virtualenv
- remnux.packages.build-essential
remnux-python3-packages-malwoverview-virtualenv:
virtualenv.managed:
- name: /opt/malwoverview
- venv_bin: /usr/bin/virtualenv
- pip_pkgs:
- pip
- setuptools
- wheel
- require:
- sls: remnux.python3-packages.pip
- sls: remnux.packages.virtualenv
remnux-python3-packages-malwoverview-install:
pip.installed:
- name: malwoverview
- bin_env: /opt/malwoverview/bin/python3
- upgrade: True
- user: root
- require:
- sls: remnux.python3-packages.pip
- virtualenv: remnux-python3-packages-malwoverview-virtualenv
- sls: remnux.packages.git
- sls: remnux.config.user
remnux-python3-packages-malwoverview-config-file:
file.managed:
- name: {{ home }}/.malwapi.conf
- source: /opt/malwoverview/lib/{{ python3_version }}/site-packages/root/.malwapi.conf
- user: {{ user }}
- group: {{ user }}
- makedirs: False
- require:
- sls: remnux.config.user
- user: remnux-user-{{ user }}
- pip: remnux-python3-packages-malwoverview-install
- virtualenv: remnux-python3-packages-malwoverview-virtualenv
remnux-python3-packages-malwoverview-symlink:
file.symlink:
- name: /usr/local/bin/malwoverview
- target: /opt/malwoverview/bin/malwoverview
- force: true
- require:
- file: remnux-python3-packages-malwoverview-config-file