Beispiel #1
0
import time as time
import yaml as yaml

# product
import mir.script_runner.script_runner as sr
import mir.script_runner.test.db as testdb
import mir.script_runner.test.xmlrpcproxy as testindexer
import mir.models as models
import mir.log_service as log_service
import mir.identity as identity
import mir.config as config
import mandiant.windtalker.message_bus_injector as mbus_factory
import mir.util.dtutil as mir_datetime
import mir.script_runner.execution_node as en

config_data = config.MirConfig("mir")
# add configs for services we use
config_data.loadServiceConfig('agentcontroller')
config_data.loadServiceConfig('fileserver')
config_data.loadServiceConfig('search')
config_data.loadServiceConfig('scriptrunner')
config_data.loadServiceConfig('analyzer')
config_data.loadServiceConfig('scheduler')

base.DelayedCall.debug = True


class ScriptRunnerTests(unittest.TestCase):
    timeout = 5  # Set a default timeout
    script_runner = None
Beispiel #2
0
import mandiant.timekeeper.timekeeper as timekeeper

# Mir Modules
import mir.config as config
import mir.models.interface.connector.message_bus as mbc
import mir.models.interface as interface
import mir.models.models2 as models
import mir.identity as identity
import mir.util.dtutil as mir_datetime
import mir.script_runner.execution_node as execution_node
import mir.util.issues as isu
import mir.error_messages as mir_err
from mir.file_service.file_provider import FileProvider

# load the config for this service
config_data = config.MirConfig("scriptrunner")
config_data.loadServiceConfig('mir_web')
config_data.loadServiceConfig('agent_dispatcher')
config_data.loadServiceConfig('analyzer_dispatcher')

MND_error_message_code = 'SCR'
MND_error_messages = {
    'a4c2507a-6ca6-448f-84c5-7bdf0aacc57d': {
        'msg':
        'Script Runner: Received message to kick off queue %(queue_ident)s',
        'args': {
            'level': 'info'
        }
    },
    'f6df4220-be64-4d2c-aa2e-f36e154f65d3': {
        'msg':