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

basic_attack

Execute a basic attack.

choose_action

Choose an action to perform.

choose_target_node

Choose a target node.

do_nothing

No-op.

get_amount_zero_day

Get the amount of zero day attacks that the red agent has stored up.

increment_day

Increment the day for zero day attack generation.

intrude

Execute an attack on all nodes simultaneously.

natural_spread

Naturally spread throughout the network.

random_move

Select a random connected compromised node to move to.

reset

Reset red agent episode dependent variables to initial value.

spread

Execute a spread attack.

zero_day_attack

Execute a zero-day attack if available.

Attributes

node_set = []#
action_set = []#
action_probabilities = []#
reset()[source]#

Reset red agent episode dependent variables to initial value.

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)

choose_action()[source]#

Choose an action to perform.

Returns:

The chosen action to perform

increment_day()[source]#

Increment the day for zero day attack generation.

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