diff --git a/AIDojoCoordinator/worlds/NSEGameCoordinator.py b/AIDojoCoordinator/worlds/NSEGameCoordinator.py index 0917b99a..dd64106b 100644 --- a/AIDojoCoordinator/worlds/NSEGameCoordinator.py +++ b/AIDojoCoordinator/worlds/NSEGameCoordinator.py @@ -27,6 +27,7 @@ def __init__(self, game_host, game_port, task_config:str, allowed_roles=["Attack self._networks = {} # A `dict` of the networks present in the environment. Keys: `Network` objects, values `set` of `IP` objects. self._services = {} # Dict of all services in the environment. Keys: hostname (`str`), values: `set` of `Service` objetcs. self._data = {} # Dict of all services in the environment. Keys: hostname (`str`), values `set` of `Service` objetcs. + self._data_content = {} # ??? Not sure. Added by by sebas to fix error in reading config file self._firewall = {} # dict of all the allowed connections in the environment. Keys `IP` ,values: `set` of `IP` objects. self._fw_blocks = {} self._agent_fw_rules = {} @@ -53,6 +54,7 @@ def _initialize(self)->None: Faker.seed(self._seed) # store initial values for parts which are modified during the game self._data_original = copy.deepcopy(self._data) + self._data_content_original = copy.deepcopy(self._data_content) self._firewall_original = copy.deepcopy(self._firewall) self.logger.info("Environment initialization finished") @@ -229,6 +231,7 @@ def process_node_config(node_obj:NodeConfig) -> None: self.logger.info(f"\t\t\tProcessing data in node '{node_obj.id}':'{service.name}' service") try: for data in service.private_data: + self.logger.info(f"\t\t\t\tData: {data}") if node_obj.id not in self._data: self._data[node_obj.id] = set() datapoint = Data(data.owner, data.description) @@ -236,8 +239,9 @@ def process_node_config(node_obj:NodeConfig) -> None: # add content self._data_content[node_obj.id, datapoint.id] = f"Content of {datapoint.id}" except AttributeError: + # Service does not contain any data pass - #service does not contain any data + def process_router_config(router_obj:RouterConfig)->None: self.logger.info(f"\tProcessing config of router '{router_obj.id}'") # Process a router @@ -920,6 +924,7 @@ async def reset(self)->bool: # reset self._data to orignal state self._data = copy.deepcopy(self._data_original) # reset self._data_content to orignal state + self._data_content = copy.deepcopy(self._data_content_original) # reset all firewall related data structure self._firewall = copy.deepcopy(self._firewall_original) self._fw_blocks = {}