diff --git a/example_config.yaml b/example_config.yaml index afdf1b0a..a35c82e0 100644 --- a/example_config.yaml +++ b/example_config.yaml @@ -12,10 +12,12 @@ game_config: ports: - ARP - DNS + - HTTP - POSTGRES_SERVER protocols: - ICMP - TCP + - UDP agents: - ref: client_1_green_user @@ -111,10 +113,10 @@ game_config: observation_space: type: UC2BlueObservation options: + num_services_per_node: 2 + num_folders_per_node: 2 + num_files_per_folder: 2 nodes: - - node_ref: router_1 #TODO: more sub-options here - - node_ref: switch_1 - - node_ref: switch_2 - node_ref: domain_controller services: - service_ref: domain_controller_dns_server @@ -147,17 +149,23 @@ game_config: - link_ref: switch_2___security_suite acl: router_node_ref: router_1 - node_order: - - node_ref: router_1 - - node_ref: switch_1 - - node_ref: switch_2 + ip_address_order: - node_ref: domain_controller + nic_num: 1 - node_ref: web_server + nic_num: 1 - node_ref: database_server + nic_num: 1 - node_ref: backup_server + nic_num: 1 - node_ref: security_suite + nic_num: 1 - node_ref: client_1 + nic_num: 1 - node_ref: client_2 + nic_num: 1 + - node_ref: security_suite + nic_num: 2 ics: null action_space: diff --git a/sandbox.ipynb b/sandbox.ipynb index a2150921..73c3e682 100644 --- a/sandbox.ipynb +++ b/sandbox.ipynb @@ -2,9 +2,105 @@ "cells": [ { "cell_type": "code", - "execution_count": null, + "execution_count": 1, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "2023-10-10 21:00:40,310: Added node f0fb4743-43d5-4741-a0e5-78340a458a11 to Network 301a746b-6521-4ff9-876f-a1ce39678451\n", + "2023-10-10 21:00:40,313: Added node 86f4ee9d-386d-4436-96e7-d00dd8bae746 to Network 301a746b-6521-4ff9-876f-a1ce39678451\n", + "2023-10-10 21:00:40,316: Added node d2b38f6a-10fe-4d28-86a5-a1d2010c4bea to Network 301a746b-6521-4ff9-876f-a1ce39678451\n", + "2023-10-10 21:00:40,319: Added node 29d55bd4-d59e-4f73-95ad-b430c8716b15 to Network 301a746b-6521-4ff9-876f-a1ce39678451\n", + "2023-10-10 21:00:40,323: Added node 5d266f99-03a6-47b3-ab0b-28b8a6813a11 to Network 301a746b-6521-4ff9-876f-a1ce39678451\n", + "2023-10-10 21:00:40,333: Added node e4f397c7-eed2-4e69-afaf-ce44664ff1d2 to Network 301a746b-6521-4ff9-876f-a1ce39678451\n", + "2023-10-10 21:00:40,338: Added node 19dbb2d4-648b-4387-aa15-99757b513acb to Network 301a746b-6521-4ff9-876f-a1ce39678451\n", + "2023-10-10 21:00:40,344: Added node f508ea65-e660-4b91-8628-5c586075137b to Network 301a746b-6521-4ff9-876f-a1ce39678451\n", + "2023-10-10 21:00:40,350: Added node ffe02a33-7f9c-4fc1-ad3a-791935dbd4c2 to Network 301a746b-6521-4ff9-876f-a1ce39678451\n", + "2023-10-10 21:00:40,356: Added node 0ce9efc6-39ae-4d3d-82ad-43be5ac57586 to Network 301a746b-6521-4ff9-876f-a1ce39678451\n", + "2023-10-10 21:00:40,360: NIC ba:25:b9:f4:b0:74/192.168.1.1 connected to Link ba:25:b9:f4:b0:74/192.168.1.1<-->3a:25:73:6c:4c:36\n", + "2023-10-10 21:00:40,361: SwitchPort 3a:25:73:6c:4c:36 connected to Link ba:25:b9:f4:b0:74/192.168.1.1<-->3a:25:73:6c:4c:36\n", + "2023-10-10 21:00:40,363: Link ba:25:b9:f4:b0:74/192.168.1.1<-->3a:25:73:6c:4c:36 up\n", + "2023-10-10 21:00:40,364: Link ba:25:b9:f4:b0:74/192.168.1.1<-->3a:25:73:6c:4c:36 up\n", + "2023-10-10 21:00:40,366: Added link eda2befd-9f68-440c-9b20-06838d9e6553 to connect ba:25:b9:f4:b0:74/192.168.1.1 and 3a:25:73:6c:4c:36\n", + "2023-10-10 21:00:40,367: NIC c0:ce:5a:6d:71:73/192.168.1.1 connected to Link c0:ce:5a:6d:71:73/192.168.1.1<-->b2:a4:b3:fc:da:c3\n", + "2023-10-10 21:00:40,368: SwitchPort b2:a4:b3:fc:da:c3 connected to Link c0:ce:5a:6d:71:73/192.168.1.1<-->b2:a4:b3:fc:da:c3\n", + "2023-10-10 21:00:40,370: Link c0:ce:5a:6d:71:73/192.168.1.1<-->b2:a4:b3:fc:da:c3 up\n", + "2023-10-10 21:00:40,370: Link c0:ce:5a:6d:71:73/192.168.1.1<-->b2:a4:b3:fc:da:c3 up\n", + "2023-10-10 21:00:40,372: Added link 0e2a1df6-1c3c-4517-b41f-04a5cefe307c to connect c0:ce:5a:6d:71:73/192.168.1.1 and b2:a4:b3:fc:da:c3\n", + "2023-10-10 21:00:40,373: SwitchPort 72:f3:93:a5:a5:59 connected to Link 72:f3:93:a5:a5:59<-->e1:9b:c0:59:1d:46/192.168.1.10\n", + "2023-10-10 21:00:40,377: Link 72:f3:93:a5:a5:59<-->e1:9b:c0:59:1d:46/192.168.1.10 up\n", + "2023-10-10 21:00:40,379: NIC e1:9b:c0:59:1d:46/192.168.1.10 connected to Link 72:f3:93:a5:a5:59<-->e1:9b:c0:59:1d:46/192.168.1.10\n", + "2023-10-10 21:00:40,380: Link 72:f3:93:a5:a5:59<-->e1:9b:c0:59:1d:46/192.168.1.10 up\n", + "2023-10-10 21:00:40,381: Added link 48c9173d-847b-441f-9f15-f7838cf09083 to connect 72:f3:93:a5:a5:59 and e1:9b:c0:59:1d:46/192.168.1.10\n", + "2023-10-10 21:00:40,382: SwitchPort 67:36:e8:51:35:f2 connected to Link 67:36:e8:51:35:f2<-->3b:a3:b4:ec:a0:2a/192.168.1.12\n", + "2023-10-10 21:00:40,384: Link 67:36:e8:51:35:f2<-->3b:a3:b4:ec:a0:2a/192.168.1.12 up\n", + "2023-10-10 21:00:40,385: NIC 3b:a3:b4:ec:a0:2a/192.168.1.12 connected to Link 67:36:e8:51:35:f2<-->3b:a3:b4:ec:a0:2a/192.168.1.12\n", + "2023-10-10 21:00:40,386: Link 67:36:e8:51:35:f2<-->3b:a3:b4:ec:a0:2a/192.168.1.12 up\n", + "2023-10-10 21:00:40,386: Added link 7259c2a4-44f7-44d9-87de-1a692c98ac58 to connect 67:36:e8:51:35:f2 and 3b:a3:b4:ec:a0:2a/192.168.1.12\n", + "2023-10-10 21:00:40,388: SwitchPort be:56:a8:d3:f9:6c connected to Link be:56:a8:d3:f9:6c<-->99:24:3a:ad:99:5b/192.168.1.14\n", + "2023-10-10 21:00:40,391: Link be:56:a8:d3:f9:6c<-->99:24:3a:ad:99:5b/192.168.1.14 up\n", + "2023-10-10 21:00:40,392: NIC 99:24:3a:ad:99:5b/192.168.1.14 connected to Link be:56:a8:d3:f9:6c<-->99:24:3a:ad:99:5b/192.168.1.14\n", + "2023-10-10 21:00:40,394: Link be:56:a8:d3:f9:6c<-->99:24:3a:ad:99:5b/192.168.1.14 up\n", + "2023-10-10 21:00:40,396: Added link ff3c3f9a-c267-421a-9e2f-bcc11a6fa082 to connect be:56:a8:d3:f9:6c and 99:24:3a:ad:99:5b/192.168.1.14\n", + "2023-10-10 21:00:40,397: SwitchPort 4f:91:78:5a:68:3f connected to Link 4f:91:78:5a:68:3f<-->2b:ff:81:44:7f:61/192.168.1.16\n", + "2023-10-10 21:00:40,399: Link 4f:91:78:5a:68:3f<-->2b:ff:81:44:7f:61/192.168.1.16 up\n", + "2023-10-10 21:00:40,400: NIC 2b:ff:81:44:7f:61/192.168.1.16 connected to Link 4f:91:78:5a:68:3f<-->2b:ff:81:44:7f:61/192.168.1.16\n", + "2023-10-10 21:00:40,401: Link 4f:91:78:5a:68:3f<-->2b:ff:81:44:7f:61/192.168.1.16 up\n", + "2023-10-10 21:00:40,402: Added link b5a2e61c-f14d-45a3-a27e-2451f21229d5 to connect 4f:91:78:5a:68:3f and 2b:ff:81:44:7f:61/192.168.1.16\n", + "2023-10-10 21:00:40,403: SwitchPort 14:8e:63:89:28:f6 connected to Link 14:8e:63:89:28:f6<-->72:ca:83:f9:d0:66/192.168.1.110\n", + "2023-10-10 21:00:40,404: Link 14:8e:63:89:28:f6<-->72:ca:83:f9:d0:66/192.168.1.110 up\n", + "2023-10-10 21:00:40,405: NIC 72:ca:83:f9:d0:66/192.168.1.110 connected to Link 14:8e:63:89:28:f6<-->72:ca:83:f9:d0:66/192.168.1.110\n", + "2023-10-10 21:00:40,406: Link 14:8e:63:89:28:f6<-->72:ca:83:f9:d0:66/192.168.1.110 up\n", + "2023-10-10 21:00:40,407: Added link d0906ccd-5f98-415a-b08e-b8ebfdd3c5a9 to connect 14:8e:63:89:28:f6 and 72:ca:83:f9:d0:66/192.168.1.110\n", + "2023-10-10 21:00:40,409: SwitchPort e5:20:55:91:b5:b9 connected to Link e5:20:55:91:b5:b9<-->27:2f:d1:75:04:f9/192.168.10.21\n", + "2023-10-10 21:00:40,412: Link e5:20:55:91:b5:b9<-->27:2f:d1:75:04:f9/192.168.10.21 up\n", + "2023-10-10 21:00:40,413: NIC 27:2f:d1:75:04:f9/192.168.10.21 connected to Link e5:20:55:91:b5:b9<-->27:2f:d1:75:04:f9/192.168.10.21\n", + "2023-10-10 21:00:40,414: Link e5:20:55:91:b5:b9<-->27:2f:d1:75:04:f9/192.168.10.21 up\n", + "2023-10-10 21:00:40,415: Added link 51f14a80-8fd6-4de9-86a3-9c726c036167 to connect e5:20:55:91:b5:b9 and 27:2f:d1:75:04:f9/192.168.10.21\n", + "2023-10-10 21:00:40,416: SwitchPort 4e:58:c4:9c:0c:6d connected to Link 4e:58:c4:9c:0c:6d<-->2e:f5:71:bb:73:ec/192.168.10.22\n", + "2023-10-10 21:00:40,418: Link 4e:58:c4:9c:0c:6d<-->2e:f5:71:bb:73:ec/192.168.10.22 up\n", + "2023-10-10 21:00:40,420: NIC 2e:f5:71:bb:73:ec/192.168.10.22 connected to Link 4e:58:c4:9c:0c:6d<-->2e:f5:71:bb:73:ec/192.168.10.22\n", + "2023-10-10 21:00:40,420: Link 4e:58:c4:9c:0c:6d<-->2e:f5:71:bb:73:ec/192.168.10.22 up\n", + "2023-10-10 21:00:40,421: Added link 7463a72f-af42-435f-ad98-83bcfe5728a3 to connect 4e:58:c4:9c:0c:6d and 2e:f5:71:bb:73:ec/192.168.10.22\n", + "2023-10-10 21:00:40,423: SwitchPort 66:98:bd:ca:08:b0 connected to Link 66:98:bd:ca:08:b0<-->cf:f7:fc:d1:f4:ae/192.168.10.110\n", + "2023-10-10 21:00:40,425: Link 66:98:bd:ca:08:b0<-->cf:f7:fc:d1:f4:ae/192.168.10.110 up\n", + "2023-10-10 21:00:40,427: NIC cf:f7:fc:d1:f4:ae/192.168.10.110 connected to Link 66:98:bd:ca:08:b0<-->cf:f7:fc:d1:f4:ae/192.168.10.110\n", + "2023-10-10 21:00:40,428: Link 66:98:bd:ca:08:b0<-->cf:f7:fc:d1:f4:ae/192.168.10.110 up\n", + "2023-10-10 21:00:40,430: Added link ff6fd52d-f893-4c0d-99d2-28f10c128043 to connect 66:98:bd:ca:08:b0 and cf:f7:fc:d1:f4:ae/192.168.10.110\n", + "2023-10-10 21:00:40,431: Stepping primaite session. Step counter: 0\n", + "2023-10-10 21:00:40,432: Sending simulation state to agent client_1_green_user\n", + "2023-10-10 21:00:40,433: Getting agent action\n", + "2023-10-10 21:00:40,435: Formatting agent action DONOTHING\n", + "2023-10-10 21:00:40,436: Sending request to simulation: ['do_nothing']\n", + "2023-10-10 21:00:40,437: Sending simulation state to agent client_1_data_manipulation_red_bot\n", + "2023-10-10 21:00:40,439: Getting agent action\n", + "2023-10-10 21:00:40,440: Formatting agent action NODE_FILE_DELETE\n", + "2023-10-10 21:00:40,441: Sending request to simulation: ['do_nothing']\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "/home/cade/.local/state/primaite/2.0.0/log\n", + "service type not found DatabaseBackup\n", + "service type not found WebBrowser\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "2023-10-10 21:00:40,443: Sending simulation state to agent defender\n", + "2023-10-10 21:00:40,445: Getting agent action\n", + "2023-10-10 21:00:40,447: Formatting agent action NODE_FOLDER_RESTORE\n", + "2023-10-10 21:00:40,449: Sending request to simulation: ['do_nothing']\n", + "2023-10-10 21:00:40,450: Initiating simulation step 0\n" + ] + } + ], "source": [ "%load_ext autoreload\n", "%autoreload 2\n", @@ -14,11 +110,7 @@ "import logging\n", "_PRIMAITE_CONFIG['log_level']=logging.DEBUG\n", "print(PRIMAITE_PATHS.app_log_dir_path)\n", - "import itertools\n", "from primaite.game.session import PrimaiteSession\n", - "from primaite.simulator.sim_container import Simulation\n", - "from primaite.game.agent.interface import AbstractAgent\n", - "from primaite.simulator.network.networks import arcd_uc2_network\n", "import yaml\n", "\n", "with open('example_config.yaml', 'r') as file:\n", @@ -29,13 +121,727 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 2, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "2023-10-10 21:00:40,481: Stepping primaite session. Step counter: 1\n", + "2023-10-10 21:00:40,484: Sending simulation state to agent client_1_green_user\n", + "2023-10-10 21:00:40,486: Getting agent action\n", + "2023-10-10 21:00:40,487: Formatting agent action DONOTHING\n", + "2023-10-10 21:00:40,488: Sending request to simulation: ['do_nothing']\n", + "2023-10-10 21:00:40,489: Sending simulation state to agent client_1_data_manipulation_red_bot\n", + "2023-10-10 21:00:40,491: Getting agent action\n", + "2023-10-10 21:00:40,493: Formatting agent action NODE_FILE_DELETE\n", + "2023-10-10 21:00:40,494: Sending request to simulation: ['do_nothing']\n", + "2023-10-10 21:00:40,495: Sending simulation state to agent defender\n", + "2023-10-10 21:00:40,497: Getting agent action\n", + "2023-10-10 21:00:40,498: Formatting agent action NETWORK_ACL_REMOVERULE\n", + "2023-10-10 21:00:40,499: Sending request to simulation: ['network', 'node', 'f0fb4743-43d5-4741-a0e5-78340a458a11', 'acl', 'remove_rule', 8]\n", + "2023-10-10 21:00:40,500: Initiating simulation step 1\n", + "2023-10-10 21:00:40,502: Stepping primaite session. Step counter: 2\n", + "2023-10-10 21:00:40,503: Sending simulation state to agent client_1_green_user\n", + "2023-10-10 21:00:40,504: Getting agent action\n", + "2023-10-10 21:00:40,505: Formatting agent action DONOTHING\n", + "2023-10-10 21:00:40,505: Sending request to simulation: ['do_nothing']\n", + "2023-10-10 21:00:40,506: Sending simulation state to agent client_1_data_manipulation_red_bot\n", + "2023-10-10 21:00:40,508: Getting agent action\n", + "2023-10-10 21:00:40,511: Formatting agent action NODE_FILE_CORRUPT\n", + "2023-10-10 21:00:40,513: Sending request to simulation: ['do_nothing']\n", + "2023-10-10 21:00:40,513: Sending simulation state to agent defender\n", + "2023-10-10 21:00:40,515: Getting agent action\n", + "2023-10-10 21:00:40,516: Formatting agent action NETWORK_ACL_ADDRULE\n", + "2023-10-10 21:00:40,518: Sending request to simulation: ['do_nothing']\n", + "2023-10-10 21:00:40,519: Initiating simulation step 2\n", + "2023-10-10 21:00:40,520: Stepping primaite session. Step counter: 3\n", + "2023-10-10 21:00:40,521: Sending simulation state to agent client_1_green_user\n", + "2023-10-10 21:00:40,522: Getting agent action\n", + "2023-10-10 21:00:40,524: Formatting agent action DONOTHING\n", + "2023-10-10 21:00:40,525: Sending request to simulation: ['do_nothing']\n", + "2023-10-10 21:00:40,526: Sending simulation state to agent client_1_data_manipulation_red_bot\n", + "2023-10-10 21:00:40,528: Getting agent action\n", + "2023-10-10 21:00:40,530: Formatting agent action DONOTHING\n", + "2023-10-10 21:00:40,531: Sending request to simulation: ['do_nothing']\n", + "2023-10-10 21:00:40,533: Sending simulation state to agent defender\n", + "2023-10-10 21:00:40,534: Getting agent action\n", + "2023-10-10 21:00:40,535: Formatting agent action NETWORK_ACL_REMOVERULE\n", + "2023-10-10 21:00:40,537: Sending request to simulation: ['network', 'node', 'f0fb4743-43d5-4741-a0e5-78340a458a11', 'acl', 'remove_rule', 1]\n", + "2023-10-10 21:00:40,538: Initiating simulation step 3\n", + "2023-10-10 21:00:40,539: Stepping primaite session. Step counter: 4\n", + "2023-10-10 21:00:40,541: Sending simulation state to agent client_1_green_user\n", + "2023-10-10 21:00:40,543: Getting agent action\n", + "2023-10-10 21:00:40,545: Formatting agent action DONOTHING\n", + "2023-10-10 21:00:40,546: Sending request to simulation: ['do_nothing']\n", + "2023-10-10 21:00:40,547: Sending simulation state to agent client_1_data_manipulation_red_bot\n", + "2023-10-10 21:00:40,550: Getting agent action\n", + "2023-10-10 21:00:40,552: Formatting agent action NODE_OS_SCAN\n", + "2023-10-10 21:00:40,554: Sending request to simulation: ['network', 'node', 'ffe02a33-7f9c-4fc1-ad3a-791935dbd4c2', 'scan']\n", + "2023-10-10 21:00:40,555: Sending simulation state to agent defender\n", + "2023-10-10 21:00:40,573: Getting agent action\n", + "2023-10-10 21:00:40,575: Formatting agent action NETWORK_ACL_REMOVERULE\n", + "2023-10-10 21:00:40,577: Sending request to simulation: ['network', 'node', 'f0fb4743-43d5-4741-a0e5-78340a458a11', 'acl', 'remove_rule', 2]\n", + "2023-10-10 21:00:40,578: Initiating simulation step 4\n", + "2023-10-10 21:00:40,580: Stepping primaite session. Step counter: 5\n", + "2023-10-10 21:00:40,581: Sending simulation state to agent client_1_green_user\n", + "2023-10-10 21:00:40,583: Getting agent action\n", + "2023-10-10 21:00:40,585: Formatting agent action DONOTHING\n", + "2023-10-10 21:00:40,586: Sending request to simulation: ['do_nothing']\n", + "2023-10-10 21:00:40,587: Sending simulation state to agent client_1_data_manipulation_red_bot\n", + "2023-10-10 21:00:40,597: Getting agent action\n", + "2023-10-10 21:00:40,598: Formatting agent action NODE_FILE_CORRUPT\n", + "2023-10-10 21:00:40,599: Sending request to simulation: ['do_nothing']\n", + "2023-10-10 21:00:40,601: Sending simulation state to agent defender\n", + "2023-10-10 21:00:40,603: Getting agent action\n", + "2023-10-10 21:00:40,605: Formatting agent action NETWORK_ACL_REMOVERULE\n", + "2023-10-10 21:00:40,606: Sending request to simulation: ['network', 'node', 'f0fb4743-43d5-4741-a0e5-78340a458a11', 'acl', 'remove_rule', 0]\n", + "2023-10-10 21:00:40,613: Initiating simulation step 5\n", + "2023-10-10 21:00:40,614: Stepping primaite session. Step counter: 6\n", + "2023-10-10 21:00:40,615: Sending simulation state to agent client_1_green_user\n", + "2023-10-10 21:00:40,617: Getting agent action\n", + "2023-10-10 21:00:40,618: Formatting agent action DONOTHING\n", + "2023-10-10 21:00:40,619: Sending request to simulation: ['do_nothing']\n", + "2023-10-10 21:00:40,620: Sending simulation state to agent client_1_data_manipulation_red_bot\n", + "2023-10-10 21:00:40,621: Getting agent action\n", + "2023-10-10 21:00:40,623: Formatting agent action NODE_FILE_CORRUPT\n", + "2023-10-10 21:00:40,624: Sending request to simulation: ['do_nothing']\n", + "2023-10-10 21:00:40,625: Sending simulation state to agent defender\n", + "2023-10-10 21:00:40,626: Getting agent action\n", + "2023-10-10 21:00:40,628: Formatting agent action NETWORK_ACL_REMOVERULE\n", + "2023-10-10 21:00:40,629: Sending request to simulation: ['network', 'node', 'f0fb4743-43d5-4741-a0e5-78340a458a11', 'acl', 'remove_rule', 7]\n", + "2023-10-10 21:00:40,630: Initiating simulation step 6\n", + "2023-10-10 21:00:40,631: Stepping primaite session. Step counter: 7\n", + "2023-10-10 21:00:40,631: Sending simulation state to agent client_1_green_user\n", + "2023-10-10 21:00:40,633: Getting agent action\n", + "2023-10-10 21:00:40,634: Formatting agent action DONOTHING\n", + "2023-10-10 21:00:40,635: Sending request to simulation: ['do_nothing']\n", + "2023-10-10 21:00:40,635: Sending simulation state to agent client_1_data_manipulation_red_bot\n", + "2023-10-10 21:00:40,636: Getting agent action\n", + "2023-10-10 21:00:40,639: Formatting agent action NODE_FILE_CORRUPT\n", + "2023-10-10 21:00:40,640: Sending request to simulation: ['do_nothing']\n", + "2023-10-10 21:00:40,642: Sending simulation state to agent defender\n", + "2023-10-10 21:00:40,644: Getting agent action\n", + "2023-10-10 21:00:40,645: Formatting agent action NODE_SERVICE_STOP\n", + "2023-10-10 21:00:40,646: Sending request to simulation: ['do_nothing']\n", + "2023-10-10 21:00:40,647: Initiating simulation step 7\n", + "2023-10-10 21:00:40,648: Stepping primaite session. Step counter: 8\n", + "2023-10-10 21:00:40,649: Sending simulation state to agent client_1_green_user\n", + "2023-10-10 21:00:40,651: Getting agent action\n", + "2023-10-10 21:00:40,652: Formatting agent action DONOTHING\n", + "2023-10-10 21:00:40,652: Sending request to simulation: ['do_nothing']\n", + "2023-10-10 21:00:40,653: Sending simulation state to agent client_1_data_manipulation_red_bot\n", + "2023-10-10 21:00:40,655: Getting agent action\n", + "2023-10-10 21:00:40,656: Formatting agent action DONOTHING\n", + "2023-10-10 21:00:40,657: Sending request to simulation: ['do_nothing']\n", + "2023-10-10 21:00:40,659: Sending simulation state to agent defender\n", + "2023-10-10 21:00:40,661: Getting agent action\n", + "2023-10-10 21:00:40,662: Formatting agent action NODE_FILE_RESTORE\n", + "2023-10-10 21:00:40,663: Sending request to simulation: ['do_nothing']\n", + "2023-10-10 21:00:40,664: Initiating simulation step 8\n", + "2023-10-10 21:00:40,665: Stepping primaite session. Step counter: 9\n", + "2023-10-10 21:00:40,667: Sending simulation state to agent client_1_green_user\n", + "2023-10-10 21:00:40,668: Getting agent action\n", + "2023-10-10 21:00:40,669: Formatting agent action DONOTHING\n", + "2023-10-10 21:00:40,670: Sending request to simulation: ['do_nothing']\n", + "2023-10-10 21:00:40,672: Sending simulation state to agent client_1_data_manipulation_red_bot\n", + "2023-10-10 21:00:40,674: Getting agent action\n", + "2023-10-10 21:00:40,676: Formatting agent action NODE_FILE_CORRUPT\n", + "2023-10-10 21:00:40,677: Sending request to simulation: ['do_nothing']\n", + "2023-10-10 21:00:40,678: Sending simulation state to agent defender\n", + "2023-10-10 21:00:40,679: Getting agent action\n", + "2023-10-10 21:00:40,681: Formatting agent action DONOTHING\n", + "2023-10-10 21:00:40,682: Sending request to simulation: ['do_nothing']\n", + "2023-10-10 21:00:40,683: Initiating simulation step 9\n", + "2023-10-10 21:00:40,684: Stepping primaite session. Step counter: 10\n", + "2023-10-10 21:00:40,685: Sending simulation state to agent client_1_green_user\n", + "2023-10-10 21:00:40,687: Getting agent action\n", + "2023-10-10 21:00:40,688: Formatting agent action DONOTHING\n", + "2023-10-10 21:00:40,689: Sending request to simulation: ['do_nothing']\n", + "2023-10-10 21:00:40,690: Sending simulation state to agent client_1_data_manipulation_red_bot\n", + "2023-10-10 21:00:40,694: Getting agent action\n", + "2023-10-10 21:00:40,696: Formatting agent action NODE_FILE_CORRUPT\n", + "2023-10-10 21:00:40,697: Sending request to simulation: ['do_nothing']\n", + "2023-10-10 21:00:40,698: Sending simulation state to agent defender\n", + "2023-10-10 21:00:40,700: Getting agent action\n", + "2023-10-10 21:00:40,702: Formatting agent action NODE_FILE_SCAN\n", + "2023-10-10 21:00:40,705: Sending request to simulation: ['do_nothing']\n", + "2023-10-10 21:00:40,706: Initiating simulation step 10\n", + "2023-10-10 21:00:40,709: Stepping primaite session. Step counter: 11\n", + "2023-10-10 21:00:40,711: Sending simulation state to agent client_1_green_user\n", + "2023-10-10 21:00:40,713: Getting agent action\n", + "2023-10-10 21:00:40,715: Formatting agent action DONOTHING\n", + "2023-10-10 21:00:40,716: Sending request to simulation: ['do_nothing']\n", + "2023-10-10 21:00:40,717: Sending simulation state to agent client_1_data_manipulation_red_bot\n", + "2023-10-10 21:00:40,719: Getting agent action\n", + "2023-10-10 21:00:40,722: Formatting agent action NODE_FILE_DELETE\n", + "2023-10-10 21:00:40,724: Sending request to simulation: ['do_nothing']\n", + "2023-10-10 21:00:40,726: Sending simulation state to agent defender\n", + "2023-10-10 21:00:40,728: Getting agent action\n", + "2023-10-10 21:00:40,730: Formatting agent action NODE_SERVICE_START\n", + "2023-10-10 21:00:40,731: Sending request to simulation: ['do_nothing']\n", + "2023-10-10 21:00:40,733: Initiating simulation step 11\n", + "2023-10-10 21:00:40,735: Stepping primaite session. Step counter: 12\n", + "2023-10-10 21:00:40,736: Sending simulation state to agent client_1_green_user\n", + "2023-10-10 21:00:40,738: Getting agent action\n", + "2023-10-10 21:00:40,739: Formatting agent action DONOTHING\n", + "2023-10-10 21:00:40,740: Sending request to simulation: ['do_nothing']\n", + "2023-10-10 21:00:40,741: Sending simulation state to agent client_1_data_manipulation_red_bot\n", + "2023-10-10 21:00:40,743: Getting agent action\n", + "2023-10-10 21:00:40,746: Formatting agent action NODE_FILE_CORRUPT\n", + "2023-10-10 21:00:40,748: Sending request to simulation: ['do_nothing']\n", + "2023-10-10 21:00:40,749: Sending simulation state to agent defender\n", + "2023-10-10 21:00:40,752: Getting agent action\n", + "2023-10-10 21:00:40,755: Formatting agent action NETWORK_ACL_ADDRULE\n", + "2023-10-10 21:00:40,758: Sending request to simulation: ['network', 'node', 'f0fb4743-43d5-4741-a0e5-78340a458a11', 'acl', 'add_rule', 'DENY', 'TCP', IPv4Address('192.168.1.12'), 'ALL', IPv4Address('127.0.0.1'), 'ALL', 1]\n", + "2023-10-10 21:00:40,760: Initiating simulation step 12\n", + "2023-10-10 21:00:40,762: Stepping primaite session. Step counter: 13\n", + "2023-10-10 21:00:40,763: Sending simulation state to agent client_1_green_user\n", + "2023-10-10 21:00:40,766: Getting agent action\n", + "2023-10-10 21:00:40,768: Formatting agent action DONOTHING\n", + "2023-10-10 21:00:40,769: Sending request to simulation: ['do_nothing']\n", + "2023-10-10 21:00:40,771: Sending simulation state to agent client_1_data_manipulation_red_bot\n", + "2023-10-10 21:00:40,773: Getting agent action\n", + "2023-10-10 21:00:40,777: Formatting agent action NODE_FILE_DELETE\n", + "2023-10-10 21:00:40,779: Sending request to simulation: ['do_nothing']\n", + "2023-10-10 21:00:40,780: Sending simulation state to agent defender\n", + "2023-10-10 21:00:40,782: Getting agent action\n", + "2023-10-10 21:00:40,784: Formatting agent action NODE_SERVICE_RESTART\n", + "2023-10-10 21:00:40,785: Sending request to simulation: ['do_nothing']\n", + "2023-10-10 21:00:40,786: Initiating simulation step 13\n", + "2023-10-10 21:00:40,787: Stepping primaite session. Step counter: 14\n", + "2023-10-10 21:00:40,788: Sending simulation state to agent client_1_green_user\n", + "2023-10-10 21:00:40,790: Getting agent action\n", + "2023-10-10 21:00:40,792: Formatting agent action DONOTHING\n", + "2023-10-10 21:00:40,794: Sending request to simulation: ['do_nothing']\n", + "2023-10-10 21:00:40,795: Sending simulation state to agent client_1_data_manipulation_red_bot\n", + "2023-10-10 21:00:40,797: Getting agent action\n", + "2023-10-10 21:00:40,799: Formatting agent action NODE_FILE_CORRUPT\n", + "2023-10-10 21:00:40,800: Sending request to simulation: ['do_nothing']\n", + "2023-10-10 21:00:40,801: Sending simulation state to agent defender\n", + "2023-10-10 21:00:40,803: Getting agent action\n", + "2023-10-10 21:00:40,805: Formatting agent action NODE_SERVICE_DISABLE\n", + "2023-10-10 21:00:40,806: Sending request to simulation: ['do_nothing']\n", + "2023-10-10 21:00:40,807: Initiating simulation step 14\n", + "2023-10-10 21:00:40,808: Stepping primaite session. Step counter: 15\n", + "2023-10-10 21:00:40,809: Sending simulation state to agent client_1_green_user\n", + "2023-10-10 21:00:40,813: Getting agent action\n", + "2023-10-10 21:00:40,815: Formatting agent action DONOTHING\n", + "2023-10-10 21:00:40,817: Sending request to simulation: ['do_nothing']\n", + "2023-10-10 21:00:40,818: Sending simulation state to agent client_1_data_manipulation_red_bot\n", + "2023-10-10 21:00:40,821: Getting agent action\n", + "2023-10-10 21:00:40,822: Formatting agent action NODE_FILE_DELETE\n", + "2023-10-10 21:00:40,824: Sending request to simulation: ['do_nothing']\n", + "2023-10-10 21:00:40,828: Sending simulation state to agent defender\n", + "2023-10-10 21:00:40,830: Getting agent action\n", + "2023-10-10 21:00:40,832: Formatting agent action NETWORK_NIC_DISABLE\n", + "2023-10-10 21:00:40,833: Sending request to simulation: ['do_nothing']\n", + "2023-10-10 21:00:40,835: Initiating simulation step 15\n", + "2023-10-10 21:00:40,836: Stepping primaite session. Step counter: 16\n", + "2023-10-10 21:00:40,838: Sending simulation state to agent client_1_green_user\n", + "2023-10-10 21:00:40,840: Getting agent action\n", + "2023-10-10 21:00:40,848: Formatting agent action DONOTHING\n", + "2023-10-10 21:00:40,852: Sending request to simulation: ['do_nothing']\n", + "2023-10-10 21:00:40,856: Sending simulation state to agent client_1_data_manipulation_red_bot\n", + "2023-10-10 21:00:40,858: Getting agent action\n", + "2023-10-10 21:00:40,863: Formatting agent action NODE_FILE_DELETE\n", + "2023-10-10 21:00:40,868: Sending request to simulation: ['do_nothing']\n", + "2023-10-10 21:00:40,869: Sending simulation state to agent defender\n", + "2023-10-10 21:00:40,872: Getting agent action\n", + "2023-10-10 21:00:40,878: Formatting agent action NODE_OS_SCAN\n", + "2023-10-10 21:00:40,883: Sending request to simulation: ['network', 'node', '29d55bd4-d59e-4f73-95ad-b430c8716b15', 'scan']\n", + "2023-10-10 21:00:40,885: Initiating simulation step 16\n", + "2023-10-10 21:00:40,887: Stepping primaite session. Step counter: 17\n", + "2023-10-10 21:00:40,889: Sending simulation state to agent client_1_green_user\n", + "2023-10-10 21:00:40,900: Getting agent action\n", + "2023-10-10 21:00:40,904: Formatting agent action DONOTHING\n", + "2023-10-10 21:00:40,909: Sending request to simulation: ['do_nothing']\n", + "2023-10-10 21:00:40,911: Sending simulation state to agent client_1_data_manipulation_red_bot\n", + "2023-10-10 21:00:40,913: Getting agent action\n", + "2023-10-10 21:00:40,915: Formatting agent action NODE_FILE_DELETE\n", + "2023-10-10 21:00:40,917: Sending request to simulation: ['do_nothing']\n", + "2023-10-10 21:00:40,918: Sending simulation state to agent defender\n", + "2023-10-10 21:00:40,920: Getting agent action\n", + "2023-10-10 21:00:40,921: Formatting agent action NETWORK_ACL_ADDRULE\n", + "2023-10-10 21:00:40,922: Sending request to simulation: ['network', 'node', 'f0fb4743-43d5-4741-a0e5-78340a458a11', 'acl', 'add_rule', 'DENY', 'TCP', IPv4Address('192.168.1.10'), 'ALL', IPv4Address('127.0.0.1'), 'ALL', 1]\n", + "2023-10-10 21:00:40,924: Initiating simulation step 17\n", + "2023-10-10 21:00:40,925: Stepping primaite session. Step counter: 18\n", + "2023-10-10 21:00:40,927: Sending simulation state to agent client_1_green_user\n", + "2023-10-10 21:00:40,929: Getting agent action\n", + "2023-10-10 21:00:40,931: Formatting agent action DONOTHING\n", + "2023-10-10 21:00:40,933: Sending request to simulation: ['do_nothing']\n", + "2023-10-10 21:00:40,934: Sending simulation state to agent client_1_data_manipulation_red_bot\n", + "2023-10-10 21:00:40,936: Getting agent action\n", + "2023-10-10 21:00:40,938: Formatting agent action NODE_FILE_CORRUPT\n", + "2023-10-10 21:00:40,940: Sending request to simulation: ['do_nothing']\n", + "2023-10-10 21:00:40,941: Sending simulation state to agent defender\n", + "2023-10-10 21:00:40,945: Getting agent action\n", + "2023-10-10 21:00:40,947: Formatting agent action NETWORK_ACL_ADDRULE\n", + "2023-10-10 21:00:40,948: Sending request to simulation: ['do_nothing']\n", + "2023-10-10 21:00:40,949: Initiating simulation step 18\n", + "2023-10-10 21:00:40,951: Stepping primaite session. Step counter: 19\n", + "2023-10-10 21:00:40,952: Sending simulation state to agent client_1_green_user\n", + "2023-10-10 21:00:40,954: Getting agent action\n", + "2023-10-10 21:00:40,955: Formatting agent action DONOTHING\n", + "2023-10-10 21:00:40,957: Sending request to simulation: ['do_nothing']\n", + "2023-10-10 21:00:40,960: Sending simulation state to agent client_1_data_manipulation_red_bot\n", + "2023-10-10 21:00:40,962: Getting agent action\n", + "2023-10-10 21:00:40,964: Formatting agent action NODE_FILE_CORRUPT\n", + "2023-10-10 21:00:40,966: Sending request to simulation: ['do_nothing']\n", + "2023-10-10 21:00:40,967: Sending simulation state to agent defender\n", + "2023-10-10 21:00:40,969: Getting agent action\n", + "2023-10-10 21:00:40,971: Formatting agent action DONOTHING\n", + "2023-10-10 21:00:40,972: Sending request to simulation: ['do_nothing']\n", + "2023-10-10 21:00:40,973: Initiating simulation step 19\n", + "2023-10-10 21:00:40,975: Stepping primaite session. Step counter: 20\n", + "2023-10-10 21:00:40,976: Sending simulation state to agent client_1_green_user\n", + "2023-10-10 21:00:40,979: Getting agent action\n", + "2023-10-10 21:00:40,981: Formatting agent action DONOTHING\n", + "2023-10-10 21:00:40,982: Sending request to simulation: ['do_nothing']\n", + "2023-10-10 21:00:40,983: Sending simulation state to agent client_1_data_manipulation_red_bot\n", + "2023-10-10 21:00:40,986: Getting agent action\n", + "2023-10-10 21:00:40,987: Formatting agent action NODE_FILE_DELETE\n", + "2023-10-10 21:00:40,989: Sending request to simulation: ['do_nothing']\n", + "2023-10-10 21:00:40,990: Sending simulation state to agent defender\n", + "2023-10-10 21:00:40,992: Getting agent action\n", + "2023-10-10 21:00:40,994: Formatting agent action NETWORK_ACL_ADDRULE\n", + "2023-10-10 21:00:40,996: Sending request to simulation: ['network', 'node', 'f0fb4743-43d5-4741-a0e5-78340a458a11', 'acl', 'add_rule', 'DENY', 'TCP', IPv4Address('192.168.1.12'), 'ALL', IPv4Address('127.0.0.1'), 'ALL', 1]\n", + "2023-10-10 21:00:40,997: Initiating simulation step 20\n", + "2023-10-10 21:00:40,998: Stepping primaite session. Step counter: 21\n", + "2023-10-10 21:00:41,000: Sending simulation state to agent client_1_green_user\n", + "2023-10-10 21:00:41,001: Getting agent action\n", + "2023-10-10 21:00:41,003: Formatting agent action DONOTHING\n", + "2023-10-10 21:00:41,004: Sending request to simulation: ['do_nothing']\n", + "2023-10-10 21:00:41,005: Sending simulation state to agent client_1_data_manipulation_red_bot\n", + "2023-10-10 21:00:41,006: Getting agent action\n", + "2023-10-10 21:00:41,009: Formatting agent action DONOTHING\n", + "2023-10-10 21:00:41,010: Sending request to simulation: ['do_nothing']\n", + "2023-10-10 21:00:41,011: Sending simulation state to agent defender\n", + "2023-10-10 21:00:41,014: Getting agent action\n", + "2023-10-10 21:00:41,016: Formatting agent action NODE_FILE_REPAIR\n", + "2023-10-10 21:00:41,017: Sending request to simulation: ['do_nothing']\n", + "2023-10-10 21:00:41,018: Initiating simulation step 21\n", + "2023-10-10 21:00:41,020: Stepping primaite session. Step counter: 22\n", + "2023-10-10 21:00:41,021: Sending simulation state to agent client_1_green_user\n", + "2023-10-10 21:00:41,023: Getting agent action\n", + "2023-10-10 21:00:41,024: Formatting agent action DONOTHING\n", + "2023-10-10 21:00:41,025: Sending request to simulation: ['do_nothing']\n", + "2023-10-10 21:00:41,027: Sending simulation state to agent client_1_data_manipulation_red_bot\n", + "2023-10-10 21:00:41,030: Getting agent action\n", + "2023-10-10 21:00:41,031: Formatting agent action NODE_FILE_CORRUPT\n", + "2023-10-10 21:00:41,033: Sending request to simulation: ['do_nothing']\n", + "2023-10-10 21:00:41,034: Sending simulation state to agent defender\n", + "2023-10-10 21:00:41,036: Getting agent action\n", + "2023-10-10 21:00:41,037: Formatting agent action NODE_FILE_REPAIR\n", + "2023-10-10 21:00:41,038: Sending request to simulation: ['do_nothing']\n", + "2023-10-10 21:00:41,039: Initiating simulation step 22\n", + "2023-10-10 21:00:41,040: Stepping primaite session. Step counter: 23\n", + "2023-10-10 21:00:41,042: Sending simulation state to agent client_1_green_user\n", + "2023-10-10 21:00:41,045: Getting agent action\n", + "2023-10-10 21:00:41,047: Formatting agent action DONOTHING\n", + "2023-10-10 21:00:41,049: Sending request to simulation: ['do_nothing']\n", + "2023-10-10 21:00:41,050: Sending simulation state to agent client_1_data_manipulation_red_bot\n", + "2023-10-10 21:00:41,056: Getting agent action\n", + "2023-10-10 21:00:41,065: Formatting agent action NODE_FILE_CORRUPT\n", + "2023-10-10 21:00:41,067: Sending request to simulation: ['do_nothing']\n", + "2023-10-10 21:00:41,068: Sending simulation state to agent defender\n", + "2023-10-10 21:00:41,072: Getting agent action\n", + "2023-10-10 21:00:41,073: Formatting agent action NODE_FOLDER_REPAIR\n", + "2023-10-10 21:00:41,075: Sending request to simulation: ['do_nothing']\n", + "2023-10-10 21:00:41,077: Initiating simulation step 23\n", + "2023-10-10 21:00:41,079: Stepping primaite session. Step counter: 24\n", + "2023-10-10 21:00:41,081: Sending simulation state to agent client_1_green_user\n", + "2023-10-10 21:00:41,083: Getting agent action\n", + "2023-10-10 21:00:41,085: Formatting agent action DONOTHING\n", + "2023-10-10 21:00:41,086: Sending request to simulation: ['do_nothing']\n", + "2023-10-10 21:00:41,088: Sending simulation state to agent client_1_data_manipulation_red_bot\n", + "2023-10-10 21:00:41,090: Getting agent action\n", + "2023-10-10 21:00:41,092: Formatting agent action NODE_FILE_DELETE\n", + "2023-10-10 21:00:41,093: Sending request to simulation: ['do_nothing']\n", + "2023-10-10 21:00:41,095: Sending simulation state to agent defender\n", + "2023-10-10 21:00:41,097: Getting agent action\n", + "2023-10-10 21:00:41,099: Formatting agent action NODE_STARTUP\n", + "2023-10-10 21:00:41,100: Sending request to simulation: ['network', 'node', '19dbb2d4-648b-4387-aa15-99757b513acb', 'startup']\n", + "2023-10-10 21:00:41,102: Initiating simulation step 24\n", + "2023-10-10 21:00:41,103: Stepping primaite session. Step counter: 25\n", + "2023-10-10 21:00:41,104: Sending simulation state to agent client_1_green_user\n", + "2023-10-10 21:00:41,107: Getting agent action\n", + "2023-10-10 21:00:41,110: Formatting agent action DONOTHING\n", + "2023-10-10 21:00:41,112: Sending request to simulation: ['do_nothing']\n", + "2023-10-10 21:00:41,113: Sending simulation state to agent client_1_data_manipulation_red_bot\n", + "2023-10-10 21:00:41,114: Getting agent action\n", + "2023-10-10 21:00:41,116: Formatting agent action NODE_OS_SCAN\n", + "2023-10-10 21:00:41,118: Sending request to simulation: ['network', 'node', 'ffe02a33-7f9c-4fc1-ad3a-791935dbd4c2', 'scan']\n", + "2023-10-10 21:00:41,120: Sending simulation state to agent defender\n", + "2023-10-10 21:00:41,122: Getting agent action\n", + "2023-10-10 21:00:41,124: Formatting agent action NODE_FOLDER_RESTORE\n", + "2023-10-10 21:00:41,126: Sending request to simulation: ['do_nothing']\n", + "2023-10-10 21:00:41,127: Initiating simulation step 25\n", + "2023-10-10 21:00:41,129: Stepping primaite session. Step counter: 26\n", + "2023-10-10 21:00:41,130: Sending simulation state to agent client_1_green_user\n", + "2023-10-10 21:00:41,132: Getting agent action\n", + "2023-10-10 21:00:41,134: Formatting agent action DONOTHING\n", + "2023-10-10 21:00:41,136: Sending request to simulation: ['do_nothing']\n", + "2023-10-10 21:00:41,137: Sending simulation state to agent client_1_data_manipulation_red_bot\n", + "2023-10-10 21:00:41,139: Getting agent action\n", + "2023-10-10 21:00:41,141: Formatting agent action NODE_FILE_DELETE\n", + "2023-10-10 21:00:41,142: Sending request to simulation: ['do_nothing']\n", + "2023-10-10 21:00:41,144: Sending simulation state to agent defender\n", + "2023-10-10 21:00:41,145: Getting agent action\n", + "2023-10-10 21:00:41,147: Formatting agent action NODE_STARTUP\n", + "2023-10-10 21:00:41,148: Sending request to simulation: ['network', 'node', '19dbb2d4-648b-4387-aa15-99757b513acb', 'startup']\n", + "2023-10-10 21:00:41,150: Initiating simulation step 26\n", + "2023-10-10 21:00:41,151: Stepping primaite session. Step counter: 27\n", + "2023-10-10 21:00:41,153: Sending simulation state to agent client_1_green_user\n", + "2023-10-10 21:00:41,155: Getting agent action\n", + "2023-10-10 21:00:41,157: Formatting agent action DONOTHING\n", + "2023-10-10 21:00:41,158: Sending request to simulation: ['do_nothing']\n", + "2023-10-10 21:00:41,160: Sending simulation state to agent client_1_data_manipulation_red_bot\n", + "2023-10-10 21:00:41,162: Getting agent action\n", + "2023-10-10 21:00:41,164: Formatting agent action NODE_FILE_DELETE\n", + "2023-10-10 21:00:41,166: Sending request to simulation: ['do_nothing']\n", + "2023-10-10 21:00:41,166: Sending simulation state to agent defender\n", + "2023-10-10 21:00:41,169: Getting agent action\n", + "2023-10-10 21:00:41,170: Formatting agent action NODE_SERVICE_START\n", + "2023-10-10 21:00:41,172: Sending request to simulation: ['do_nothing']\n", + "2023-10-10 21:00:41,173: Initiating simulation step 27\n", + "2023-10-10 21:00:41,174: Stepping primaite session. Step counter: 28\n", + "2023-10-10 21:00:41,176: Sending simulation state to agent client_1_green_user\n", + "2023-10-10 21:00:41,177: Getting agent action\n", + "2023-10-10 21:00:41,179: Formatting agent action DONOTHING\n", + "2023-10-10 21:00:41,181: Sending request to simulation: ['do_nothing']\n", + "2023-10-10 21:00:41,182: Sending simulation state to agent client_1_data_manipulation_red_bot\n", + "2023-10-10 21:00:41,183: Getting agent action\n", + "2023-10-10 21:00:41,185: Formatting agent action NODE_FILE_DELETE\n", + "2023-10-10 21:00:41,186: Sending request to simulation: ['do_nothing']\n", + "2023-10-10 21:00:41,187: Sending simulation state to agent defender\n", + "2023-10-10 21:00:41,188: Getting agent action\n", + "2023-10-10 21:00:41,190: Formatting agent action NETWORK_NIC_DISABLE\n", + "2023-10-10 21:00:41,191: Sending request to simulation: ['do_nothing']\n", + "2023-10-10 21:00:41,193: Initiating simulation step 28\n", + "2023-10-10 21:00:41,194: Stepping primaite session. Step counter: 29\n", + "2023-10-10 21:00:41,196: Sending simulation state to agent client_1_green_user\n", + "2023-10-10 21:00:41,198: Getting agent action\n", + "2023-10-10 21:00:41,199: Formatting agent action DONOTHING\n", + "2023-10-10 21:00:41,201: Sending request to simulation: ['do_nothing']\n", + "2023-10-10 21:00:41,201: Sending simulation state to agent client_1_data_manipulation_red_bot\n", + "2023-10-10 21:00:41,203: Getting agent action\n", + "2023-10-10 21:00:41,204: Formatting agent action DONOTHING\n", + "2023-10-10 21:00:41,206: Sending request to simulation: ['do_nothing']\n", + "2023-10-10 21:00:41,207: Sending simulation state to agent defender\n", + "2023-10-10 21:00:41,208: Getting agent action\n", + "2023-10-10 21:00:41,211: Formatting agent action NETWORK_ACL_REMOVERULE\n", + "2023-10-10 21:00:41,213: Sending request to simulation: ['network', 'node', 'f0fb4743-43d5-4741-a0e5-78340a458a11', 'acl', 'remove_rule', 3]\n", + "2023-10-10 21:00:41,215: Initiating simulation step 29\n", + "2023-10-10 21:00:41,217: Stepping primaite session. Step counter: 30\n", + "2023-10-10 21:00:41,218: Sending simulation state to agent client_1_green_user\n", + "2023-10-10 21:00:41,220: Getting agent action\n", + "2023-10-10 21:00:41,221: Formatting agent action DONOTHING\n", + "2023-10-10 21:00:41,222: Sending request to simulation: ['do_nothing']\n", + "2023-10-10 21:00:41,223: Sending simulation state to agent client_1_data_manipulation_red_bot\n", + "2023-10-10 21:00:41,225: Getting agent action\n", + "2023-10-10 21:00:41,227: Formatting agent action NODE_FILE_DELETE\n", + "2023-10-10 21:00:41,229: Sending request to simulation: ['do_nothing']\n", + "2023-10-10 21:00:41,231: Sending simulation state to agent defender\n", + "2023-10-10 21:00:41,232: Getting agent action\n", + "2023-10-10 21:00:41,233: Formatting agent action NETWORK_ACL_ADDRULE\n", + "2023-10-10 21:00:41,235: Sending request to simulation: ['network', 'node', 'f0fb4743-43d5-4741-a0e5-78340a458a11', 'acl', 'add_rule', 'DENY', 'TCP', IPv4Address('192.168.1.10'), 'ALL', IPv4Address('127.0.0.1'), 'ALL', 1]\n", + "2023-10-10 21:00:41,236: Initiating simulation step 30\n", + "2023-10-10 21:00:41,238: Stepping primaite session. Step counter: 31\n", + "2023-10-10 21:00:41,238: Sending simulation state to agent client_1_green_user\n", + "2023-10-10 21:00:41,240: Getting agent action\n", + "2023-10-10 21:00:41,242: Formatting agent action DONOTHING\n", + "2023-10-10 21:00:41,244: Sending request to simulation: ['do_nothing']\n", + "2023-10-10 21:00:41,245: Sending simulation state to agent client_1_data_manipulation_red_bot\n", + "2023-10-10 21:00:41,248: Getting agent action\n", + "2023-10-10 21:00:41,249: Formatting agent action NODE_FILE_CORRUPT\n", + "2023-10-10 21:00:41,251: Sending request to simulation: ['do_nothing']\n", + "2023-10-10 21:00:41,252: Sending simulation state to agent defender\n", + "2023-10-10 21:00:41,254: Getting agent action\n", + "2023-10-10 21:00:41,255: Formatting agent action NODE_FILE_RESTORE\n", + "2023-10-10 21:00:41,256: Sending request to simulation: ['do_nothing']\n", + "2023-10-10 21:00:41,257: Initiating simulation step 31\n", + "2023-10-10 21:00:41,259: Stepping primaite session. Step counter: 32\n", + "2023-10-10 21:00:41,260: Sending simulation state to agent client_1_green_user\n", + "2023-10-10 21:00:41,263: Getting agent action\n", + "2023-10-10 21:00:41,264: Formatting agent action DONOTHING\n", + "2023-10-10 21:00:41,266: Sending request to simulation: ['do_nothing']\n", + "2023-10-10 21:00:41,267: Sending simulation state to agent client_1_data_manipulation_red_bot\n", + "2023-10-10 21:00:41,268: Getting agent action\n", + "2023-10-10 21:00:41,269: Formatting agent action NODE_FILE_DELETE\n", + "2023-10-10 21:00:41,270: Sending request to simulation: ['do_nothing']\n", + "2023-10-10 21:00:41,272: Sending simulation state to agent defender\n", + "2023-10-10 21:00:41,273: Getting agent action\n", + "2023-10-10 21:00:41,275: Formatting agent action NODE_FILE_RESTORE\n", + "2023-10-10 21:00:41,277: Sending request to simulation: ['do_nothing']\n", + "2023-10-10 21:00:41,278: Initiating simulation step 32\n", + "2023-10-10 21:00:41,280: Stepping primaite session. Step counter: 33\n", + "2023-10-10 21:00:41,281: Sending simulation state to agent client_1_green_user\n", + "2023-10-10 21:00:41,284: Getting agent action\n", + "2023-10-10 21:00:41,286: Formatting agent action DONOTHING\n", + "2023-10-10 21:00:41,288: Sending request to simulation: ['do_nothing']\n", + "2023-10-10 21:00:41,289: Sending simulation state to agent client_1_data_manipulation_red_bot\n", + "2023-10-10 21:00:41,291: Getting agent action\n", + "2023-10-10 21:00:41,293: Formatting agent action NODE_FILE_DELETE\n", + "2023-10-10 21:00:41,295: Sending request to simulation: ['do_nothing']\n", + "2023-10-10 21:00:41,299: Sending simulation state to agent defender\n", + "2023-10-10 21:00:41,301: Getting agent action\n", + "2023-10-10 21:00:41,307: Formatting agent action NETWORK_ACL_REMOVERULE\n", + "2023-10-10 21:00:41,309: Sending request to simulation: ['network', 'node', 'f0fb4743-43d5-4741-a0e5-78340a458a11', 'acl', 'remove_rule', 2]\n", + "2023-10-10 21:00:41,311: Initiating simulation step 33\n", + "2023-10-10 21:00:41,312: Stepping primaite session. Step counter: 34\n", + "2023-10-10 21:00:41,322: Sending simulation state to agent client_1_green_user\n", + "2023-10-10 21:00:41,325: Getting agent action\n", + "2023-10-10 21:00:41,327: Formatting agent action DONOTHING\n", + "2023-10-10 21:00:41,328: Sending request to simulation: ['do_nothing']\n", + "2023-10-10 21:00:41,339: Sending simulation state to agent client_1_data_manipulation_red_bot\n", + "2023-10-10 21:00:41,341: Getting agent action\n", + "2023-10-10 21:00:41,343: Formatting agent action NODE_FILE_DELETE\n", + "2023-10-10 21:00:41,345: Sending request to simulation: ['do_nothing']\n", + "2023-10-10 21:00:41,346: Sending simulation state to agent defender\n", + "2023-10-10 21:00:41,348: Getting agent action\n", + "2023-10-10 21:00:41,350: Formatting agent action NODE_FOLDER_CHECKHASH\n", + "2023-10-10 21:00:41,352: Sending request to simulation: ['do_nothing']\n", + "2023-10-10 21:00:41,354: Initiating simulation step 34\n", + "2023-10-10 21:00:41,355: Stepping primaite session. Step counter: 35\n", + "2023-10-10 21:00:41,357: Sending simulation state to agent client_1_green_user\n", + "2023-10-10 21:00:41,359: Getting agent action\n", + "2023-10-10 21:00:41,360: Formatting agent action DONOTHING\n", + "2023-10-10 21:00:41,362: Sending request to simulation: ['do_nothing']\n", + "2023-10-10 21:00:41,363: Sending simulation state to agent client_1_data_manipulation_red_bot\n", + "2023-10-10 21:00:41,366: Getting agent action\n", + "2023-10-10 21:00:41,368: Formatting agent action DONOTHING\n", + "2023-10-10 21:00:41,369: Sending request to simulation: ['do_nothing']\n", + "2023-10-10 21:00:41,370: Sending simulation state to agent defender\n", + "2023-10-10 21:00:41,371: Getting agent action\n", + "2023-10-10 21:00:41,373: Formatting agent action NODE_FILE_RESTORE\n", + "2023-10-10 21:00:41,378: Sending request to simulation: ['do_nothing']\n", + "2023-10-10 21:00:41,381: Initiating simulation step 35\n", + "2023-10-10 21:00:41,382: Stepping primaite session. Step counter: 36\n", + "2023-10-10 21:00:41,384: Sending simulation state to agent client_1_green_user\n", + "2023-10-10 21:00:41,386: Getting agent action\n", + "2023-10-10 21:00:41,388: Formatting agent action DONOTHING\n", + "2023-10-10 21:00:41,389: Sending request to simulation: ['do_nothing']\n", + "2023-10-10 21:00:41,390: Sending simulation state to agent client_1_data_manipulation_red_bot\n", + "2023-10-10 21:00:41,392: Getting agent action\n", + "2023-10-10 21:00:41,394: Formatting agent action NODE_FILE_DELETE\n", + "2023-10-10 21:00:41,395: Sending request to simulation: ['do_nothing']\n", + "2023-10-10 21:00:41,397: Sending simulation state to agent defender\n", + "2023-10-10 21:00:41,399: Getting agent action\n", + "2023-10-10 21:00:41,401: Formatting agent action NODE_SERVICE_RESUME\n", + "2023-10-10 21:00:41,402: Sending request to simulation: ['do_nothing']\n", + "2023-10-10 21:00:41,403: Initiating simulation step 36\n", + "2023-10-10 21:00:41,405: Stepping primaite session. Step counter: 37\n", + "2023-10-10 21:00:41,406: Sending simulation state to agent client_1_green_user\n", + "2023-10-10 21:00:41,408: Getting agent action\n", + "2023-10-10 21:00:41,409: Formatting agent action DONOTHING\n", + "2023-10-10 21:00:41,410: Sending request to simulation: ['do_nothing']\n", + "2023-10-10 21:00:41,413: Sending simulation state to agent client_1_data_manipulation_red_bot\n", + "2023-10-10 21:00:41,415: Getting agent action\n", + "2023-10-10 21:00:41,416: Formatting agent action NODE_FILE_CORRUPT\n", + "2023-10-10 21:00:41,417: Sending request to simulation: ['do_nothing']\n", + "2023-10-10 21:00:41,418: Sending simulation state to agent defender\n", + "2023-10-10 21:00:41,420: Getting agent action\n", + "2023-10-10 21:00:41,422: Formatting agent action NETWORK_ACL_ADDRULE\n", + "2023-10-10 21:00:41,422: Sending request to simulation: ['do_nothing']\n", + "2023-10-10 21:00:41,424: Initiating simulation step 37\n", + "2023-10-10 21:00:41,425: Stepping primaite session. Step counter: 38\n", + "2023-10-10 21:00:41,427: Sending simulation state to agent client_1_green_user\n", + "2023-10-10 21:00:41,429: Getting agent action\n", + "2023-10-10 21:00:41,431: Formatting agent action DONOTHING\n", + "2023-10-10 21:00:41,432: Sending request to simulation: ['do_nothing']\n", + "2023-10-10 21:00:41,433: Sending simulation state to agent client_1_data_manipulation_red_bot\n", + "2023-10-10 21:00:41,434: Getting agent action\n", + "2023-10-10 21:00:41,436: Formatting agent action NODE_OS_SCAN\n", + "2023-10-10 21:00:41,438: Sending request to simulation: ['network', 'node', 'ffe02a33-7f9c-4fc1-ad3a-791935dbd4c2', 'scan']\n", + "2023-10-10 21:00:41,440: Sending simulation state to agent defender\n", + "2023-10-10 21:00:41,442: Getting agent action\n", + "2023-10-10 21:00:41,444: Formatting agent action NODE_FILE_CHECKHASH\n", + "2023-10-10 21:00:41,449: Sending request to simulation: ['do_nothing']\n", + "2023-10-10 21:00:41,451: Initiating simulation step 38\n", + "2023-10-10 21:00:41,452: Stepping primaite session. Step counter: 39\n", + "2023-10-10 21:00:41,453: Sending simulation state to agent client_1_green_user\n", + "2023-10-10 21:00:41,457: Getting agent action\n", + "2023-10-10 21:00:41,459: Formatting agent action DONOTHING\n", + "2023-10-10 21:00:41,461: Sending request to simulation: ['do_nothing']\n", + "2023-10-10 21:00:41,462: Sending simulation state to agent client_1_data_manipulation_red_bot\n", + "2023-10-10 21:00:41,464: Getting agent action\n", + "2023-10-10 21:00:41,465: Formatting agent action NODE_FILE_DELETE\n", + "2023-10-10 21:00:41,467: Sending request to simulation: ['do_nothing']\n", + "2023-10-10 21:00:41,469: Sending simulation state to agent defender\n", + "2023-10-10 21:00:41,472: Getting agent action\n", + "2023-10-10 21:00:41,475: Formatting agent action NODE_SERVICE_SCAN\n", + "2023-10-10 21:00:41,476: Sending request to simulation: ['do_nothing']\n", + "2023-10-10 21:00:41,477: Initiating simulation step 39\n", + "2023-10-10 21:00:41,479: Stepping primaite session. Step counter: 40\n", + "2023-10-10 21:00:41,480: Sending simulation state to agent client_1_green_user\n", + "2023-10-10 21:00:41,482: Getting agent action\n", + "2023-10-10 21:00:41,484: Formatting agent action DONOTHING\n", + "2023-10-10 21:00:41,486: Sending request to simulation: ['do_nothing']\n", + "2023-10-10 21:00:41,487: Sending simulation state to agent client_1_data_manipulation_red_bot\n", + "2023-10-10 21:00:41,489: Getting agent action\n", + "2023-10-10 21:00:41,490: Formatting agent action NODE_FILE_CORRUPT\n", + "2023-10-10 21:00:41,491: Sending request to simulation: ['do_nothing']\n", + "2023-10-10 21:00:41,493: Sending simulation state to agent defender\n", + "2023-10-10 21:00:41,495: Getting agent action\n", + "2023-10-10 21:00:41,497: Formatting agent action NETWORK_ACL_REMOVERULE\n", + "2023-10-10 21:00:41,498: Sending request to simulation: ['network', 'node', 'f0fb4743-43d5-4741-a0e5-78340a458a11', 'acl', 'remove_rule', 7]\n", + "2023-10-10 21:00:41,499: Initiating simulation step 40\n", + "2023-10-10 21:00:41,501: Stepping primaite session. Step counter: 41\n", + "2023-10-10 21:00:41,503: Sending simulation state to agent client_1_green_user\n", + "2023-10-10 21:00:41,504: Getting agent action\n", + "2023-10-10 21:00:41,506: Formatting agent action DONOTHING\n", + "2023-10-10 21:00:41,507: Sending request to simulation: ['do_nothing']\n", + "2023-10-10 21:00:41,509: Sending simulation state to agent client_1_data_manipulation_red_bot\n", + "2023-10-10 21:00:41,510: Getting agent action\n", + "2023-10-10 21:00:41,513: Formatting agent action NODE_FILE_CORRUPT\n", + "2023-10-10 21:00:41,514: Sending request to simulation: ['do_nothing']\n", + "2023-10-10 21:00:41,515: Sending simulation state to agent defender\n", + "2023-10-10 21:00:41,517: Getting agent action\n", + "2023-10-10 21:00:41,519: Formatting agent action NETWORK_ACL_REMOVERULE\n", + "2023-10-10 21:00:41,520: Sending request to simulation: ['network', 'node', 'f0fb4743-43d5-4741-a0e5-78340a458a11', 'acl', 'remove_rule', 0]\n", + "2023-10-10 21:00:41,521: Initiating simulation step 41\n", + "2023-10-10 21:00:41,522: Stepping primaite session. Step counter: 42\n", + "2023-10-10 21:00:41,523: Sending simulation state to agent client_1_green_user\n", + "2023-10-10 21:00:41,524: Getting agent action\n", + "2023-10-10 21:00:41,527: Formatting agent action DONOTHING\n", + "2023-10-10 21:00:41,528: Sending request to simulation: ['do_nothing']\n", + "2023-10-10 21:00:41,530: Sending simulation state to agent client_1_data_manipulation_red_bot\n", + "2023-10-10 21:00:41,532: Getting agent action\n", + "2023-10-10 21:00:41,534: Formatting agent action NODE_FILE_DELETE\n", + "2023-10-10 21:00:41,535: Sending request to simulation: ['do_nothing']\n", + "2023-10-10 21:00:41,536: Sending simulation state to agent defender\n", + "2023-10-10 21:00:41,538: Getting agent action\n", + "2023-10-10 21:00:41,540: Formatting agent action NODE_RESET\n", + "2023-10-10 21:00:41,541: Sending request to simulation: ['network', 'node', '19dbb2d4-648b-4387-aa15-99757b513acb', 'reset']\n", + "2023-10-10 21:00:41,543: Initiating simulation step 42\n", + "2023-10-10 21:00:41,544: Stepping primaite session. Step counter: 43\n", + "2023-10-10 21:00:41,546: Sending simulation state to agent client_1_green_user\n", + "2023-10-10 21:00:41,548: Getting agent action\n", + "2023-10-10 21:00:41,550: Formatting agent action DONOTHING\n", + "2023-10-10 21:00:41,551: Sending request to simulation: ['do_nothing']\n", + "2023-10-10 21:00:41,552: Sending simulation state to agent client_1_data_manipulation_red_bot\n", + "2023-10-10 21:00:41,554: Getting agent action\n", + "2023-10-10 21:00:41,555: Formatting agent action NODE_FILE_DELETE\n", + "2023-10-10 21:00:41,556: Sending request to simulation: ['do_nothing']\n", + "2023-10-10 21:00:41,557: Sending simulation state to agent defender\n", + "2023-10-10 21:00:41,559: Getting agent action\n", + "2023-10-10 21:00:41,561: Formatting agent action NODE_FOLDER_RESTORE\n", + "2023-10-10 21:00:41,563: Sending request to simulation: ['do_nothing']\n", + "2023-10-10 21:00:41,565: Initiating simulation step 43\n", + "2023-10-10 21:00:41,566: Stepping primaite session. Step counter: 44\n", + "2023-10-10 21:00:41,567: Sending simulation state to agent client_1_green_user\n", + "2023-10-10 21:00:41,568: Getting agent action\n", + "2023-10-10 21:00:41,569: Formatting agent action DONOTHING\n", + "2023-10-10 21:00:41,570: Sending request to simulation: ['do_nothing']\n", + "2023-10-10 21:00:41,571: Sending simulation state to agent client_1_data_manipulation_red_bot\n", + "2023-10-10 21:00:41,574: Getting agent action\n", + "2023-10-10 21:00:41,575: Formatting agent action NODE_FILE_DELETE\n", + "2023-10-10 21:00:41,577: Sending request to simulation: ['do_nothing']\n", + "2023-10-10 21:00:41,578: Sending simulation state to agent defender\n", + "2023-10-10 21:00:41,581: Getting agent action\n", + "2023-10-10 21:00:41,583: Formatting agent action NETWORK_ACL_ADDRULE\n", + "2023-10-10 21:00:41,584: Sending request to simulation: ['network', 'node', 'f0fb4743-43d5-4741-a0e5-78340a458a11', 'acl', 'add_rule', 'DENY', 'TCP', IPv4Address('192.168.1.12'), 'ALL', IPv4Address('127.0.0.1'), 'ALL', 1]\n", + "2023-10-10 21:00:41,586: Initiating simulation step 44\n", + "2023-10-10 21:00:41,587: Stepping primaite session. Step counter: 45\n", + "2023-10-10 21:00:41,588: Sending simulation state to agent client_1_green_user\n", + "2023-10-10 21:00:41,590: Getting agent action\n", + "2023-10-10 21:00:41,591: Formatting agent action DONOTHING\n", + "2023-10-10 21:00:41,593: Sending request to simulation: ['do_nothing']\n", + "2023-10-10 21:00:41,594: Sending simulation state to agent client_1_data_manipulation_red_bot\n", + "2023-10-10 21:00:41,596: Getting agent action\n", + "2023-10-10 21:00:41,598: Formatting agent action NODE_FILE_DELETE\n", + "2023-10-10 21:00:41,599: Sending request to simulation: ['do_nothing']\n", + "2023-10-10 21:00:41,600: Sending simulation state to agent defender\n", + "2023-10-10 21:00:41,602: Getting agent action\n", + "2023-10-10 21:00:41,603: Formatting agent action NETWORK_ACL_REMOVERULE\n", + "2023-10-10 21:00:41,604: Sending request to simulation: ['network', 'node', 'f0fb4743-43d5-4741-a0e5-78340a458a11', 'acl', 'remove_rule', 1]\n", + "2023-10-10 21:00:41,605: Initiating simulation step 45\n", + "2023-10-10 21:00:41,606: Stepping primaite session. Step counter: 46\n", + "2023-10-10 21:00:41,607: Sending simulation state to agent client_1_green_user\n", + "2023-10-10 21:00:41,608: Getting agent action\n", + "2023-10-10 21:00:41,610: Formatting agent action DONOTHING\n", + "2023-10-10 21:00:41,612: Sending request to simulation: ['do_nothing']\n", + "2023-10-10 21:00:41,613: Sending simulation state to agent client_1_data_manipulation_red_bot\n", + "2023-10-10 21:00:41,616: Getting agent action\n", + "2023-10-10 21:00:41,617: Formatting agent action NODE_FILE_DELETE\n", + "2023-10-10 21:00:41,618: Sending request to simulation: ['do_nothing']\n", + "2023-10-10 21:00:41,620: Sending simulation state to agent defender\n", + "2023-10-10 21:00:41,621: Getting agent action\n", + "2023-10-10 21:00:41,623: Formatting agent action NETWORK_ACL_ADDRULE\n", + "2023-10-10 21:00:41,624: Sending request to simulation: ['network', 'node', 'f0fb4743-43d5-4741-a0e5-78340a458a11', 'acl', 'add_rule', 'DENY', 'TCP', IPv4Address('192.168.1.10'), 'ALL', IPv4Address('127.0.0.1'), 'ALL', 1]\n", + "2023-10-10 21:00:41,626: Initiating simulation step 46\n", + "2023-10-10 21:00:41,627: Stepping primaite session. Step counter: 47\n", + "2023-10-10 21:00:41,628: Sending simulation state to agent client_1_green_user\n", + "2023-10-10 21:00:41,630: Getting agent action\n", + "2023-10-10 21:00:41,632: Formatting agent action DONOTHING\n", + "2023-10-10 21:00:41,634: Sending request to simulation: ['do_nothing']\n", + "2023-10-10 21:00:41,635: Sending simulation state to agent client_1_data_manipulation_red_bot\n", + "2023-10-10 21:00:41,636: Getting agent action\n", + "2023-10-10 21:00:41,638: Formatting agent action NODE_FILE_CORRUPT\n", + "2023-10-10 21:00:41,639: Sending request to simulation: ['do_nothing']\n", + "2023-10-10 21:00:41,640: Sending simulation state to agent defender\n", + "2023-10-10 21:00:41,642: Getting agent action\n", + "2023-10-10 21:00:41,643: Formatting agent action NETWORK_ACL_ADDRULE\n", + "2023-10-10 21:00:41,644: Sending request to simulation: ['do_nothing']\n", + "2023-10-10 21:00:41,646: Initiating simulation step 47\n", + "2023-10-10 21:00:41,648: Stepping primaite session. Step counter: 48\n", + "2023-10-10 21:00:41,649: Sending simulation state to agent client_1_green_user\n", + "2023-10-10 21:00:41,651: Getting agent action\n", + "2023-10-10 21:00:41,652: Formatting agent action DONOTHING\n", + "2023-10-10 21:00:41,653: Sending request to simulation: ['do_nothing']\n", + "2023-10-10 21:00:41,654: Sending simulation state to agent client_1_data_manipulation_red_bot\n", + "2023-10-10 21:00:41,657: Getting agent action\n", + "2023-10-10 21:00:41,658: Formatting agent action NODE_FILE_CORRUPT\n", + "2023-10-10 21:00:41,661: Sending request to simulation: ['do_nothing']\n", + "2023-10-10 21:00:41,663: Sending simulation state to agent defender\n", + "2023-10-10 21:00:41,665: Getting agent action\n", + "2023-10-10 21:00:41,667: Formatting agent action NODE_SERVICE_STOP\n", + "2023-10-10 21:00:41,669: Sending request to simulation: ['do_nothing']\n", + "2023-10-10 21:00:41,670: Initiating simulation step 48\n", + "2023-10-10 21:00:41,672: Stepping primaite session. Step counter: 49\n", + "2023-10-10 21:00:41,674: Sending simulation state to agent client_1_green_user\n", + "2023-10-10 21:00:41,684: Getting agent action\n", + "2023-10-10 21:00:41,687: Formatting agent action DONOTHING\n", + "2023-10-10 21:00:41,689: Sending request to simulation: ['do_nothing']\n", + "2023-10-10 21:00:41,690: Sending simulation state to agent client_1_data_manipulation_red_bot\n", + "2023-10-10 21:00:41,701: Getting agent action\n", + "2023-10-10 21:00:41,702: Formatting agent action NODE_FILE_CORRUPT\n", + "2023-10-10 21:00:41,705: Sending request to simulation: ['do_nothing']\n", + "2023-10-10 21:00:41,715: Sending simulation state to agent defender\n", + "2023-10-10 21:00:41,718: Getting agent action\n", + "2023-10-10 21:00:41,720: Formatting agent action DONOTHING\n", + "2023-10-10 21:00:41,734: Sending request to simulation: ['do_nothing']\n", + "2023-10-10 21:00:41,737: Initiating simulation step 49\n", + "2023-10-10 21:00:41,738: Stepping primaite session. Step counter: 50\n", + "2023-10-10 21:00:41,740: Sending simulation state to agent client_1_green_user\n", + "2023-10-10 21:00:41,742: Getting agent action\n", + "2023-10-10 21:00:41,744: Formatting agent action DONOTHING\n", + "2023-10-10 21:00:41,747: Sending request to simulation: ['do_nothing']\n", + "2023-10-10 21:00:41,750: Sending simulation state to agent client_1_data_manipulation_red_bot\n", + "2023-10-10 21:00:41,753: Getting agent action\n", + "2023-10-10 21:00:41,755: Formatting agent action NODE_FILE_DELETE\n", + "2023-10-10 21:00:41,756: Sending request to simulation: ['do_nothing']\n", + "2023-10-10 21:00:41,758: Sending simulation state to agent defender\n", + "2023-10-10 21:00:41,761: Getting agent action\n", + "2023-10-10 21:00:41,771: Formatting agent action DONOTHING\n", + "2023-10-10 21:00:41,774: Sending request to simulation: ['do_nothing']\n", + "2023-10-10 21:00:41,776: Initiating simulation step 50\n" + ] + } + ], "source": [ "for i in range(50):\n", " sess.step()" ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] } ], "metadata": { diff --git a/sandbox.py b/sandbox.py new file mode 100644 index 00000000..8114c23a --- /dev/null +++ b/sandbox.py @@ -0,0 +1,19 @@ + +from primaite.game.session import PrimaiteSession + +from primaite import _PRIMAITE_CONFIG, PRIMAITE_PATHS +import logging +_PRIMAITE_CONFIG['log_level']=logging.DEBUG +print(PRIMAITE_PATHS.app_log_dir_path) +import itertools +from primaite.game.session import PrimaiteSession +from primaite.simulator.sim_container import Simulation +from primaite.game.agent.interface import AbstractAgent +from primaite.simulator.network.networks import arcd_uc2_network +import yaml + +with open('example_config.yaml', 'r') as file: + cfg = yaml.safe_load(file) +sess = PrimaiteSession.from_config(cfg) + +sess.start_session() \ No newline at end of file diff --git a/src/primaite/environment/observations.py b/src/primaite/environment/observations.py index be80374b..73b9e998 100644 --- a/src/primaite/environment/observations.py +++ b/src/primaite/environment/observations.py @@ -6,7 +6,7 @@ from logging import Logger from typing import Dict, Final, List, Tuple, TYPE_CHECKING, Union import numpy as np -from gym import spaces +from gymnasium import spaces from primaite.acl.acl_rule import ACLRule from primaite.common.enums import FileSystemState, HardwareState, RulePermissionType, SoftwareState diff --git a/src/primaite/game/agent/GATE_agents.py b/src/primaite/game/agent/GATE_agents.py index ac1d776b..eb3c2987 100644 --- a/src/primaite/game/agent/GATE_agents.py +++ b/src/primaite/game/agent/GATE_agents.py @@ -1,57 +1,9 @@ -from primaite.game.agent.interface import AbstractGATEAgent -from arcd_gate.client.gate_client import GATEClient - - -class GATEMan(GATEClient): - - @property - def rl_framework(self) -> str: - return "SB3" - - @property - def rl_framework(self) -> str: - pass - - @property - def rl_algorithm(self) -> str: - pass - - @property - def seed(self) -> Optional[int]: - return None - - @property - def n_learn_episodes(self) -> int: - return 0 - - @property - def n_learn_steps(self) -> int: - return 0 - - @property - def n_eval_episodes(self) -> int: - return 0 - - @property - def n_eval_steps(self) -> int: - return 0 - - @property - def action_space(self) -> spaces.Space: - pass - - @property - def observation_space(self) -> spaces.Space: - pass - - def step(self, action: ActType) -> Tuple[np.ndarray, float, bool, bool, Dict]: - pass - - def reset(self, *, seed: Optional[int] = None, options: Optional[dict[str, Any]] = None) -> Tuple[np.ndarray, Dict]: - pass - - def close(self): - pass +from typing import Dict, Optional, Tuple +from primaite.game.agent.actions import ActionManager +from primaite.game.agent.interface import AbstractGATEAgent, ObsType +from primaite.game.agent.observations import ObservationSpace +from primaite.game.agent.rewards import RewardFunction +from gymnasium.core import ActType, ObsType class GATERLAgent(AbstractGATEAgent): ... @@ -61,4 +13,9 @@ class GATERLAgent(AbstractGATEAgent): # For example MultiAgentEnv in Ray allows sending a dict of observations of multiple agents, then it will reply # with the actions for those agents. + def __init__(self, agent_name: str | None, action_space: ActionManager | None, observation_space: ObservationSpace | None, reward_function: RewardFunction | None) -> None: + super().__init__(agent_name, action_space, observation_space, reward_function) + self.most_recent_action: ActType + def get_action(self, obs: ObsType, reward: float = None) -> Tuple[str, Dict]: + return self.most_recent_action \ No newline at end of file diff --git a/src/primaite/game/agent/actions.py b/src/primaite/game/agent/actions.py index cba90305..6a1d5bcd 100644 --- a/src/primaite/game/agent/actions.py +++ b/src/primaite/game/agent/actions.py @@ -2,7 +2,7 @@ import itertools from abc import ABC, abstractmethod from typing import Any, Dict, List, Optional, Tuple, TYPE_CHECKING -from gym import spaces +from gymnasium import spaces from primaite import getLogger from primaite.simulator.sim_container import Simulation diff --git a/src/primaite/game/agent/observations.py b/src/primaite/game/agent/observations.py index 7b10f957..00f98f5c 100644 --- a/src/primaite/game/agent/observations.py +++ b/src/primaite/game/agent/observations.py @@ -1,10 +1,12 @@ from abc import ABC, abstractmethod from typing import Any, Dict, Hashable, List, Optional, Sequence, Tuple, TYPE_CHECKING -from gym import spaces +from gymnasium import spaces from pydantic import BaseModel from primaite.simulator.sim_container import Simulation +from primaite import getLogger +_LOGGER = getLogger(__name__) if TYPE_CHECKING: from primaite.game.session import PrimaiteSession @@ -181,7 +183,7 @@ class LinkObservation(AbstractObservation): class FolderObservation(AbstractObservation): - def __init__(self, where: Optional[Tuple[str]] = None, files: List[FileObservation] = []) -> None: + def __init__(self, where: Optional[Tuple[str]] = None, files: List[FileObservation] = [], num_files_per_folder:int=2) -> None: """Initialise folder Observation, including files inside of the folder. :param where: Where in the simulation state dictionary to find the relevant information for this folder. @@ -203,6 +205,13 @@ class FolderObservation(AbstractObservation): self.where: Optional[Tuple[str]] = where self.files: List[FileObservation] = files + while len(self.files) < num_files_per_folder: + self.files.append(FileObservation()) + while len(self.files)> num_files_per_folder: + truncated_file = self.files.pop() + msg = f"Too many files in folde observation. Truncating file {truncated_file}" + _LOGGER.warn(msg) + raise UserWarning(msg) self.default_observation = { "health_status": 0, @@ -235,13 +244,13 @@ class FolderObservation(AbstractObservation): ) @classmethod - def from_config(cls, config: Dict, session: "PrimaiteSession", parent_where: Optional[List[str]]): + def from_config(cls, config: Dict, session: "PrimaiteSession", parent_where: Optional[List[str]], num_files_per_folder:int=2): where = parent_where + ["folders", config["folder_name"]] file_configs = config["files"] files = [FileObservation.from_config(config=f, session=session, parent_where=where) for f in file_configs] - return cls(where=where, files=files) + return cls(where=where, files=files, num_files_per_folder=num_files_per_folder) class NicObservation(AbstractObservation): @@ -277,7 +286,10 @@ class NodeObservation(AbstractObservation): folders: List[FolderObservation] = [], nics: List[NicObservation] = [], logon_status: bool = False, - ) -> None: + num_services_per_node: int = 2, + num_folders_per_node: int = 2, + num_files_per_folder: int = 2 + ) -> None: """ Configurable observation for a node in the simulation. @@ -302,7 +314,24 @@ class NodeObservation(AbstractObservation): self.where: Optional[Tuple[str]] = where self.services: List[ServiceObservation] = services + while len(self.services)num_services_per_node: + truncated_service = self.services.pop() + msg = f"Too many services in Node observation space for node. Truncating service {truncated_service.where}" + _LOGGER.warn(msg) + raise UserWarning(msg) + # truncate service list + self.folders: List[FolderObservation] = folders + while len(self.folders) < num_folders_per_node: + # add an empty folder observation without `where` parameter that will always return default (blank) observations + self.folders.append(FolderObservation()) + while len(self.folders) > num_folders_per_node: + truncated_folder = self.folders.pop() + msg = f"Too many folders in Node observation for node. Truncating service {truncated_folder.where[-1]}" + self.nics: List[NicObservation] = nics self.logon_status: bool = logon_status @@ -349,7 +378,13 @@ class NodeObservation(AbstractObservation): @classmethod def from_config( - cls, config: Dict, session: "PrimaiteSession", parent_where: Optional[List[str]] = None + cls, + config: Dict, + session: "PrimaiteSession", + parent_where: Optional[List[str]] = None, + num_services_per_node: int = 2, + num_folders_per_node: int = 2, + num_files_per_folder: int = 2, ) -> "NodeObservation": node_uuid = session.ref_map_nodes[config["node_ref"]] if parent_where is None: @@ -360,12 +395,21 @@ class NodeObservation(AbstractObservation): svc_configs = config.get("services", {}) services = [ServiceObservation.from_config(config=c, session=session, parent_where=where) for c in svc_configs] folder_configs = config.get("folders", {}) - folders = [FolderObservation.from_config(config=c, session=session, parent_where=where) for c in folder_configs] + folders = [FolderObservation.from_config(config=c, session=session, parent_where=where, num_files_per_folder=num_files_per_folder) for c in folder_configs] nic_uuids = session.simulation.network.nodes[node_uuid].nics.keys() nic_configs = [{"nic_uuid": n for n in nic_uuids}] if nic_uuids else [] nics = [NicObservation.from_config(config=c, session=session, parent_where=where) for c in nic_configs] logon_status = config.get("logon_status", False) - return cls(where=where, services=services, folders=folders, nics=nics, logon_status=logon_status) + return cls( + where=where, + services=services, + folders=folders, + nics=nics, + logon_status=logon_status, + num_services_per_node = num_services_per_node, + num_folders_per_node = num_folders_per_node, + num_files_per_folder = num_files_per_folder, + ) class AclObservation(AbstractObservation): @@ -467,11 +511,12 @@ class AclObservation(AbstractObservation): @classmethod def from_config(cls, config: Dict, session: "PrimaiteSession") -> "AclObservation": node_ip_to_idx = {} - for node_idx, node_cfg in enumerate(config["node_order"]): - n_ref = node_cfg["node_ref"] - n_obj = session.simulation.network.nodes[session.ref_map_nodes[n_ref]] - for nic_uuid, nic_obj in n_obj.nics.items(): - node_ip_to_idx[nic_obj.ip_address] = node_idx + 2 + for ip_idx, ip_map_config in enumerate(config["ip_address_order"]): + node_ref = ip_map_config["node_ref"] + nic_num = ip_map_config["nic_num"] + node_obj = session.simulation.network.nodes[session.ref_map_nodes[node_ref]] + nic_obj = node_obj.ethernet_port[nic_num] + node_ip_to_idx[nic_obj.ip_address] = ip_idx + 2 router_uuid = session.ref_map_nodes[config["router_node_ref"]] return cls( @@ -552,7 +597,16 @@ class UC2BlueObservation(AbstractObservation): @classmethod def from_config(cls, config: Dict, session: "PrimaiteSession"): node_configs = config["nodes"] - nodes = [NodeObservation.from_config(config=n, session=session) for n in node_configs] + num_services_per_node = config["num_services_per_node"] + num_folders_per_node = config["num_folders_per_node"] + num_files_per_folder = config["num_files_per_folder"] + nodes = [NodeObservation.from_config( + config=n, + session=session, + num_services_per_node= num_services_per_node, + num_folders_per_node=num_folders_per_node, + num_files_per_folder=num_files_per_folder, + ) for n in node_configs] link_configs = config["links"] links = [LinkObservation.from_config(config=l, session=session) for l in link_configs] diff --git a/src/primaite/game/session.py b/src/primaite/game/session.py index 7746f78c..d978b848 100644 --- a/src/primaite/game/session.py +++ b/src/primaite/game/session.py @@ -7,12 +7,16 @@ from ipaddress import IPv4Address from typing import Any, Dict, List, Optional, Tuple -from gymnasium.vector.utils import spaces +from gymnasium import spaces +from gymnasium.spaces.utils import flatten, flatten_space, unflatten +from gymnasium.core import ObsType, ActType + import numpy as np from pydantic import BaseModel from primaite import getLogger +from primaite.game.agent.GATE_agents import GATERLAgent from primaite.game.agent.actions import ActionManager from primaite.game.agent.interface import AbstractAgent, RandomAgent from primaite.game.agent.observations import ( @@ -54,7 +58,7 @@ _LOGGER = getLogger(__name__) class PrimaiteGATEClient(GATEClient): def __init__(self, parent_session:"PrimaiteSession", service_port: int = 50000): super().__init__(service_port=service_port) - self.parent_session:"PrimaiteSession" + self.parent_session:"PrimaiteSession" = parent_session @property def rl_framework(self) -> str: @@ -86,21 +90,33 @@ class PrimaiteGATEClient(GATEClient): @property def action_space(self) -> spaces.Space: - return self.parent_session.rl_agent.action_space + return self.parent_session.rl_agent.action_space.space @property def observation_space(self) -> spaces.Space: - return self.parent_session.rl_agent.observation_space + print("YEEY0") + print(flatten_space(spaces.Dict({}))) + print("YEEY1") + # print(self.parent_session.rl_agent.observation_space.space) + return flatten_space(self.parent_session.rl_agent.observation_space.space) - def step(self, action: ActType) -> Tuple[ndarray, float, bool, bool, Dict]: + def step(self, action: ActType) -> Tuple[ObsType, float, bool, bool, Dict]: + self.parent_session.rl_agent.most_recent_action = action self.parent_session.step() - #TODO: not sure how to go about this. + obs = self.parent_session.rl_agent.observation_space.observe() + obs = flatten(self.parent_session.rl_agent.observation_space.space, obs) + rew = self.parent_session.rl_agent.reward_function.calculate() + term = False + trunc = False + info = {} + return obs, rew, term, trunc, info + def reset(self, *, seed: int | None = None, options: dict[str, Any] | None = None) -> Tuple[ndarray, Dict]: - ... + self.parent_session.reset() def close(self): - ... + self.parent_session.close() class PrimaiteSessionOptions(BaseModel): ports: List[str] @@ -131,15 +147,11 @@ class PrimaiteSession: self.ref_map_nodes: Dict[str, Node] = {} self.ref_map_services: Dict[str, Service] = {} self.ref_map_links: Dict[str, Link] = {} + self.gate_client: PrimaiteGATEClient = PrimaiteGATEClient(self) def start_session(self, opts="TODO..."): """Commence the session, this gives the gate client control over the simulation/agent loop.""" - ... - - def eval(self, opts="TODO..."): - ... - - + self.gate_client.start() def step(self): _LOGGER.debug(f"Stepping primaite session. Step counter: {self.step_counter}") @@ -172,12 +184,18 @@ class PrimaiteSession: # 10. primaite session receives the action from the agents and asks the simulation to apply each _LOGGER.debug(f"Sending request to simulation: {agent_request}") - self.simulation.apply_action(agent_request) + self.simulation.apply_request(agent_request) _LOGGER.debug(f"Initiating simulation step {self.step_counter}") self.simulation.apply_timestep(self.step_counter) self.step_counter += 1 + def reset(self): + pass + + def close(self): + pass + @classmethod def from_config(cls, cfg: dict) -> "PrimaiteSession": sess = cls() @@ -351,6 +369,7 @@ class PrimaiteSession: reward_function=rew_function, ) sess.agents.append(new_agent) + sess.rl_agent = new_agent elif agent_type == "RedDatabaseCorruptingAgent": new_agent = RandomAgent( agent_name=agent_cfg["ref"], diff --git a/src/primaite/transactions/transaction.py b/src/primaite/transactions/transaction.py index 7d5f747c..6b973ca3 100644 --- a/src/primaite/transactions/transaction.py +++ b/src/primaite/transactions/transaction.py @@ -7,7 +7,7 @@ from primaite.common.enums import AgentIdentifier if TYPE_CHECKING: import numpy as np - from gym import spaces + from gymnasium import spaces class Transaction(object):