clear uc2 notebook outputs
This commit is contained in:
@@ -352,7 +352,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 1,
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"tags": []
|
||||
},
|
||||
@@ -364,7 +364,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 2,
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"tags": []
|
||||
},
|
||||
@@ -389,169 +389,9 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 3,
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"Resetting environment, episode 0, avg. reward: 0.0\n",
|
||||
"env created successfully\n",
|
||||
"{'ACL': {1: {'dest_node_id': 0,\n",
|
||||
" 'dest_port': 0,\n",
|
||||
" 'permission': 0,\n",
|
||||
" 'position': 0,\n",
|
||||
" 'protocol': 0,\n",
|
||||
" 'source_node_id': 0,\n",
|
||||
" 'source_port': 0},\n",
|
||||
" 2: {'dest_node_id': 0,\n",
|
||||
" 'dest_port': 0,\n",
|
||||
" 'permission': 0,\n",
|
||||
" 'position': 1,\n",
|
||||
" 'protocol': 0,\n",
|
||||
" 'source_node_id': 0,\n",
|
||||
" 'source_port': 0},\n",
|
||||
" 3: {'dest_node_id': 0,\n",
|
||||
" 'dest_port': 0,\n",
|
||||
" 'permission': 0,\n",
|
||||
" 'position': 2,\n",
|
||||
" 'protocol': 0,\n",
|
||||
" 'source_node_id': 0,\n",
|
||||
" 'source_port': 0},\n",
|
||||
" 4: {'dest_node_id': 0,\n",
|
||||
" 'dest_port': 0,\n",
|
||||
" 'permission': 0,\n",
|
||||
" 'position': 3,\n",
|
||||
" 'protocol': 0,\n",
|
||||
" 'source_node_id': 0,\n",
|
||||
" 'source_port': 0},\n",
|
||||
" 5: {'dest_node_id': 0,\n",
|
||||
" 'dest_port': 0,\n",
|
||||
" 'permission': 0,\n",
|
||||
" 'position': 4,\n",
|
||||
" 'protocol': 0,\n",
|
||||
" 'source_node_id': 0,\n",
|
||||
" 'source_port': 0},\n",
|
||||
" 6: {'dest_node_id': 0,\n",
|
||||
" 'dest_port': 0,\n",
|
||||
" 'permission': 0,\n",
|
||||
" 'position': 5,\n",
|
||||
" 'protocol': 0,\n",
|
||||
" 'source_node_id': 0,\n",
|
||||
" 'source_port': 0},\n",
|
||||
" 7: {'dest_node_id': 0,\n",
|
||||
" 'dest_port': 0,\n",
|
||||
" 'permission': 0,\n",
|
||||
" 'position': 6,\n",
|
||||
" 'protocol': 0,\n",
|
||||
" 'source_node_id': 0,\n",
|
||||
" 'source_port': 0},\n",
|
||||
" 8: {'dest_node_id': 0,\n",
|
||||
" 'dest_port': 0,\n",
|
||||
" 'permission': 0,\n",
|
||||
" 'position': 7,\n",
|
||||
" 'protocol': 0,\n",
|
||||
" 'source_node_id': 0,\n",
|
||||
" 'source_port': 0},\n",
|
||||
" 9: {'dest_node_id': 0,\n",
|
||||
" 'dest_port': 0,\n",
|
||||
" 'permission': 0,\n",
|
||||
" 'position': 8,\n",
|
||||
" 'protocol': 0,\n",
|
||||
" 'source_node_id': 0,\n",
|
||||
" 'source_port': 0},\n",
|
||||
" 10: {'dest_node_id': 0,\n",
|
||||
" 'dest_port': 0,\n",
|
||||
" 'permission': 0,\n",
|
||||
" 'position': 9,\n",
|
||||
" 'protocol': 0,\n",
|
||||
" 'source_node_id': 0,\n",
|
||||
" 'source_port': 0}},\n",
|
||||
" 'ICS': 0,\n",
|
||||
" 'LINKS': {1: {'PROTOCOLS': {'ALL': 1}},\n",
|
||||
" 2: {'PROTOCOLS': {'ALL': 1}},\n",
|
||||
" 3: {'PROTOCOLS': {'ALL': 1}},\n",
|
||||
" 4: {'PROTOCOLS': {'ALL': 1}},\n",
|
||||
" 5: {'PROTOCOLS': {'ALL': 1}},\n",
|
||||
" 6: {'PROTOCOLS': {'ALL': 1}},\n",
|
||||
" 7: {'PROTOCOLS': {'ALL': 1}},\n",
|
||||
" 8: {'PROTOCOLS': {'ALL': 1}},\n",
|
||||
" 9: {'PROTOCOLS': {'ALL': 1}},\n",
|
||||
" 10: {'PROTOCOLS': {'ALL': 0}}},\n",
|
||||
" 'NODES': {1: {'FOLDERS': {1: {'FILES': {1: {'health_status': 0}},\n",
|
||||
" 'health_status': 0}},\n",
|
||||
" 'NETWORK_INTERFACES': {1: {'nic_status': 1,\n",
|
||||
" 'nmne': {'inbound': 0,\n",
|
||||
" 'outbound': 0}},\n",
|
||||
" 2: {'nic_status': 0,\n",
|
||||
" 'nmne': {'inbound': 0,\n",
|
||||
" 'outbound': 0}}},\n",
|
||||
" 'SERVICES': {1: {'health_status': 0, 'operating_status': 1}},\n",
|
||||
" 'operating_status': 1},\n",
|
||||
" 2: {'FOLDERS': {1: {'FILES': {1: {'health_status': 0}},\n",
|
||||
" 'health_status': 0}},\n",
|
||||
" 'NETWORK_INTERFACES': {1: {'nic_status': 1,\n",
|
||||
" 'nmne': {'inbound': 0,\n",
|
||||
" 'outbound': 0}},\n",
|
||||
" 2: {'nic_status': 0,\n",
|
||||
" 'nmne': {'inbound': 0,\n",
|
||||
" 'outbound': 0}}},\n",
|
||||
" 'SERVICES': {1: {'health_status': 0, 'operating_status': 1}},\n",
|
||||
" 'operating_status': 1},\n",
|
||||
" 3: {'FOLDERS': {1: {'FILES': {1: {'health_status': 1}},\n",
|
||||
" 'health_status': 1}},\n",
|
||||
" 'NETWORK_INTERFACES': {1: {'nic_status': 1,\n",
|
||||
" 'nmne': {'inbound': 0,\n",
|
||||
" 'outbound': 0}},\n",
|
||||
" 2: {'nic_status': 0,\n",
|
||||
" 'nmne': {'inbound': 0,\n",
|
||||
" 'outbound': 0}}},\n",
|
||||
" 'SERVICES': {1: {'health_status': 0, 'operating_status': 0}},\n",
|
||||
" 'operating_status': 1},\n",
|
||||
" 4: {'FOLDERS': {1: {'FILES': {1: {'health_status': 0}},\n",
|
||||
" 'health_status': 0}},\n",
|
||||
" 'NETWORK_INTERFACES': {1: {'nic_status': 1,\n",
|
||||
" 'nmne': {'inbound': 0,\n",
|
||||
" 'outbound': 0}},\n",
|
||||
" 2: {'nic_status': 0,\n",
|
||||
" 'nmne': {'inbound': 0,\n",
|
||||
" 'outbound': 0}}},\n",
|
||||
" 'SERVICES': {1: {'health_status': 0, 'operating_status': 0}},\n",
|
||||
" 'operating_status': 1},\n",
|
||||
" 5: {'FOLDERS': {1: {'FILES': {1: {'health_status': 0}},\n",
|
||||
" 'health_status': 0}},\n",
|
||||
" 'NETWORK_INTERFACES': {1: {'nic_status': 1,\n",
|
||||
" 'nmne': {'inbound': 0,\n",
|
||||
" 'outbound': 0}},\n",
|
||||
" 2: {'nic_status': 0,\n",
|
||||
" 'nmne': {'inbound': 0,\n",
|
||||
" 'outbound': 0}}},\n",
|
||||
" 'SERVICES': {1: {'health_status': 0, 'operating_status': 0}},\n",
|
||||
" 'operating_status': 1},\n",
|
||||
" 6: {'FOLDERS': {1: {'FILES': {1: {'health_status': 0}},\n",
|
||||
" 'health_status': 0}},\n",
|
||||
" 'NETWORK_INTERFACES': {1: {'nic_status': 1,\n",
|
||||
" 'nmne': {'inbound': 0,\n",
|
||||
" 'outbound': 0}},\n",
|
||||
" 2: {'nic_status': 0,\n",
|
||||
" 'nmne': {'inbound': 0,\n",
|
||||
" 'outbound': 0}}},\n",
|
||||
" 'SERVICES': {1: {'health_status': 0, 'operating_status': 0}},\n",
|
||||
" 'operating_status': 1},\n",
|
||||
" 7: {'FOLDERS': {1: {'FILES': {1: {'health_status': 0}},\n",
|
||||
" 'health_status': 0}},\n",
|
||||
" 'NETWORK_INTERFACES': {1: {'nic_status': 1,\n",
|
||||
" 'nmne': {'inbound': 0,\n",
|
||||
" 'outbound': 0}},\n",
|
||||
" 2: {'nic_status': 0,\n",
|
||||
" 'nmne': {'inbound': 0,\n",
|
||||
" 'outbound': 0}}},\n",
|
||||
" 'SERVICES': {1: {'health_status': 0, 'operating_status': 0}},\n",
|
||||
" 'operating_status': 1}}}\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# create the env\n",
|
||||
"with open(example_config_path(), 'r') as f:\n",
|
||||
@@ -579,7 +419,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 4,
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
@@ -597,51 +437,9 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 5,
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"step: 1, Red action: DO NOTHING, Blue reward:0.77\n",
|
||||
"step: 2, Red action: DO NOTHING, Blue reward:0.77\n",
|
||||
"step: 3, Red action: DO NOTHING, Blue reward:1.10\n",
|
||||
"step: 4, Red action: DO NOTHING, Blue reward:1.10\n",
|
||||
"step: 5, Red action: DO NOTHING, Blue reward:1.10\n",
|
||||
"step: 6, Red action: DO NOTHING, Blue reward:1.10\n",
|
||||
"step: 7, Red action: DO NOTHING, Blue reward:1.10\n",
|
||||
"step: 8, Red action: DO NOTHING, Blue reward:1.10\n",
|
||||
"step: 9, Red action: DO NOTHING, Blue reward:1.10\n",
|
||||
"step: 10, Red action: DO NOTHING, Blue reward:1.10\n",
|
||||
"step: 11, Red action: DO NOTHING, Blue reward:1.10\n",
|
||||
"step: 12, Red action: DO NOTHING, Blue reward:1.10\n",
|
||||
"step: 13, Red action: DO NOTHING, Blue reward:1.10\n",
|
||||
"step: 14, Red action: DO NOTHING, Blue reward:1.10\n",
|
||||
"step: 15, Red action: DO NOTHING, Blue reward:1.10\n",
|
||||
"step: 16, Red action: DO NOTHING, Blue reward:1.10\n",
|
||||
"step: 17, Red action: DO NOTHING, Blue reward:1.20\n",
|
||||
"step: 18, Red action: DO NOTHING, Blue reward:1.20\n",
|
||||
"step: 19, Red action: DO NOTHING, Blue reward:1.20\n",
|
||||
"step: 20, Red action: DO NOTHING, Blue reward:1.20\n",
|
||||
"step: 21, Red action: DO NOTHING, Blue reward:1.20\n",
|
||||
"step: 22, Red action: DO NOTHING, Blue reward:1.20\n",
|
||||
"step: 23, Red action: DO NOTHING, Blue reward:1.20\n",
|
||||
"step: 24, Red action: ATTACK from client 2, Blue reward:0.52\n",
|
||||
"step: 25, Red action: DO NOTHING, Blue reward:0.52\n",
|
||||
"step: 26, Red action: DO NOTHING, Blue reward:-0.80\n",
|
||||
"step: 27, Red action: DO NOTHING, Blue reward:-0.80\n",
|
||||
"step: 28, Red action: DO NOTHING, Blue reward:-0.80\n",
|
||||
"step: 29, Red action: DO NOTHING, Blue reward:-0.80\n",
|
||||
"step: 30, Red action: DO NOTHING, Blue reward:-0.80\n",
|
||||
"step: 31, Red action: DO NOTHING, Blue reward:-0.80\n",
|
||||
"step: 32, Red action: DO NOTHING, Blue reward:-0.80\n",
|
||||
"step: 33, Red action: DO NOTHING, Blue reward:-0.80\n",
|
||||
"step: 34, Red action: DO NOTHING, Blue reward:-0.80\n",
|
||||
"step: 35, Red action: DO NOTHING, Blue reward:-0.80\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"for step in range(35):\n",
|
||||
" obs, reward, terminated, truncated, info = env.step(0)\n",
|
||||
@@ -657,65 +455,9 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 6,
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"{1: {'FOLDERS': {1: {'FILES': {1: {'health_status': 0}}, 'health_status': 0}},\n",
|
||||
" 'NETWORK_INTERFACES': {1: {'nic_status': 1,\n",
|
||||
" 'nmne': {'inbound': 0, 'outbound': 0}},\n",
|
||||
" 2: {'nic_status': 0,\n",
|
||||
" 'nmne': {'inbound': 0, 'outbound': 0}}},\n",
|
||||
" 'SERVICES': {1: {'health_status': 0, 'operating_status': 1}},\n",
|
||||
" 'operating_status': 1},\n",
|
||||
" 2: {'FOLDERS': {1: {'FILES': {1: {'health_status': 0}}, 'health_status': 0}},\n",
|
||||
" 'NETWORK_INTERFACES': {1: {'nic_status': 1,\n",
|
||||
" 'nmne': {'inbound': 0, 'outbound': 0}},\n",
|
||||
" 2: {'nic_status': 0,\n",
|
||||
" 'nmne': {'inbound': 0, 'outbound': 0}}},\n",
|
||||
" 'SERVICES': {1: {'health_status': 0, 'operating_status': 1}},\n",
|
||||
" 'operating_status': 1},\n",
|
||||
" 3: {'FOLDERS': {1: {'FILES': {1: {'health_status': 1}}, 'health_status': 1}},\n",
|
||||
" 'NETWORK_INTERFACES': {1: {'nic_status': 1,\n",
|
||||
" 'nmne': {'inbound': 1, 'outbound': 0}},\n",
|
||||
" 2: {'nic_status': 0,\n",
|
||||
" 'nmne': {'inbound': 0, 'outbound': 0}}},\n",
|
||||
" 'SERVICES': {1: {'health_status': 0, 'operating_status': 0}},\n",
|
||||
" 'operating_status': 1},\n",
|
||||
" 4: {'FOLDERS': {1: {'FILES': {1: {'health_status': 0}}, 'health_status': 0}},\n",
|
||||
" 'NETWORK_INTERFACES': {1: {'nic_status': 1,\n",
|
||||
" 'nmne': {'inbound': 0, 'outbound': 0}},\n",
|
||||
" 2: {'nic_status': 0,\n",
|
||||
" 'nmne': {'inbound': 0, 'outbound': 0}}},\n",
|
||||
" 'SERVICES': {1: {'health_status': 0, 'operating_status': 0}},\n",
|
||||
" 'operating_status': 1},\n",
|
||||
" 5: {'FOLDERS': {1: {'FILES': {1: {'health_status': 0}}, 'health_status': 0}},\n",
|
||||
" 'NETWORK_INTERFACES': {1: {'nic_status': 1,\n",
|
||||
" 'nmne': {'inbound': 0, 'outbound': 0}},\n",
|
||||
" 2: {'nic_status': 0,\n",
|
||||
" 'nmne': {'inbound': 0, 'outbound': 0}}},\n",
|
||||
" 'SERVICES': {1: {'health_status': 0, 'operating_status': 0}},\n",
|
||||
" 'operating_status': 1},\n",
|
||||
" 6: {'FOLDERS': {1: {'FILES': {1: {'health_status': 0}}, 'health_status': 0}},\n",
|
||||
" 'NETWORK_INTERFACES': {1: {'nic_status': 1,\n",
|
||||
" 'nmne': {'inbound': 0, 'outbound': 0}},\n",
|
||||
" 2: {'nic_status': 0,\n",
|
||||
" 'nmne': {'inbound': 0, 'outbound': 0}}},\n",
|
||||
" 'SERVICES': {1: {'health_status': 0, 'operating_status': 0}},\n",
|
||||
" 'operating_status': 1},\n",
|
||||
" 7: {'FOLDERS': {1: {'FILES': {1: {'health_status': 0}}, 'health_status': 0}},\n",
|
||||
" 'NETWORK_INTERFACES': {1: {'nic_status': 1,\n",
|
||||
" 'nmne': {'inbound': 0, 'outbound': 1}},\n",
|
||||
" 2: {'nic_status': 0,\n",
|
||||
" 'nmne': {'inbound': 0, 'outbound': 0}}},\n",
|
||||
" 'SERVICES': {1: {'health_status': 0, 'operating_status': 0}},\n",
|
||||
" 'operating_status': 1}}\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"pprint(obs['NODES'])"
|
||||
]
|
||||
@@ -729,65 +471,9 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 7,
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"{1: {'FOLDERS': {1: {'FILES': {1: {'health_status': 0}}, 'health_status': 0}},\n",
|
||||
" 'NETWORK_INTERFACES': {1: {'nic_status': 1,\n",
|
||||
" 'nmne': {'inbound': 0, 'outbound': 0}},\n",
|
||||
" 2: {'nic_status': 0,\n",
|
||||
" 'nmne': {'inbound': 0, 'outbound': 0}}},\n",
|
||||
" 'SERVICES': {1: {'health_status': 0, 'operating_status': 1}},\n",
|
||||
" 'operating_status': 1},\n",
|
||||
" 2: {'FOLDERS': {1: {'FILES': {1: {'health_status': 0}}, 'health_status': 0}},\n",
|
||||
" 'NETWORK_INTERFACES': {1: {'nic_status': 1,\n",
|
||||
" 'nmne': {'inbound': 0, 'outbound': 0}},\n",
|
||||
" 2: {'nic_status': 0,\n",
|
||||
" 'nmne': {'inbound': 0, 'outbound': 0}}},\n",
|
||||
" 'SERVICES': {1: {'health_status': 3, 'operating_status': 1}},\n",
|
||||
" 'operating_status': 1},\n",
|
||||
" 3: {'FOLDERS': {1: {'FILES': {1: {'health_status': 2}}, 'health_status': 1}},\n",
|
||||
" 'NETWORK_INTERFACES': {1: {'nic_status': 1,\n",
|
||||
" 'nmne': {'inbound': 1, 'outbound': 0}},\n",
|
||||
" 2: {'nic_status': 0,\n",
|
||||
" 'nmne': {'inbound': 0, 'outbound': 0}}},\n",
|
||||
" 'SERVICES': {1: {'health_status': 0, 'operating_status': 0}},\n",
|
||||
" 'operating_status': 1},\n",
|
||||
" 4: {'FOLDERS': {1: {'FILES': {1: {'health_status': 0}}, 'health_status': 0}},\n",
|
||||
" 'NETWORK_INTERFACES': {1: {'nic_status': 1,\n",
|
||||
" 'nmne': {'inbound': 0, 'outbound': 0}},\n",
|
||||
" 2: {'nic_status': 0,\n",
|
||||
" 'nmne': {'inbound': 0, 'outbound': 0}}},\n",
|
||||
" 'SERVICES': {1: {'health_status': 0, 'operating_status': 0}},\n",
|
||||
" 'operating_status': 1},\n",
|
||||
" 5: {'FOLDERS': {1: {'FILES': {1: {'health_status': 0}}, 'health_status': 0}},\n",
|
||||
" 'NETWORK_INTERFACES': {1: {'nic_status': 1,\n",
|
||||
" 'nmne': {'inbound': 0, 'outbound': 0}},\n",
|
||||
" 2: {'nic_status': 0,\n",
|
||||
" 'nmne': {'inbound': 0, 'outbound': 0}}},\n",
|
||||
" 'SERVICES': {1: {'health_status': 0, 'operating_status': 0}},\n",
|
||||
" 'operating_status': 1},\n",
|
||||
" 6: {'FOLDERS': {1: {'FILES': {1: {'health_status': 0}}, 'health_status': 0}},\n",
|
||||
" 'NETWORK_INTERFACES': {1: {'nic_status': 1,\n",
|
||||
" 'nmne': {'inbound': 0, 'outbound': 0}},\n",
|
||||
" 2: {'nic_status': 0,\n",
|
||||
" 'nmne': {'inbound': 0, 'outbound': 0}}},\n",
|
||||
" 'SERVICES': {1: {'health_status': 0, 'operating_status': 0}},\n",
|
||||
" 'operating_status': 1},\n",
|
||||
" 7: {'FOLDERS': {1: {'FILES': {1: {'health_status': 0}}, 'health_status': 0}},\n",
|
||||
" 'NETWORK_INTERFACES': {1: {'nic_status': 1,\n",
|
||||
" 'nmne': {'inbound': 0, 'outbound': 1}},\n",
|
||||
" 2: {'nic_status': 0,\n",
|
||||
" 'nmne': {'inbound': 0, 'outbound': 0}}},\n",
|
||||
" 'SERVICES': {1: {'health_status': 0, 'operating_status': 0}},\n",
|
||||
" 'operating_status': 1}}\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"obs, reward, terminated, truncated, info = env.step(9) # scan database file\n",
|
||||
"obs, reward, terminated, truncated, info = env.step(1) # scan webapp service\n",
|
||||
@@ -818,21 +504,9 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 8,
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"step: 38\n",
|
||||
"Red action: DONOTHING\n",
|
||||
"Green action: DONOTHING\n",
|
||||
"Green action: DONOTHING\n",
|
||||
"Blue reward:-0.8\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"obs, reward, terminated, truncated, info = env.step(13) # patch the database\n",
|
||||
"print(f\"step: {env.game.step_counter}\")\n",
|
||||
@@ -855,21 +529,9 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 22,
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"step: 52\n",
|
||||
"Red action: DONOTHING\n",
|
||||
"Green action: ('NODE_APPLICATION_EXECUTE', {'node_id': 0, 'application_id': 0})\n",
|
||||
"Green action: ('NODE_APPLICATION_EXECUTE', {'node_id': 0, 'application_id': 0})\n",
|
||||
"Blue reward:-0.80\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"obs, reward, terminated, truncated, info = env.step(0) # patch the database\n",
|
||||
"print(f\"step: {env.game.step_counter}\")\n",
|
||||
@@ -890,49 +552,9 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 23,
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"step: 53, Red action: DONOTHING, Blue reward:-0.80\n",
|
||||
"step: 54, Red action: DONOTHING, Blue reward:-0.80\n",
|
||||
"step: 55, Red action: DONOTHING, Blue reward:-0.80\n",
|
||||
"step: 56, Red action: DONOTHING, Blue reward:0.54\n",
|
||||
"step: 57, Red action: DONOTHING, Blue reward:1.20\n",
|
||||
"step: 58, Red action: DONOTHING, Blue reward:1.20\n",
|
||||
"step: 59, Red action: DONOTHING, Blue reward:1.20\n",
|
||||
"step: 60, Red action: DONOTHING, Blue reward:1.20\n",
|
||||
"step: 61, Red action: DONOTHING, Blue reward:1.20\n",
|
||||
"step: 62, Red action: DONOTHING, Blue reward:1.20\n",
|
||||
"step: 63, Red action: DONOTHING, Blue reward:1.20\n",
|
||||
"step: 64, Red action: DONOTHING, Blue reward:1.20\n",
|
||||
"step: 65, Red action: DONOTHING, Blue reward:1.00\n",
|
||||
"step: 66, Red action: DONOTHING, Blue reward:1.00\n",
|
||||
"step: 67, Red action: DONOTHING, Blue reward:1.00\n",
|
||||
"step: 68, Red action: DONOTHING, Blue reward:1.00\n",
|
||||
"step: 69, Red action: DONOTHING, Blue reward:1.00\n",
|
||||
"step: 70, Red action: NODE_APPLICATION_EXECUTE, Blue reward:1.00\n",
|
||||
"step: 71, Red action: DONOTHING, Blue reward:1.00\n",
|
||||
"step: 72, Red action: DONOTHING, Blue reward:1.00\n",
|
||||
"step: 73, Red action: DONOTHING, Blue reward:1.00\n",
|
||||
"step: 74, Red action: DONOTHING, Blue reward:1.00\n",
|
||||
"step: 75, Red action: DONOTHING, Blue reward:0.80\n",
|
||||
"step: 76, Red action: DONOTHING, Blue reward:0.80\n",
|
||||
"step: 77, Red action: DONOTHING, Blue reward:0.80\n",
|
||||
"step: 78, Red action: DONOTHING, Blue reward:0.80\n",
|
||||
"step: 79, Red action: DONOTHING, Blue reward:0.80\n",
|
||||
"step: 80, Red action: DONOTHING, Blue reward:0.80\n",
|
||||
"step: 81, Red action: DONOTHING, Blue reward:0.80\n",
|
||||
"step: 82, Red action: DONOTHING, Blue reward:0.80\n",
|
||||
"step: 83, Red action: DONOTHING, Blue reward:0.80\n",
|
||||
"step: 84, Red action: DONOTHING, Blue reward:0.80\n",
|
||||
"step: 85, Red action: NODE_APPLICATION_EXECUTE, Blue reward:0.80\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"env.step(13) # Patch the database\n",
|
||||
"print(f\"step: {env.game.step_counter}, Red action: {info['agent_actions']['data_manipulation_attacker'][0]}, Blue reward:{reward:.2f}\" )\n",
|
||||
@@ -964,89 +586,9 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 24,
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"data": {
|
||||
"text/plain": [
|
||||
"{1: {'position': 0,\n",
|
||||
" 'permission': 0,\n",
|
||||
" 'source_node_id': 0,\n",
|
||||
" 'source_port': 0,\n",
|
||||
" 'dest_node_id': 0,\n",
|
||||
" 'dest_port': 0,\n",
|
||||
" 'protocol': 0},\n",
|
||||
" 2: {'position': 1,\n",
|
||||
" 'permission': 0,\n",
|
||||
" 'source_node_id': 0,\n",
|
||||
" 'source_port': 0,\n",
|
||||
" 'dest_node_id': 0,\n",
|
||||
" 'dest_port': 0,\n",
|
||||
" 'protocol': 0},\n",
|
||||
" 3: {'position': 2,\n",
|
||||
" 'permission': 0,\n",
|
||||
" 'source_node_id': 0,\n",
|
||||
" 'source_port': 0,\n",
|
||||
" 'dest_node_id': 0,\n",
|
||||
" 'dest_port': 0,\n",
|
||||
" 'protocol': 0},\n",
|
||||
" 4: {'position': 3,\n",
|
||||
" 'permission': 0,\n",
|
||||
" 'source_node_id': 0,\n",
|
||||
" 'source_port': 0,\n",
|
||||
" 'dest_node_id': 0,\n",
|
||||
" 'dest_port': 0,\n",
|
||||
" 'protocol': 0},\n",
|
||||
" 5: {'position': 4,\n",
|
||||
" 'permission': 2,\n",
|
||||
" 'source_node_id': 7,\n",
|
||||
" 'source_port': 1,\n",
|
||||
" 'dest_node_id': 4,\n",
|
||||
" 'dest_port': 1,\n",
|
||||
" 'protocol': 3},\n",
|
||||
" 6: {'position': 5,\n",
|
||||
" 'permission': 2,\n",
|
||||
" 'source_node_id': 8,\n",
|
||||
" 'source_port': 1,\n",
|
||||
" 'dest_node_id': 4,\n",
|
||||
" 'dest_port': 1,\n",
|
||||
" 'protocol': 3},\n",
|
||||
" 7: {'position': 6,\n",
|
||||
" 'permission': 0,\n",
|
||||
" 'source_node_id': 0,\n",
|
||||
" 'source_port': 0,\n",
|
||||
" 'dest_node_id': 0,\n",
|
||||
" 'dest_port': 0,\n",
|
||||
" 'protocol': 0},\n",
|
||||
" 8: {'position': 7,\n",
|
||||
" 'permission': 0,\n",
|
||||
" 'source_node_id': 0,\n",
|
||||
" 'source_port': 0,\n",
|
||||
" 'dest_node_id': 0,\n",
|
||||
" 'dest_port': 0,\n",
|
||||
" 'protocol': 0},\n",
|
||||
" 9: {'position': 8,\n",
|
||||
" 'permission': 0,\n",
|
||||
" 'source_node_id': 0,\n",
|
||||
" 'source_port': 0,\n",
|
||||
" 'dest_node_id': 0,\n",
|
||||
" 'dest_port': 0,\n",
|
||||
" 'protocol': 0},\n",
|
||||
" 10: {'position': 9,\n",
|
||||
" 'permission': 0,\n",
|
||||
" 'source_node_id': 0,\n",
|
||||
" 'source_port': 0,\n",
|
||||
" 'dest_node_id': 0,\n",
|
||||
" 'dest_port': 0,\n",
|
||||
" 'protocol': 0}}"
|
||||
]
|
||||
},
|
||||
"execution_count": 24,
|
||||
"metadata": {},
|
||||
"output_type": "execute_result"
|
||||
}
|
||||
],
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"obs['ACL']"
|
||||
]
|
||||
@@ -1060,7 +602,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 33,
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
@@ -1082,46 +624,9 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 35,
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"step: 117, Red action: DONOTHING, Blue reward:1.00\n",
|
||||
"step: 118, Red action: DONOTHING, Blue reward:1.00\n",
|
||||
"step: 119, Red action: DONOTHING, Blue reward:1.00\n",
|
||||
"step: 120, Red action: DONOTHING, Blue reward:1.00\n",
|
||||
"step: 121, Red action: DONOTHING, Blue reward:1.00\n",
|
||||
"step: 122, Red action: DONOTHING, Blue reward:1.00\n",
|
||||
"step: 123, Red action: DONOTHING, Blue reward:1.00\n",
|
||||
"step: 124, Red action: DONOTHING, Blue reward:1.00\n",
|
||||
"step: 125, Red action: NODE_APPLICATION_EXECUTE, Blue reward:1.00\n",
|
||||
"step: 126, Red action: DONOTHING, Blue reward:1.00\n",
|
||||
"step: 127, Red action: DONOTHING, Blue reward:1.00\n",
|
||||
"step: 128, Red action: DONOTHING, Blue reward:1.00\n",
|
||||
"step: 129, Red action: DONOTHING, Blue reward:1.00\n",
|
||||
"step: 130, Red action: DONOTHING, Blue reward:1.00\n",
|
||||
"step: 131, Red action: DONOTHING, Blue reward:1.00\n",
|
||||
"step: 132, Red action: DONOTHING, Blue reward:1.00\n",
|
||||
"step: 133, Red action: DONOTHING, Blue reward:1.00\n",
|
||||
"step: 134, Red action: DONOTHING, Blue reward:1.00\n",
|
||||
"step: 135, Red action: DONOTHING, Blue reward:1.00\n",
|
||||
"step: 136, Red action: DONOTHING, Blue reward:1.00\n",
|
||||
"step: 137, Red action: DONOTHING, Blue reward:1.00\n",
|
||||
"step: 138, Red action: DONOTHING, Blue reward:1.00\n",
|
||||
"step: 139, Red action: DONOTHING, Blue reward:1.00\n",
|
||||
"step: 140, Red action: DONOTHING, Blue reward:1.00\n",
|
||||
"step: 141, Red action: DONOTHING, Blue reward:1.00\n",
|
||||
"step: 142, Red action: DONOTHING, Blue reward:1.00\n",
|
||||
"step: 143, Red action: DONOTHING, Blue reward:1.00\n",
|
||||
"step: 144, Red action: NODE_APPLICATION_EXECUTE, Blue reward:1.00\n",
|
||||
"step: 145, Red action: DONOTHING, Blue reward:1.00\n",
|
||||
"step: 146, Red action: DONOTHING, Blue reward:1.00\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"for step in range(30):\n",
|
||||
" obs, reward, terminated, truncated, info = env.step(0) # do nothing\n",
|
||||
|
||||
Reference in New Issue
Block a user