diff --git a/src/primaite/config/_package_data/data_manipulation.yaml b/src/primaite/config/_package_data/data_manipulation.yaml index f2e8938b..deda5d73 100644 --- a/src/primaite/config/_package_data/data_manipulation.yaml +++ b/src/primaite/config/_package_data/data_manipulation.yaml @@ -756,8 +756,7 @@ simulation: - DELETE nodes: - - ref: router_1 - hostname: router_1 + - hostname: router_1 type: router num_ports: 5 ports: @@ -792,74 +791,61 @@ simulation: action: PERMIT protocol: ICMP - - ref: switch_1 - hostname: switch_1 + - hostname: switch_1 type: switch num_ports: 8 - - ref: switch_2 - hostname: switch_2 + - hostname: switch_2 type: switch num_ports: 8 - - ref: domain_controller - hostname: domain_controller + - hostname: domain_controller type: server ip_address: 192.168.1.10 subnet_mask: 255.255.255.0 default_gateway: 192.168.1.1 services: - - ref: domain_controller_dns_server - type: DNSServer + - type: DNSServer options: domain_mapping: arcd.com: 192.168.1.12 # web server - - ref: web_server - hostname: web_server + - hostname: web_server type: server ip_address: 192.168.1.12 subnet_mask: 255.255.255.0 default_gateway: 192.168.1.1 dns_server: 192.168.1.10 services: - - ref: web_server_web_service - type: WebServer + - type: WebServer applications: - - ref: web_server_database_client - type: DatabaseClient + - type: DatabaseClient options: db_server_ip: 192.168.1.14 - - ref: database_server - hostname: database_server + - hostname: database_server type: server ip_address: 192.168.1.14 subnet_mask: 255.255.255.0 default_gateway: 192.168.1.1 dns_server: 192.168.1.10 services: - - ref: database_service - type: DatabaseService + - type: DatabaseService options: backup_server_ip: 192.168.1.16 - - ref: database_ftp_client - type: FTPClient + - type: FTPClient - - ref: backup_server - hostname: backup_server + - hostname: backup_server type: server ip_address: 192.168.1.16 subnet_mask: 255.255.255.0 default_gateway: 192.168.1.1 dns_server: 192.168.1.10 services: - - ref: backup_service - type: FTPServer + - type: FTPServer - - ref: security_suite - hostname: security_suite + - hostname: security_suite type: server ip_address: 192.168.1.110 subnet_mask: 255.255.255.0 @@ -870,59 +856,49 @@ simulation: ip_address: 192.168.10.110 subnet_mask: 255.255.255.0 - - ref: client_1 - hostname: client_1 + - hostname: client_1 type: computer ip_address: 192.168.10.21 subnet_mask: 255.255.255.0 default_gateway: 192.168.10.1 dns_server: 192.168.1.10 applications: - - ref: data_manipulation_bot - type: DataManipulationBot + - type: DataManipulationBot options: port_scan_p_of_success: 0.8 data_manipulation_p_of_success: 0.8 payload: "DELETE" server_ip: 192.168.1.14 - - ref: client_1_web_browser - type: WebBrowser + - type: WebBrowser options: target_url: http://arcd.com/users/ - - ref: client_1_database_client - type: DatabaseClient + - type: DatabaseClient options: db_server_ip: 192.168.1.14 services: - - ref: client_1_dns_client - type: DNSClient + - type: DNSClient - - ref: client_2 - hostname: client_2 + - hostname: client_2 type: computer ip_address: 192.168.10.22 subnet_mask: 255.255.255.0 default_gateway: 192.168.10.1 dns_server: 192.168.1.10 applications: - - ref: client_2_web_browser - type: WebBrowser + - type: WebBrowser options: target_url: http://arcd.com/users/ - - ref: data_manipulation_bot - type: DataManipulationBot + - type: DataManipulationBot options: port_scan_p_of_success: 0.8 data_manipulation_p_of_success: 0.8 payload: "DELETE" server_ip: 192.168.1.14 - - ref: client_2_database_client - type: DatabaseClient + - type: DatabaseClient options: db_server_ip: 192.168.1.14 services: - - ref: client_2_dns_client - type: DNSClient + - type: DNSClient links: - endpoint_a_hostname: router_1 diff --git a/src/primaite/config/_package_data/data_manipulation_marl.yaml b/src/primaite/config/_package_data/data_manipulation_marl.yaml index ee9f094f..653ddfd3 100644 --- a/src/primaite/config/_package_data/data_manipulation_marl.yaml +++ b/src/primaite/config/_package_data/data_manipulation_marl.yaml @@ -1334,8 +1334,7 @@ simulation: - DELETE nodes: - - ref: router_1 - hostname: router_1 + - hostname: router_1 type: router num_ports: 5 ports: @@ -1370,74 +1369,61 @@ simulation: action: PERMIT protocol: ICMP - - ref: switch_1 - hostname: switch_1 + - hostname: switch_1 type: switch num_ports: 8 - - ref: switch_2 - hostname: switch_2 + - hostname: switch_2 type: switch num_ports: 8 - - ref: domain_controller - hostname: domain_controller + - hostname: domain_controller type: server ip_address: 192.168.1.10 subnet_mask: 255.255.255.0 default_gateway: 192.168.1.1 services: - - ref: domain_controller_dns_server - type: DNSServer + - type: DNSServer options: domain_mapping: arcd.com: 192.168.1.12 # web server - - ref: web_server - hostname: web_server + - hostname: web_server type: server ip_address: 192.168.1.12 subnet_mask: 255.255.255.0 default_gateway: 192.168.1.1 dns_server: 192.168.1.10 services: - - ref: web_server_web_service - type: WebServer + - type: WebServer applications: - - ref: web_server_database_client - type: DatabaseClient + - type: DatabaseClient options: db_server_ip: 192.168.1.14 - - ref: database_server - hostname: database_server + - hostname: database_server type: server ip_address: 192.168.1.14 subnet_mask: 255.255.255.0 default_gateway: 192.168.1.1 dns_server: 192.168.1.10 services: - - ref: database_service - type: DatabaseService + - type: DatabaseService options: backup_server_ip: 192.168.1.16 - - ref: database_ftp_client - type: FTPClient + - type: FTPClient - - ref: backup_server - hostname: backup_server + - hostname: backup_server type: server ip_address: 192.168.1.16 subnet_mask: 255.255.255.0 default_gateway: 192.168.1.1 dns_server: 192.168.1.10 services: - - ref: backup_service - type: FTPServer + - type: FTPServer - - ref: security_suite - hostname: security_suite + - hostname: security_suite type: server ip_address: 192.168.1.110 subnet_mask: 255.255.255.0 @@ -1448,59 +1434,49 @@ simulation: ip_address: 192.168.10.110 subnet_mask: 255.255.255.0 - - ref: client_1 - hostname: client_1 + - hostname: client_1 type: computer ip_address: 192.168.10.21 subnet_mask: 255.255.255.0 default_gateway: 192.168.10.1 dns_server: 192.168.1.10 applications: - - ref: data_manipulation_bot - type: DataManipulationBot + - type: DataManipulationBot options: port_scan_p_of_success: 0.8 data_manipulation_p_of_success: 0.8 payload: "DELETE" server_ip: 192.168.1.14 - - ref: client_1_web_browser - type: WebBrowser + - type: WebBrowser options: target_url: http://arcd.com/users/ - - ref: client_1_database_client - type: DatabaseClient + - type: DatabaseClient options: db_server_ip: 192.168.1.14 services: - - ref: client_1_dns_client - type: DNSClient + - type: DNSClient - - ref: client_2 - hostname: client_2 + - hostname: client_2 type: computer ip_address: 192.168.10.22 subnet_mask: 255.255.255.0 default_gateway: 192.168.10.1 dns_server: 192.168.1.10 applications: - - ref: client_2_web_browser - type: WebBrowser + - type: WebBrowser options: target_url: http://arcd.com/users/ - - ref: data_manipulation_bot - type: DataManipulationBot + - type: DataManipulationBot options: port_scan_p_of_success: 0.8 data_manipulation_p_of_success: 0.8 payload: "DELETE" server_ip: 192.168.1.14 - - ref: client_2_database_client - type: DatabaseClient + - type: DatabaseClient options: db_server_ip: 192.168.1.14 services: - - ref: client_2_dns_client - type: DNSClient + - ty DNSClient diff --git a/src/primaite/game/game.py b/src/primaite/game/game.py index bfbffc4d..f069433e 100644 --- a/src/primaite/game/game.py +++ b/src/primaite/game/game.py @@ -102,15 +102,6 @@ class PrimaiteGame: self.options: PrimaiteGameOptions """Special options that apply for the entire game.""" - self.ref_map_nodes: Dict[str, str] = {} - """Mapping from unique node reference name to node object. Used when parsing config files.""" - - self.ref_map_services: Dict[str, str] = {} - """Mapping from human-readable service reference to service object. Used for parsing config files.""" - - self.ref_map_applications: Dict[str, str] = {} - """Mapping from human-readable application reference to application object. Used for parsing config files.""" - self.save_step_metadata: bool = False """Whether to save the RL agents' action, environment state, and other data at every single step.""" @@ -235,7 +226,6 @@ class PrimaiteGame: links_cfg = network_config.get("links", []) for node_cfg in nodes_cfg: - node_ref = node_cfg["ref"] n_type = node_cfg["type"] if n_type == "computer": new_node = Computer( @@ -286,13 +276,11 @@ class PrimaiteGame: if "services" in node_cfg: for service_cfg in node_cfg["services"]: new_service = None - service_ref = service_cfg["ref"] service_type = service_cfg["type"] if service_type in SERVICE_TYPES_MAPPING: _LOGGER.debug(f"installing {service_type} on node {new_node.hostname}") new_node.software_manager.install(SERVICE_TYPES_MAPPING[service_type]) new_service = new_node.software_manager.software[service_type] - game.ref_map_services[service_ref] = new_service.uuid # start the service new_service.start() @@ -328,13 +316,11 @@ class PrimaiteGame: if "applications" in node_cfg: for application_cfg in node_cfg["applications"]: new_application = None - application_ref = application_cfg["ref"] application_type = application_cfg["type"] if application_type in APPLICATION_TYPES_MAPPING: new_node.software_manager.install(APPLICATION_TYPES_MAPPING[application_type]) new_application = new_node.software_manager.software[application_type] - game.ref_map_applications[application_ref] = new_application.uuid else: msg = f"Configuration contains an invalid application type: {application_type}" _LOGGER.error(msg) @@ -388,7 +374,6 @@ class PrimaiteGame: # run through the power on step if the node is to be turned on at the start if new_node.operating_state == NodeOperatingState.ON: new_node.power_on() - game.ref_map_nodes[node_ref] = new_node.uuid # set start up and shut down duration new_node.start_up_duration = int(node_cfg.get("start_up_duration", 3)) diff --git a/tests/assets/configs/bad_primaite_session.yaml b/tests/assets/configs/bad_primaite_session.yaml index 493b0452..7d85ea9f 100644 --- a/tests/assets/configs/bad_primaite_session.yaml +++ b/tests/assets/configs/bad_primaite_session.yaml @@ -551,8 +551,7 @@ simulation: network: nodes: - - ref: router_1 - type: router + - type: router hostname: router_1 num_ports: 5 ports: @@ -579,70 +578,58 @@ simulation: action: PERMIT protocol: ICMP - - ref: switch_1 - type: switch + - type: switch hostname: switch_1 num_ports: 8 - - ref: switch_2 - type: switch + - type: switch hostname: switch_2 num_ports: 8 - - ref: domain_controller - type: server + - type: server hostname: domain_controller ip_address: 192.168.1.10 subnet_mask: 255.255.255.0 default_gateway: 192.168.1.1 services: - - ref: domain_controller_dns_server - type: DNSServer + - type: DNSServer options: domain_mapping: arcd.com: 192.168.1.12 # web server - - ref: web_server - type: server + - type: server hostname: web_server ip_address: 192.168.1.12 subnet_mask: 255.255.255.0 default_gateway: 192.168.1.1 dns_server: 192.168.1.10 services: - - ref: web_server_web_service - type: WebServer + - type: WebServer applications: - - ref: web_server_database_client - type: DatabaseClient + - type: DatabaseClient options: db_server_ip: 192.168.1.14 - - ref: database_server - type: server + - type: server hostname: database_server ip_address: 192.168.1.14 subnet_mask: 255.255.255.0 default_gateway: 192.168.1.1 dns_server: 192.168.1.10 services: - - ref: database_service - type: DatabaseService + - type: DatabaseService - - ref: backup_server - type: server + - type: server hostname: backup_server ip_address: 192.168.1.16 subnet_mask: 255.255.255.0 default_gateway: 192.168.1.1 dns_server: 192.168.1.10 services: - - ref: backup_service - type: FTPServer + - type: FTPServer - - ref: security_suite - type: server + - type: server hostname: security_suite ip_address: 192.168.1.110 subnet_mask: 255.255.255.0 @@ -653,38 +640,32 @@ simulation: ip_address: 192.168.10.110 subnet_mask: 255.255.255.0 - - ref: client_1 - type: computer + - type: computer hostname: client_1 ip_address: 192.168.10.21 subnet_mask: 255.255.255.0 default_gateway: 192.168.10.1 dns_server: 192.168.1.10 applications: - - ref: data_manipulation_bot - type: DataManipulationBot + - type: DataManipulationBot options: port_scan_p_of_success: 0.1 data_manipulation_p_of_success: 0.1 payload: "DELETE" server_ip: 192.168.1.14 services: - - ref: client_1_dns_client - type: DNSClient + - type: DNSClient - - ref: client_2 - type: computer + - type: computer hostname: client_2 ip_address: 192.168.10.22 subnet_mask: 255.255.255.0 default_gateway: 192.168.10.1 dns_server: 192.168.1.10 applications: - - ref: client_2_web_browser - type: WebBrowser + - type: WebBrowser services: - - ref: client_2_dns_client - type: DNSClient + - type: DNSClient links: - endpoint_a_hostname: router_1 diff --git a/tests/assets/configs/basic_firewall.yaml b/tests/assets/configs/basic_firewall.yaml index 3aa2ca2d..0512fbe1 100644 --- a/tests/assets/configs/basic_firewall.yaml +++ b/tests/assets/configs/basic_firewall.yaml @@ -79,8 +79,7 @@ simulation: network: nodes: - - ref: firewall - type: firewall + - type: firewall hostname: firewall start_up_duration: 0 shut_down_duration: 0 @@ -133,25 +132,21 @@ simulation: action: PERMIT protocol: ICMP - - ref: switch_1 - type: switch + - type: switch hostname: switch_1 num_ports: 8 - - ref: switch_2 - type: switch + - type: switch hostname: switch_2 num_ports: 8 - - ref: client_1 - type: computer + - type: computer hostname: client_1 ip_address: 192.168.10.21 subnet_mask: 255.255.255.0 default_gateway: 192.168.10.1 dns_server: 192.168.1.10 # pre installed services and applications - - ref: client_2 - type: computer + - type: computer hostname: client_2 ip_address: 192.168.10.22 subnet_mask: 255.255.255.0 @@ -160,23 +155,19 @@ simulation: # pre installed services and applications links: - - ref: switch_1___client_1 - endpoint_a_hostname: switch_1 + - endpoint_a_hostname: switch_1 endpoint_a_port: 1 endpoint_b_hostname: client_1 endpoint_b_port: 1 - - ref: switch_2___client_2 - endpoint_a_hostname: switch_2 + - endpoint_a_hostname: switch_2 endpoint_a_port: 1 endpoint_b_hostname: client_2 endpoint_b_port: 1 - - ref: switch_1___firewall - endpoint_a_hostname: switch_1 + - endpoint_a_hostname: switch_1 endpoint_a_port: 2 endpoint_b_hostname: firewall endpoint_b_port: 1 - - ref: switch_2___firewall - endpoint_a_hostname: switch_2 + - endpoint_a_hostname: switch_2 endpoint_a_port: 2 endpoint_b_hostname: firewall endpoint_b_port: 2 diff --git a/tests/assets/configs/basic_switched_network.yaml b/tests/assets/configs/basic_switched_network.yaml index ab55a6ed..bbc45de2 100644 --- a/tests/assets/configs/basic_switched_network.yaml +++ b/tests/assets/configs/basic_switched_network.yaml @@ -79,79 +79,64 @@ simulation: network: nodes: - - ref: switch_1 - type: switch + - type: switch hostname: switch_1 num_ports: 8 - - ref: client_1 + - hostname: client_1 type: computer - hostname: client_1 ip_address: 192.168.10.21 subnet_mask: 255.255.255.0 default_gateway: 192.168.10.1 dns_server: 192.168.1.10 applications: - - ref: client_1_web_browser - type: WebBrowser + - type: WebBrowser options: target_url: http://arcd.com/users/ - - ref: client_1_database_client - type: DatabaseClient + - type: DatabaseClient options: db_server_ip: 192.168.1.10 server_password: arcd - - ref: data_manipulation_bot - type: DataManipulationBot + - type: DataManipulationBot options: port_scan_p_of_success: 0.8 data_manipulation_p_of_success: 0.8 payload: "DELETE" server_ip: 192.168.1.21 server_password: arcd - - ref: dos_bot - type: DoSBot + - type: DoSBot options: target_ip_address: 192.168.10.21 payload: SPOOF DATA port_scan_p_of_success: 0.8 services: - - ref: client_1_dns_client - type: DNSClient + - type: DNSClient options: dns_server: 192.168.1.10 - - ref: client_1_dns_server - type: DNSServer + - type: DNSServer options: domain_mapping: arcd.com: 192.168.1.10 - - ref: client_1_database_service - type: DatabaseService + - type: DatabaseService options: backup_server_ip: 192.168.1.10 - - ref: client_1_web_service - type: WebServer - - ref: client_1_ftp_server - type: FTPServer + - type: WebServer + - type: FTPServer options: server_password: arcd - - ref: client_1_ntp_client - type: NTPClient + - type: NTPClient options: ntp_server_ip: 192.168.1.10 - - ref: client_1_ntp_server - type: NTPServer - - ref: client_2 + - type: NTPServer + - hostname: client_2 type: computer - hostname: client_2 ip_address: 192.168.10.22 subnet_mask: 255.255.255.0 default_gateway: 192.168.10.1 dns_server: 192.168.1.10 # pre installed services and applications - - ref: client_3 + - hostname: client_3 type: computer - hostname: client_3 ip_address: 192.168.10.23 subnet_mask: 255.255.255.0 default_gateway: 192.168.10.1 diff --git a/tests/assets/configs/dmz_network.yaml b/tests/assets/configs/dmz_network.yaml index 0930bc7d..2ce722f7 100644 --- a/tests/assets/configs/dmz_network.yaml +++ b/tests/assets/configs/dmz_network.yaml @@ -104,8 +104,7 @@ agents: simulation: network: nodes: - - ref: client_1 - type: computer + - type: computer hostname: client_1 ip_address: 192.168.0.10 subnet_mask: 255.255.255.0 @@ -114,15 +113,13 @@ simulation: start_up_duration: 0 shut_down_duration: 0 - - ref: switch_1 - type: switch + - type: switch hostname: switch_1 num_ports: 8 start_up_duration: 0 shut_down_duration: 0 - - ref: router_1 - type: router + - type: router hostname: router_1 num_ports: 5 start_up_duration: 0 @@ -156,8 +153,7 @@ simulation: next_hop_ip_address: 192.168.1.2 metric: 0 - - ref: dmz_server - type: server + - type: server hostname: dmz_server ip_address: 192.168.10.10 subnet_mask: 255.255.255.0 @@ -166,15 +162,13 @@ simulation: start_up_duration: 0 shut_down_duration: 0 - - ref: switch_2 - type: switch + - type: switch hostname: switch_2 num_ports: 8 start_up_duration: 0 shut_down_duration: 0 - - ref: firewall - type: firewall + - type: firewall hostname: firewall start_up_duration: 0 shut_down_duration: 0 @@ -237,15 +231,13 @@ simulation: next_hop_ip_address: 192.168.1.1 metric: 0 - - ref: switch_3 - type: switch + - type: switch hostname: switch_3 num_ports: 8 start_up_duration: 0 shut_down_duration: 0 - - ref: external_computer - type: computer + - type: computer hostname: external_computer ip_address: 192.168.20.10 subnet_mask: 255.255.255.0 @@ -254,8 +246,7 @@ simulation: start_up_duration: 0 shut_down_duration: 0 - - ref: external_server - type: server + - type: server hostname: external_server ip_address: 192.168.20.11 subnet_mask: 255.255.255.0 @@ -263,46 +254,37 @@ simulation: start_up_duration: 0 shut_down_duration: 0 services: - - ref: domain_controller_dns_server - type: DNSServer + - type: DNSServer links: - - ref: client_1___switch_1 - endpoint_a_hostname: client_1 + - endpoint_a_hostname: client_1 endpoint_a_port: 1 endpoint_b_hostname: switch_1 endpoint_b_port: 1 - - ref: router_1___switch_1 - endpoint_a_hostname: router_1 + - endpoint_a_hostname: router_1 endpoint_a_port: 1 endpoint_b_hostname: switch_1 endpoint_b_port: 8 - - ref: router_1___firewall - endpoint_a_hostname: firewall + - endpoint_a_hostname: firewall endpoint_a_port: 2 # internal firewall port endpoint_b_hostname: router_1 endpoint_b_port: 2 - - ref: firewall___switch_2 - endpoint_a_hostname: firewall + - endpoint_a_hostname: firewall endpoint_a_port: 3 # dmz firewall port endpoint_b_hostname: switch_2 endpoint_b_port: 8 - - ref: dmz_server___switch_2 - endpoint_a_hostname: dmz_server + - endpoint_a_hostname: dmz_server endpoint_a_port: 1 endpoint_b_hostname: switch_2 endpoint_b_port: 1 - - ref: firewall___switch_3 - endpoint_a_hostname: firewall + - endpoint_a_hostname: firewall endpoint_a_port: 1 # external firewall port endpoint_b_hostname: switch_3 endpoint_b_port: 8 - - ref: external_computer___switch_3 - endpoint_a_hostname: external_computer + - endpoint_a_hostname: external_computer endpoint_a_port: 1 endpoint_b_hostname: switch_3 endpoint_b_port: 1 - - ref: external_server___switch_3 - endpoint_a_hostname: external_server + - endpoint_a_hostname: external_server endpoint_a_port: 1 endpoint_b_hostname: switch_3 endpoint_b_port: 2 diff --git a/tests/assets/configs/eval_only_primaite_session.yaml b/tests/assets/configs/eval_only_primaite_session.yaml index 918f00ca..f05e3390 100644 --- a/tests/assets/configs/eval_only_primaite_session.yaml +++ b/tests/assets/configs/eval_only_primaite_session.yaml @@ -567,8 +567,7 @@ simulation: network: nodes: - - ref: router_1 - type: router + - type: router hostname: router_1 num_ports: 5 ports: @@ -595,70 +594,58 @@ simulation: action: PERMIT protocol: ICMP - - ref: switch_1 - type: switch + - type: switch hostname: switch_1 num_ports: 8 - - ref: switch_2 - type: switch + - type: switch hostname: switch_2 num_ports: 8 - - ref: domain_controller - type: server + - type: server hostname: domain_controller ip_address: 192.168.1.10 subnet_mask: 255.255.255.0 default_gateway: 192.168.1.1 services: - - ref: domain_controller_dns_server - type: DNSServer + - type: DNSServer options: domain_mapping: arcd.com: 192.168.1.12 # web server - - ref: web_server - type: server + - type: server hostname: web_server ip_address: 192.168.1.12 subnet_mask: 255.255.255.0 default_gateway: 192.168.1.1 dns_server: 192.168.1.10 services: - - ref: web_server_web_service - type: WebServer + - type: WebServer applications: - - ref: web_server_database_client - type: DatabaseClient + - type: DatabaseClient options: db_server_ip: 192.168.1.14 - - ref: database_server - type: server + - type: server hostname: database_server ip_address: 192.168.1.14 subnet_mask: 255.255.255.0 default_gateway: 192.168.1.1 dns_server: 192.168.1.10 services: - - ref: database_service - type: DatabaseService + - type: DatabaseService - - ref: backup_server - type: server + - type: server hostname: backup_server ip_address: 192.168.1.16 subnet_mask: 255.255.255.0 default_gateway: 192.168.1.1 dns_server: 192.168.1.10 services: - - ref: backup_service - type: FTPServer + - type: FTPServer - - ref: security_suite - type: server + - type: server hostname: security_suite ip_address: 192.168.1.110 subnet_mask: 255.255.255.0 @@ -669,38 +656,32 @@ simulation: ip_address: 192.168.10.110 subnet_mask: 255.255.255.0 - - ref: client_1 - type: computer + - type: computer hostname: client_1 ip_address: 192.168.10.21 subnet_mask: 255.255.255.0 default_gateway: 192.168.10.1 dns_server: 192.168.1.10 applications: - - ref: data_manipulation_bot - type: DataManipulationBot + - type: DataManipulationBot options: port_scan_p_of_success: 0.1 data_manipulation_p_of_success: 0.1 payload: "DELETE" server_ip: 192.168.1.14 services: - - ref: client_1_dns_client - type: DNSClient + - type: DNSClient - - ref: client_2 - type: computer + - type: computer hostname: client_2 ip_address: 192.168.10.22 subnet_mask: 255.255.255.0 default_gateway: 192.168.10.1 dns_server: 192.168.1.10 applications: - - ref: client_2_web_browser - type: WebBrowser + - type: WebBrowser services: - - ref: client_2_dns_client - type: DNSClient + - type: DNSClient links: - endpoint_a_hostname: router_1 diff --git a/tests/assets/configs/firewall_actions_network.yaml b/tests/assets/configs/firewall_actions_network.yaml index 4e134fe6..1f4a45e0 100644 --- a/tests/assets/configs/firewall_actions_network.yaml +++ b/tests/assets/configs/firewall_actions_network.yaml @@ -298,8 +298,7 @@ agents: simulation: network: nodes: - - ref: client_1 - type: computer + - type: computer hostname: client_1 ip_address: 192.168.0.10 subnet_mask: 255.255.255.0 @@ -308,15 +307,13 @@ simulation: start_up_duration: 0 shut_down_duration: 0 - - ref: switch_1 - type: switch + - type: switch hostname: switch_1 num_ports: 8 start_up_duration: 0 shut_down_duration: 0 - - ref: router_1 - type: router + - type: router hostname: router_1 num_ports: 5 start_up_duration: 0 @@ -350,8 +347,7 @@ simulation: next_hop_ip_address: 192.168.1.2 metric: 0 - - ref: dmz_server - type: server + - type: server hostname: dmz_server ip_address: 192.168.10.10 subnet_mask: 255.255.255.0 @@ -360,15 +356,13 @@ simulation: start_up_duration: 0 shut_down_duration: 0 - - ref: switch_2 - type: switch + - type: switch hostname: switch_2 num_ports: 8 start_up_duration: 0 shut_down_duration: 0 - - ref: firewall - type: firewall + - type: firewall hostname: firewall start_up_duration: 0 shut_down_duration: 0 @@ -431,15 +425,13 @@ simulation: next_hop_ip_address: 192.168.1.1 metric: 0 - - ref: switch_3 - type: switch + - type: switch hostname: switch_3 num_ports: 8 start_up_duration: 0 shut_down_duration: 0 - - ref: external_computer - type: computer + - type: computer hostname: external_computer ip_address: 192.168.20.10 subnet_mask: 255.255.255.0 @@ -448,8 +440,7 @@ simulation: start_up_duration: 0 shut_down_duration: 0 - - ref: external_server - type: server + - type: server hostname: external_server ip_address: 192.168.20.11 subnet_mask: 255.255.255.0 @@ -457,46 +448,37 @@ simulation: start_up_duration: 0 shut_down_duration: 0 services: - - ref: domain_controller_dns_server - type: DNSServer + - type: DNSServer links: - - ref: client_1___switch_1 - endpoint_a_hostname: client_1 + - endpoint_a_hostname: client_1 endpoint_a_port: 1 endpoint_b_hostname: switch_1 endpoint_b_port: 1 - - ref: router_1___switch_1 - endpoint_a_hostname: router_1 + - endpoint_a_hostname: router_1 endpoint_a_port: 1 endpoint_b_hostname: switch_1 endpoint_b_port: 8 - - ref: router_1___firewall - endpoint_a_hostname: firewall + - endpoint_a_hostname: firewall endpoint_a_port: 2 # internal firewall port endpoint_b_hostname: router_1 endpoint_b_port: 2 - - ref: firewall___switch_2 - endpoint_a_hostname: firewall + - endpoint_a_hostname: firewall endpoint_a_port: 3 # dmz firewall port endpoint_b_hostname: switch_2 endpoint_b_port: 8 - - ref: dmz_server___switch_2 - endpoint_a_hostname: dmz_server + - endpoint_a_hostname: dmz_server endpoint_a_port: 1 endpoint_b_hostname: switch_2 endpoint_b_port: 1 - - ref: firewall___switch_3 - endpoint_a_hostname: firewall + - endpoint_a_hostname: firewall endpoint_a_port: 1 # external firewall port endpoint_b_hostname: switch_3 endpoint_b_port: 8 - - ref: external_computer___switch_3 - endpoint_a_hostname: external_computer + - endpoint_a_hostname: external_computer endpoint_a_port: 1 endpoint_b_hostname: switch_3 endpoint_b_port: 1 - - ref: external_server___switch_3 - endpoint_a_hostname: external_server + - endpoint_a_hostname: external_server endpoint_a_port: 1 endpoint_b_hostname: switch_3 endpoint_b_port: 2 diff --git a/tests/assets/configs/multi_agent_session.yaml b/tests/assets/configs/multi_agent_session.yaml index e4342582..6a37be80 100644 --- a/tests/assets/configs/multi_agent_session.yaml +++ b/tests/assets/configs/multi_agent_session.yaml @@ -1027,8 +1027,7 @@ simulation: network: nodes: - - ref: router_1 - type: router + - type: router hostname: router_1 num_ports: 5 ports: @@ -1055,69 +1054,57 @@ simulation: action: PERMIT protocol: ICMP - - ref: switch_1 - type: switch + - type: switch hostname: switch_1 num_ports: 8 - - ref: switch_2 - type: switch + - type: switch hostname: switch_2 num_ports: 8 - - ref: domain_controller - type: server + - type: server hostname: domain_controller ip_address: 192.168.1.10 subnet_mask: 255.255.255.0 default_gateway: 192.168.1.1 services: - - ref: domain_controller_dns_server - type: DNSServer + - type: DNSServer options: domain_mapping: arcd.com: 192.168.1.12 # web server - - ref: web_server - type: server + - type: server hostname: web_server ip_address: 192.168.1.12 subnet_mask: 255.255.255.0 default_gateway: 192.168.1.1 dns_server: 192.168.1.10 services: - - ref: web_server_web_service - type: WebServer + - type: WebServer applications: - - ref: web_server_database_client - type: DatabaseClient + - type: DatabaseClient options: db_server_ip: 192.168.1.14 - - ref: database_server - type: server + - type: server hostname: database_server ip_address: 192.168.1.14 subnet_mask: 255.255.255.0 default_gateway: 192.168.1.1 dns_server: 192.168.1.10 services: - - ref: database_service - type: DatabaseService + - type: DatabaseService - - ref: backup_server - type: server + - type: server hostname: backup_server ip_address: 192.168.1.16 subnet_mask: 255.255.255.0 default_gateway: 192.168.1.1 dns_server: 192.168.1.10 services: - - ref: backup_service - type: FTPServer + - type: FTPServer - - ref: security_suite - type: server + - type: server hostname: security_suite ip_address: 192.168.1.110 subnet_mask: 255.255.255.0 @@ -1128,38 +1115,32 @@ simulation: ip_address: 192.168.10.110 subnet_mask: 255.255.255.0 - - ref: client_1 - type: computer + - type: computer hostname: client_1 ip_address: 192.168.10.21 subnet_mask: 255.255.255.0 default_gateway: 192.168.10.1 dns_server: 192.168.1.10 applications: - - ref: data_manipulation_bot - type: DataManipulationBot + - type: DataManipulationBot options: port_scan_p_of_success: 0.1 data_manipulation_p_of_success: 0.1 payload: "DELETE" server_ip: 192.168.1.14 services: - - ref: client_1_dns_client - type: DNSClient + - type: DNSClient - - ref: client_2 - type: computer + - type: computer hostname: client_2 ip_address: 192.168.10.22 subnet_mask: 255.255.255.0 default_gateway: 192.168.10.1 dns_server: 192.168.1.10 applications: - - ref: client_2_web_browser - type: WebBrowser + - type: WebBrowser services: - - ref: client_2_dns_client - type: DNSClient + - type: DNSClient links: - endpoint_a_hostname: router_1 diff --git a/tests/assets/configs/shared_rewards.yaml b/tests/assets/configs/shared_rewards.yaml index 7df6802c..bfa03ace 100644 --- a/tests/assets/configs/shared_rewards.yaml +++ b/tests/assets/configs/shared_rewards.yaml @@ -750,8 +750,7 @@ simulation: - DELETE nodes: - - ref: router_1 - hostname: router_1 + - hostname: router_1 type: router num_ports: 5 ports: @@ -786,74 +785,61 @@ simulation: action: PERMIT protocol: ICMP - - ref: switch_1 - hostname: switch_1 + - hostname: switch_1 type: switch num_ports: 8 - - ref: switch_2 - hostname: switch_2 + - hostname: switch_2 type: switch num_ports: 8 - - ref: domain_controller - hostname: domain_controller + - hostname: domain_controller type: server ip_address: 192.168.1.10 subnet_mask: 255.255.255.0 default_gateway: 192.168.1.1 services: - - ref: domain_controller_dns_server - type: DNSServer + - type: DNSServer options: domain_mapping: arcd.com: 192.168.1.12 # web server - - ref: web_server - hostname: web_server + - hostname: web_server type: server ip_address: 192.168.1.12 subnet_mask: 255.255.255.0 default_gateway: 192.168.1.1 dns_server: 192.168.1.10 services: - - ref: web_server_web_service - type: WebServer + - type: WebServer applications: - - ref: web_server_database_client - type: DatabaseClient + - type: DatabaseClient options: db_server_ip: 192.168.1.14 - - ref: database_server - hostname: database_server + - hostname: database_server type: server ip_address: 192.168.1.14 subnet_mask: 255.255.255.0 default_gateway: 192.168.1.1 dns_server: 192.168.1.10 services: - - ref: database_service - type: DatabaseService + - type: DatabaseService options: backup_server_ip: 192.168.1.16 - - ref: database_ftp_client - type: FTPClient + - type: FTPClient - - ref: backup_server - hostname: backup_server + - hostname: backup_server type: server ip_address: 192.168.1.16 subnet_mask: 255.255.255.0 default_gateway: 192.168.1.1 dns_server: 192.168.1.10 services: - - ref: backup_service - type: FTPServer + - type: FTPServer - - ref: security_suite - hostname: security_suite + - hostname: security_suite type: server ip_address: 192.168.1.110 subnet_mask: 255.255.255.0 @@ -864,59 +850,49 @@ simulation: ip_address: 192.168.10.110 subnet_mask: 255.255.255.0 - - ref: client_1 - hostname: client_1 + - hostname: client_1 type: computer ip_address: 192.168.10.21 subnet_mask: 255.255.255.0 default_gateway: 192.168.10.1 dns_server: 192.168.1.10 applications: - - ref: data_manipulation_bot - type: DataManipulationBot + - type: DataManipulationBot options: port_scan_p_of_success: 0.8 data_manipulation_p_of_success: 0.8 payload: "DELETE" server_ip: 192.168.1.14 - - ref: client_1_web_browser - type: WebBrowser + - type: WebBrowser options: target_url: http://arcd.com/users/ - - ref: client_1_database_client - type: DatabaseClient + - type: DatabaseClient options: db_server_ip: 192.168.1.14 services: - - ref: client_1_dns_client - type: DNSClient + - type: DNSClient - - ref: client_2 - hostname: client_2 + - hostname: client_2 type: computer ip_address: 192.168.10.22 subnet_mask: 255.255.255.0 default_gateway: 192.168.10.1 dns_server: 192.168.1.10 applications: - - ref: client_2_web_browser - type: WebBrowser + - type: WebBrowser options: target_url: http://arcd.com/users/ - - ref: data_manipulation_bot - type: DataManipulationBot + - type: DataManipulationBot options: port_scan_p_of_success: 0.8 data_manipulation_p_of_success: 0.8 payload: "DELETE" server_ip: 192.168.1.14 - - ref: client_2_database_client - type: DatabaseClient + - type: DatabaseClient options: db_server_ip: 192.168.1.14 services: - - ref: client_2_dns_client - type: DNSClient + - type: DNSClient diff --git a/tests/assets/configs/test_application_install.yaml b/tests/assets/configs/test_application_install.yaml index a2059913..3323937e 100644 --- a/tests/assets/configs/test_application_install.yaml +++ b/tests/assets/configs/test_application_install.yaml @@ -782,8 +782,7 @@ simulation: - DELETE nodes: - - ref: router_1 - hostname: router_1 + - hostname: router_1 type: router num_ports: 5 ports: @@ -818,74 +817,61 @@ simulation: action: PERMIT protocol: ICMP - - ref: switch_1 - hostname: switch_1 + - hostname: switch_1 type: switch num_ports: 8 - - ref: switch_2 - hostname: switch_2 + - hostname: switch_2 type: switch num_ports: 8 - - ref: domain_controller - hostname: domain_controller + - hostname: domain_controller type: server ip_address: 192.168.1.10 subnet_mask: 255.255.255.0 default_gateway: 192.168.1.1 services: - - ref: domain_controller_dns_server - type: DNSServer + - type: DNSServer options: domain_mapping: arcd.com: 192.168.1.12 # web server - - ref: web_server - hostname: web_server + - hostname: web_server type: server ip_address: 192.168.1.12 subnet_mask: 255.255.255.0 default_gateway: 192.168.1.1 dns_server: 192.168.1.10 services: - - ref: web_server_web_service - type: WebServer + - type: WebServer applications: - - ref: web_server_database_client - type: DatabaseClient + - type: DatabaseClient options: db_server_ip: 192.168.1.14 - - ref: database_server - hostname: database_server + - hostname: database_server type: server ip_address: 192.168.1.14 subnet_mask: 255.255.255.0 default_gateway: 192.168.1.1 dns_server: 192.168.1.10 services: - - ref: database_service - type: DatabaseService + - type: DatabaseService options: backup_server_ip: 192.168.1.16 - - ref: database_ftp_client - type: FTPClient + - type: FTPClient - - ref: backup_server - hostname: backup_server + - hostname: backup_server type: server ip_address: 192.168.1.16 subnet_mask: 255.255.255.0 default_gateway: 192.168.1.1 dns_server: 192.168.1.10 services: - - ref: backup_service - type: FTPServer + - type: FTPServer - - ref: security_suite - hostname: security_suite + - hostname: security_suite type: server ip_address: 192.168.1.110 subnet_mask: 255.255.255.0 @@ -896,59 +882,49 @@ simulation: ip_address: 192.168.10.110 subnet_mask: 255.255.255.0 - - ref: client_1 - hostname: client_1 + - hostname: client_1 type: computer ip_address: 192.168.10.21 subnet_mask: 255.255.255.0 default_gateway: 192.168.10.1 dns_server: 192.168.1.10 applications: - - ref: data_manipulation_bot - type: DataManipulationBot + - type: DataManipulationBot options: port_scan_p_of_success: 0.8 data_manipulation_p_of_success: 0.8 payload: "DELETE" server_ip: 192.168.1.14 - - ref: client_1_web_browser - type: WebBrowser + - type: WebBrowser options: target_url: http://arcd.com/users/ - - ref: client_1_database_client - type: DatabaseClient + - type: DatabaseClient options: db_server_ip: 192.168.1.14 services: - - ref: client_1_dns_client - type: DNSClient + - type: DNSClient - - ref: client_2 - hostname: client_2 + - hostname: client_2 type: computer ip_address: 192.168.10.22 subnet_mask: 255.255.255.0 default_gateway: 192.168.10.1 dns_server: 192.168.1.10 applications: - - ref: client_2_web_browser - type: WebBrowser + - type: WebBrowser options: target_url: http://arcd.com/users/ - - ref: data_manipulation_bot - type: DataManipulationBot + - type: DataManipulationBot options: port_scan_p_of_success: 0.8 data_manipulation_p_of_success: 0.8 payload: "DELETE" server_ip: 192.168.1.14 - - ref: client_2_database_client - type: DatabaseClient + - type: DatabaseClient options: db_server_ip: 192.168.1.14 services: - - ref: client_2_dns_client - type: DNSClient + - type: DNSClient diff --git a/tests/assets/configs/test_primaite_session.yaml b/tests/assets/configs/test_primaite_session.yaml index fc72cfd7..9284f1d1 100644 --- a/tests/assets/configs/test_primaite_session.yaml +++ b/tests/assets/configs/test_primaite_session.yaml @@ -574,8 +574,7 @@ simulation: network: nodes: - - ref: router_1 - type: router + - type: router hostname: router_1 num_ports: 5 ports: @@ -602,70 +601,58 @@ simulation: action: PERMIT protocol: ICMP - - ref: switch_1 - type: switch + - type: switch hostname: switch_1 num_ports: 8 - - ref: switch_2 - type: switch + - type: switch hostname: switch_2 num_ports: 8 - - ref: domain_controller - type: server + - type: server hostname: domain_controller ip_address: 192.168.1.10 subnet_mask: 255.255.255.0 default_gateway: 192.168.1.1 services: - - ref: domain_controller_dns_server - type: DNSServer + - type: DNSServer options: domain_mapping: arcd.com: 192.168.1.12 # web server - - ref: web_server - type: server + - type: server hostname: web_server ip_address: 192.168.1.12 subnet_mask: 255.255.255.0 default_gateway: 192.168.1.1 dns_server: 192.168.1.10 services: - - ref: web_server_web_service - type: WebServer + - type: WebServer applications: - - ref: web_server_database_client - type: DatabaseClient + - type: DatabaseClient options: db_server_ip: 192.168.1.14 - - ref: database_server - type: server + - type: server hostname: database_server ip_address: 192.168.1.14 subnet_mask: 255.255.255.0 default_gateway: 192.168.1.1 dns_server: 192.168.1.10 services: - - ref: database_service - type: DatabaseService + - type: DatabaseService - - ref: backup_server - type: server + - type: server hostname: backup_server ip_address: 192.168.1.16 subnet_mask: 255.255.255.0 default_gateway: 192.168.1.1 dns_server: 192.168.1.10 services: - - ref: backup_service - type: FTPServer + - type: FTPServer - - ref: security_suite - type: server + - type: server hostname: security_suite ip_address: 192.168.1.110 subnet_mask: 255.255.255.0 @@ -676,47 +663,39 @@ simulation: ip_address: 192.168.10.110 subnet_mask: 255.255.255.0 - - ref: client_1 - type: computer + - type: computer hostname: client_1 ip_address: 192.168.10.21 subnet_mask: 255.255.255.0 default_gateway: 192.168.10.1 dns_server: 192.168.1.10 applications: - - ref: data_manipulation_bot - type: DataManipulationBot + - type: DataManipulationBot options: port_scan_p_of_success: 0.1 data_manipulation_p_of_success: 0.1 payload: "DELETE" server_ip: 192.168.1.14 services: - - ref: client_1_dns_client - type: DNSClient + - type: DNSClient - - ref: client_2 - type: computer + - type: computer hostname: client_2 ip_address: 192.168.10.22 subnet_mask: 255.255.255.0 default_gateway: 192.168.10.1 dns_server: 192.168.1.10 applications: - - ref: client_2_web_browser - type: WebBrowser + - type: WebBrowser services: - - ref: client_2_dns_client - type: DNSClient + - type: DNSClient - - ref: HP_LaserJet_Pro_4102fdn_printer - type: printer + - type: printer hostname: HP_LaserJet_Pro_4102fdn_printer ip_address: 192.168.10.99 subnet_mask: 255.255.255.0 - - ref: router_2 - type: wireless_router + - type: wireless_router hostname: router_2 router_interface: ip_address: 192.169.1.1 diff --git a/tests/assets/configs/train_only_primaite_session.yaml b/tests/assets/configs/train_only_primaite_session.yaml index b083505e..7d1ac09f 100644 --- a/tests/assets/configs/train_only_primaite_session.yaml +++ b/tests/assets/configs/train_only_primaite_session.yaml @@ -574,8 +574,7 @@ simulation: network: nodes: - - ref: router_1 - type: router + - type: router hostname: router_1 num_ports: 5 ports: @@ -602,70 +601,58 @@ simulation: action: PERMIT protocol: ICMP - - ref: switch_1 - type: switch + - type: switch hostname: switch_1 num_ports: 8 - - ref: switch_2 - type: switch + - type: switch hostname: switch_2 num_ports: 8 - - ref: domain_controller - type: server + - type: server hostname: domain_controller ip_address: 192.168.1.10 subnet_mask: 255.255.255.0 default_gateway: 192.168.1.1 services: - - ref: domain_controller_dns_server - type: DNSServer + - type: DNSServer options: domain_mapping: arcd.com: 192.168.1.12 # web server - - ref: web_server - type: server + - type: server hostname: web_server ip_address: 192.168.1.12 subnet_mask: 255.255.255.0 default_gateway: 192.168.1.1 dns_server: 192.168.1.10 services: - - ref: web_server_web_service - type: WebServer + - type: WebServer applications: - - ref: web_server_database_client - type: DatabaseClient + - type: DatabaseClient options: db_server_ip: 192.168.1.14 - - ref: database_server - type: server + - type: server hostname: database_server ip_address: 192.168.1.14 subnet_mask: 255.255.255.0 default_gateway: 192.168.1.1 dns_server: 192.168.1.10 services: - - ref: database_service - type: DatabaseService + - type: DatabaseService - - ref: backup_server - type: server + - type: server hostname: backup_server ip_address: 192.168.1.16 subnet_mask: 255.255.255.0 default_gateway: 192.168.1.1 dns_server: 192.168.1.10 services: - - ref: backup_service - type: FTPServer + - type: FTPServer - - ref: security_suite - type: server + - type: server hostname: security_suite ip_address: 192.168.1.110 subnet_mask: 255.255.255.0 @@ -676,38 +663,32 @@ simulation: ip_address: 192.168.10.110 subnet_mask: 255.255.255.0 - - ref: client_1 - type: computer + - type: computer hostname: client_1 ip_address: 192.168.10.21 subnet_mask: 255.255.255.0 default_gateway: 192.168.10.1 dns_server: 192.168.1.10 applications: - - ref: data_manipulation_bot - type: DataManipulationBot + - type: DataManipulationBot options: port_scan_p_of_success: 0.1 data_manipulation_p_of_success: 0.1 payload: "DELETE" server_ip: 192.168.1.14 services: - - ref: client_1_dns_client - type: DNSClient + - type: DNSClient - - ref: client_2 - type: computer + - type: computer hostname: client_2 ip_address: 192.168.10.22 subnet_mask: 255.255.255.0 default_gateway: 192.168.10.1 dns_server: 192.168.1.10 applications: - - ref: client_2_web_browser - type: WebBrowser + - type: WebBrowser services: - - ref: client_2_dns_client - type: DNSClient + - type: DNSClient links: - endpoint_a_hostname: router_1