Agent: Initialize IEventQueue

This commit is contained in:
Ilija Lazoroski 2022-08-12 10:11:37 +02:00
parent 5558d075be
commit 21c9ea9d44
2 changed files with 7 additions and 0 deletions

View File

@ -6,7 +6,10 @@ import sys
from pathlib import Path, WindowsPath from pathlib import Path, WindowsPath
from typing import List from typing import List
from pubsub.core import Publisher
import infection_monkey.tunnel as tunnel import infection_monkey.tunnel as tunnel
from common.event_queue import PyPubSubEventQueue
from common.network.network_utils import address_to_ip_port from common.network.network_utils import address_to_ip_port
from common.utils.argparse_types import positive_int from common.utils.argparse_types import positive_int
from common.utils.attack_utils import ScanStatus, UsageEnum from common.utils.attack_utils import ScanStatus, UsageEnum
@ -103,6 +106,7 @@ class InfectionMonkey:
self._current_depth = self._opts.depth self._current_depth = self._opts.depth
self._master = None self._master = None
self._inbound_tunnel_opened = False self._inbound_tunnel_opened = False
self._event_queue = None
@staticmethod @staticmethod
def _get_arguments(args): def _get_arguments(args):
@ -194,6 +198,8 @@ class InfectionMonkey:
def _build_master(self): def _build_master(self):
local_network_interfaces = InfectionMonkey._get_local_network_interfaces() local_network_interfaces = InfectionMonkey._get_local_network_interfaces()
self._event_queue = PyPubSubEventQueue(Publisher())
# TODO control_channel and control_client have same responsibilities, merge them # TODO control_channel and control_client have same responsibilities, merge them
control_channel = ControlChannel( control_channel = ControlChannel(
self._control_client.server_address, GUID, self._control_client.proxies self._control_client.server_address, GUID, self._control_client.proxies

View File

@ -213,6 +213,7 @@ _make_simulation # unused method (monkey/monkey_island/cc/models/simulation.py:
# TODO DELETE AFTER EVENT QUEUE IMPLEMENTATION # TODO DELETE AFTER EVENT QUEUE IMPLEMENTATION
AbstractEvent AbstractEvent
tags tags
_event_queue
# TODO DELETE AFTER RESOURCE REFACTORING # TODO DELETE AFTER RESOURCE REFACTORING