yawning_titan.envs.generic.core.red_action_set.RedActionSet#
- class yawning_titan.envs.generic.core.red_action_set.RedActionSet(network_interface, action_set, action_probabilities)[source]#
Bases:
object
A class representing a Red Agents action set.
Initialise the red agent.
- Parameters:
network_interface – Object from the NetworkInterface class
action_set – The possible actions that the red agent can take (list)
action_probabilities – The likelihood of those actions being chosen (list)
Methods
Execute a basic attack.
Choose an action to perform.
Choose a target node.
No-op.
Get the amount of zero day attacks that the red agent has stored up.
Increment the day for zero day attack generation.
Execute an attack on all nodes simultaneously.
Naturally spread throughout the network.
Select a random connected compromised node to move to.
Reset red agent episode dependent variables to initial value.
Execute a spread attack.
Execute a zero-day attack if available.
Attributes
- node_set = []#
- action_set = []#
- action_probabilities = []#
- choose_target_node()[source]#
Choose a target node.
- Returns:
The target node (False if no possible nodes to attack) The node attacking the target node (False if no possible nodes to attack)
- get_amount_zero_day()[source]#
Get the amount of zero day attacks that the red agent has stored up.
- Returns:
Integer number - amount of zero day attacks
- random_move()[source]#
Select a random connected compromised node to move to.
- Returns:
The name of the action If the move succeeded The new red location The old red location
- Return type:
A dictionary containing
- do_nothing()[source]#
No-op.
- Returns:
The name of the action If the move succeeded The target node The current node
- zero_day_attack()[source]#
Execute a zero-day attack if available.
- Returns:
The name of the action taken If the action succeeded The target node The attacking node
- basic_attack()[source]#
Execute a basic attack.
The red agent will attempt to compromise a target node using the predefined attack method.
- Returns:
The name of the action taken If the action succeeded The target node The attacking node
- natural_spread()[source]#
Naturally spread throughout the network.
Nodes that are connected to compromised nodes can have a different chance to become compromised. The settings for how likely nodes are to become compromised are in the config file.
- Returns:
The success status of all the attacks The target nodes The attacking nodes
- spread()[source]#
Execute a spread attack.
The red agent will try and spread from every infected node to every connected safe node. The chance to spread between two nodes is independent of any other spreading.
- Returns:
The name of the action A list of success status for each node attacked A list of the target nodes A list of the attacking nodes
- intrude()[source]#
Execute an attack on all nodes simultaneously.
The red agent will try to infect every safe node at once (regardless of connectivity). The chance for the red agent to compromise a node is independent to each of the other nodes
- Returns:
The name of the action A list of success status for each node attacked A list of the target nodes A list of the attacking nodes