yawning_titan.envs.generic.core.red_interface.RedInterface#

class yawning_titan.envs.generic.core.red_interface.RedInterface(network_interface)[source]#

Bases: RedActionSet

The interface used by the Red Agents to act within the environment.

Initialise the red interface.

Parameters:

network_interface – Object from the NetworkInterface class

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.

perform_action

Chooses and then performs an action.

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

perform_action()[source]#

Chooses and then performs an action.

This is called for every one of the red agents turns

Returns:

A tuple containing the name of the action, the success status, the target, the attacking node and any natural spreading attacks

action_probabilities = []#
action_set = []#
basic_attack()#

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

choose_action()#

Choose an action to perform.

Returns:

The chosen action to perform

choose_target_node()#

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)

do_nothing()#

No-op.

Returns:

The name of the action If the move succeeded The target node The current node

get_amount_zero_day()#

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

Returns:

Integer number - amount of zero day attacks

increment_day()#

Increment the day for zero day attack generation.

intrude()#

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

natural_spread()#

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

node_set = []#
random_move()#

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

reset()#

Reset red agent episode dependent variables to initial value.

spread()#

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

zero_day_attack()#

Execute a zero-day attack if available.

Returns:

The name of the action taken If the action succeeded The target node The attacking node