yawning_titan.envs.generic.core.red_action_set#

A Parent red agent.

This red agent acts as a container for any move that a red agent could want to make. An actual red agent that would interfaces with the generic Gym environment uses all of or a subset of the methods available here. All of the methods interact with the network interface to affect the environment.

Classes

RedActionSet

A class representing a Red Agents action set.

class yawning_titan.envs.generic.core.red_action_set.RedActionSet(network_interface, action_set, action_probabilities)[source]#

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)

node_set = []#
__init__(network_interface, action_set, action_probabilities)[source]#

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)

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