Island: Setup EventSerializerRegistry
This commit is contained in:
parent
5905d3bf5b
commit
ca23c94c8e
|
@ -23,6 +23,10 @@ if str(MONKEY_ISLAND_DIR_BASE_PATH) not in sys.path:
|
||||||
sys.path.insert(0, MONKEY_ISLAND_DIR_BASE_PATH)
|
sys.path.insert(0, MONKEY_ISLAND_DIR_BASE_PATH)
|
||||||
|
|
||||||
from common import DIContainer # noqa: E402
|
from common import DIContainer # noqa: E402
|
||||||
|
from common.event_serializers import ( # noqa: E402
|
||||||
|
EventSerializerRegistry,
|
||||||
|
register_common_agent_event_serializers,
|
||||||
|
)
|
||||||
from common.version import get_version # noqa: E402
|
from common.version import get_version # noqa: E402
|
||||||
from monkey_island.cc.app import init_app # noqa: E402
|
from monkey_island.cc.app import init_app # noqa: E402
|
||||||
from monkey_island.cc.arg_parser import IslandCmdArgs # noqa: E402
|
from monkey_island.cc.arg_parser import IslandCmdArgs # noqa: E402
|
||||||
|
@ -59,6 +63,7 @@ def run_monkey_island():
|
||||||
_send_analytics(deployment, version)
|
_send_analytics(deployment, version)
|
||||||
container = _initialize_di_container(ip_addresses, version, config_options.data_dir)
|
container = _initialize_di_container(ip_addresses, version, config_options.data_dir)
|
||||||
setup_island_event_handlers(container)
|
setup_island_event_handlers(container)
|
||||||
|
_setup_agent_event_serializers(container)
|
||||||
|
|
||||||
_initialize_mongodb_connection(config_options.start_mongodb, config_options.data_dir)
|
_initialize_mongodb_connection(config_options.start_mongodb, config_options.data_dir)
|
||||||
_start_island_server(ip_addresses, island_args.setup_only, config_options, container)
|
_start_island_server(ip_addresses, island_args.setup_only, config_options, container)
|
||||||
|
@ -129,6 +134,13 @@ def _initialize_di_container(
|
||||||
return container
|
return container
|
||||||
|
|
||||||
|
|
||||||
|
def _setup_agent_event_serializers(container: DIContainer):
|
||||||
|
agent_event_serializer_registry = EventSerializerRegistry()
|
||||||
|
register_common_agent_event_serializers(agent_event_serializer_registry)
|
||||||
|
|
||||||
|
container.register_instance(EventSerializerRegistry, agent_event_serializer_registry)
|
||||||
|
|
||||||
|
|
||||||
def _initialize_mongodb_connection(start_mongodb: bool, data_dir: Path):
|
def _initialize_mongodb_connection(start_mongodb: bool, data_dir: Path):
|
||||||
mongo_db_process = None
|
mongo_db_process = None
|
||||||
if start_mongodb:
|
if start_mongodb:
|
||||||
|
|
Loading…
Reference in New Issue