yawning_titan.agents.sinewave_red.SineWaveRedAgent#
- class yawning_titan.agents.sinewave_red.SineWaveRedAgent(network_interface)[source]#
Bases:
RedInterface
An agent which is based on the RedInterface provided by the YAWNING TITAN generic environment.
This agent is an example of how the generic RedInterface can be extended to include custom red team behaviour - in this case, action selection.
The agent uses a sine wave to allow the red agent to attack more randomly and in waves rather than constantly.
Initialise the red interface.
- Parameters:
network_interface – Object from the NetworkInterface class
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.
Chooses and then performs an action.
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
- 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