From 2aa480d94efe2638665c03b89ec98e15de19f6d1 Mon Sep 17 00:00:00 2001 From: Ondrej Lukas Date: Mon, 8 Sep 2025 15:29:08 +0200 Subject: [PATCH 1/3] Add new parameter in the documentation --- AIDojoCoordinator/docs/Components.md | 3 ++- AIDojoCoordinator/docs/Coordinator.md | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/AIDojoCoordinator/docs/Components.md b/AIDojoCoordinator/docs/Components.md index 1ac63276..bbe13c3d 100644 --- a/AIDojoCoordinator/docs/Components.md +++ b/AIDojoCoordinator/docs/Components.md @@ -61,7 +61,8 @@ ActionType is unique Enum that determines what kind of action is agent playing. ### List of actions - **JoinGame**, params={`agent_info`:AgentInfo(\, \)}: Used to register agent in a game with a given \. - **QuitGame**, params={}: Used for termination of agent's interaction. -- **ResetGame**, params={`request_trajectory`:`bool`}: Used for requesting reset of the game to it's initial position. If `request_trajectory = True`, the coordinator will send back the complete trajectory of the previous run in the next message. +- **ResetGame**, params={`request_trajectory`:`bool`(default=`False`), `randomize_topology`:`bool` (default=`False`)}: Used for requesting reset of the game to it's initial position. If `request_trajectory = True`, the coordinator will send back the complete trajectory of the previous run in the next message. +If `randomize_topology=True`, the agent requests randomization of IPs for the next episode. NOTE: randomization takes place only if all playing agents request it. --- - **ScanNetwork**, params{`source_host`:\, `target_network`:\}: Scans the given \ from a specified source host. Discovers ALL hosts in a network that are accessible from \. If successful, returns set of discovered \ objects. - **FindServices**, params={`source_host`:\, `target_host`:\}: Used to discover ALL services running in the `target_host` if the host is accessible from `source_host`. If successful, returns a set of all discovered \ objects. diff --git a/AIDojoCoordinator/docs/Coordinator.md b/AIDojoCoordinator/docs/Coordinator.md index bd7af93b..28a524fb 100644 --- a/AIDojoCoordinator/docs/Coordinator.md +++ b/AIDojoCoordinator/docs/Coordinator.md @@ -35,6 +35,7 @@ Coordinator, having the role of the middle man in all communication between the `self.agents`: information about connected agents {`agent address`: (`agent_name`,`agent_role`)} `self._agent_steps`: step counter for each agent in the current episode `self._reset_requests`: dictionary where requests for episode reset are collected (the world resets only if **all** active agents request reset) +`self._randomize_topology_requests`: dictionary where requests for topology randomization are collected (the world randomizes the topology only if **all** active agents request reset) `self._agent_observations`: current observation per agent `self._agent_starting_position`: starting position (with wildcards, see [configuration](../README.md#task-configuration)) per agent `self._agent_states`: current GameState per agent From 0b5ddc516380023e9ee8dcff6c917120a2d4d706 Mon Sep 17 00:00:00 2001 From: Ondrej Lukas Date: Tue, 9 Sep 2025 11:05:23 +0200 Subject: [PATCH 2/3] Disable dynamic addresses in the NetSecGame environment configuration as default option --- AIDojoCoordinator/netsecenv_conf.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AIDojoCoordinator/netsecenv_conf.yaml b/AIDojoCoordinator/netsecenv_conf.yaml index 0c161d30..6fd52eb1 100644 --- a/AIDojoCoordinator/netsecenv_conf.yaml +++ b/AIDojoCoordinator/netsecenv_conf.yaml @@ -99,7 +99,7 @@ env: # random_seed: 42 scenario: 'scenario1' use_global_defender: False - use_dynamic_addresses: True + use_dynamic_addresses: False use_firewall: True save_trajectories: False required_players: 1 From bb787adaa3c9af7537787b439b2717033c4f4a75 Mon Sep 17 00:00:00 2001 From: Ondrej Lukas Date: Tue, 9 Sep 2025 11:07:09 +0200 Subject: [PATCH 3/3] Set default randomize topology request to True for agents during reset --- AIDojoCoordinator/coordinator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AIDojoCoordinator/coordinator.py b/AIDojoCoordinator/coordinator.py index 6850972b..92d07034 100644 --- a/AIDojoCoordinator/coordinator.py +++ b/AIDojoCoordinator/coordinator.py @@ -551,7 +551,7 @@ async def _process_reset_game_action(self, agent_addr: tuple, reset_action:Actio # add reset request for this agent self._reset_requests[agent_addr] = True # register if the agent wants to randomize the topology - self._randomize_topology_requests[agent_addr] = reset_action.parameters.get("randomize_topology", False) + self._randomize_topology_requests[agent_addr] = reset_action.parameters.get("randomize_topology", True) if all(self._reset_requests.values()): # all agents want reset - reset the world self.logger.debug(f"All agents requested reset, setting the event")