-
Notifications
You must be signed in to change notification settings - Fork 0
/
__init__.py
24 lines (22 loc) · 1.02 KB
/
__init__.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
"""AUCR yara plugin."""
# coding=utf-8
import os
from multiprocessing import Process
from aucr_app.plugins.tasks.mq import get_a_task_mq
from aucr_app.plugins.yara_plugin.yara_processing import call_back
from aucr_app.plugins.yara_plugin.routes import yara_page
from aucr_app.plugins.yara_plugin.api.rules import rules_api_page
from aucr_app.plugins.yara_plugin import models
def load(app):
"""AUCR Yara plugin flask app blueprint registration."""
app.register_blueprint(yara_page, url_prefix='/yara')
app.register_blueprint(rules_api_page, url_prefix='/yara_rules')
yara_processor = os.environ.get('YARA_PROCESSOR')
tasks = "yararesults"
rabbitmq_server = os.environ.get('RABBITMQ_SERVER')
rabbitmq_username = os.environ.get('RABBITMQ_USERNAME')
rabbitmq_password = os.environ.get('RABBITMQ_PASSWORD')
if yara_processor:
p = Process(target=get_a_task_mq, args=(tasks, call_back, rabbitmq_server, rabbitmq_username,
rabbitmq_password))
p.start()