893 - applied changes raised during PR

This commit is contained in:
SunilSamra
2023-06-06 13:12:28 +01:00
parent 8558ca1020
commit e15c8c8c89
2 changed files with 11 additions and 12 deletions

View File

@@ -334,9 +334,6 @@ The full observation space would have 15 node-related elements and 3 link-relate
gym.spaces.MultiDiscrete([4,5,6,4,4,4,5,6,4,4,4,5,6,4,4,5,5,5])
* Dictionary item {... ,1: [x1, x2, x3, x4, x5, x6] ...}
The placeholders inside the list under the key '1' mean the following:
Action Spaces
**************
@@ -344,7 +341,7 @@ The action space available to the blue agent comes in two types:
1. Node-based
2. Access Control List
3. Any
3. Any (Agent can take both node-based and ACL-based actions)
The choice of action space used during a training session is determined in the config_[name].yaml file.
@@ -364,6 +361,8 @@ The agent is able to influence the status of nodes by switching them off, resett
The blue agent is able to influence the configuration of the Access Control List rule set (which implements a system-wide firewall). In this instance, the action space is an OpenAI spaces.Discrete type, as follows:
* Dictionary item {... ,1: [x1, x2, x3, x4, x5, x6] ...}
The placeholders inside the list under the key '1' mean the following:
* [0, 2] - Action (0 = do nothing, 1 = create rule, 2 = delete rule)
* [0, 1] - Permission (0 = DENY, 1 = ALLOW)
@@ -375,7 +374,7 @@ The blue agent is able to influence the configuration of the Access Control List
**ANY**
The agent is able to carry out both **Node-Based** and **Access Control List** operations.
This means the dictionary will contain key-value pairs in the format of BOTH Node-Based and Access Control List as seen above.
This means the dictionary will contain key-value pairs in the format of BOTH Node-Based and Access Control List as seen above.
Rewards
*******

View File

@@ -536,14 +536,14 @@ class Primaite(Env):
_action: The action space from the agent
"""
# Convert discrete value back to multidiscrete
multidiscrete_action = self.action_dict[_action]
readable_action = self.action_dict[_action]
action_decision = multidiscrete_action[0]
action_permission = multidiscrete_action[1]
action_source_ip = multidiscrete_action[2]
action_destination_ip = multidiscrete_action[3]
action_protocol = multidiscrete_action[4]
action_port = multidiscrete_action[5]
action_decision = readable_action[0]
action_permission = readable_action[1]
action_source_ip = readable_action[2]
action_destination_ip = readable_action[3]
action_protocol = readable_action[4]
action_port = readable_action[5]
if action_decision == 0:
# It's decided to do nothing