csle_system_identification package

Subpackages

Submodules

csle_system_identification.emulator module

class csle_system_identification.emulator.Emulator[source]

Bases: object

Class for running episodes in the emulation system

static run_action_sequences(emulation_env_config: csle_common.dao.emulation_config.emulation_env_config.EmulationEnvConfig, attacker_sequence: List[csle_common.dao.emulation_action.attacker.emulation_attacker_action.EmulationAttackerAction], defender_sequence: List[csle_common.dao.emulation_action.defender.emulation_defender_action.EmulationDefenderAction], repeat_times: int = 1, sleep_time: int = 1, save_dir: str = '', emulation_statistics: Optional[csle_common.dao.system_identification.emulation_statistics.EmulationStatistics] = None, descr: str = '', save: bool = True, data_collection_job: Optional[csle_common.dao.jobs.data_collection_job_config.DataCollectionJobConfig] = None, save_emulation_traces_every: int = 10, emulation_traces_to_save_with_data_collection_job: int = 3, intrusion_start_p: float = 0.1, intrusion_continue: float = 0.3, trace_len: int = 30, restart_client_population: bool = False) None[source]

Runs an attacker and defender sequence in the emulation <repeat_times> times

Parameters
  • emulation_env_config – the configuration of the emulation

  • attacker_sequence – the sequence of attacker actions

  • defender_sequence – the sequence of defender actions

  • repeat_times – the number of times to repeat the sequences

  • sleep_time – the number of seconds to sleep between time-steps

  • save_dir – the directory to save the collected traces

  • emulation_statistics – the emulation statistics to update

  • descr – descr of the execution

  • save – boolean parameter indicating whether traces and statistics should be saved or not

  • data_collection_job – the system identification job configuration

  • save_emulation_traces_every – how frequently to save emulation traces

  • emulation_traces_to_save_with_data_collection_job – num traces to save with the job

  • intrusion_start_p – the p parameter for the geometric distribution that determines when an intrusion starts

  • intrusion_continue – the p parameter for the geometric distribution that determines when an intrusion continues

  • trace_len – fixed trace length

  • restart_client_population – whether to restart the client population after each trace.

Returns

None

static run_actions(emulation_env_config: csle_common.dao.emulation_config.emulation_env_config.EmulationEnvConfig, attacker_action: csle_common.dao.emulation_action.attacker.emulation_attacker_action.EmulationAttackerAction, s: csle_common.dao.emulation_config.emulation_env_state.EmulationEnvState, defender_action: csle_common.dao.emulation_action.defender.emulation_defender_action.EmulationDefenderAction, trace: csle_common.dao.emulation_config.emulation_trace.EmulationTrace, sleep_time: int = 1) Tuple[csle_common.dao.emulation_config.emulation_trace.EmulationTrace, csle_common.dao.emulation_config.emulation_env_state.EmulationEnvState][source]

Runs a pair of actions in the emulation and updates a provided trace

Parameters
  • emulation_env_config – configuration of the emulation environment

  • attacker_action – the attacker action

  • s – the current emulation state

  • defender_action – the defender action

  • trace – the trace to update

  • sleep_time – the time-step length

Returns

the updated trace and state

Module contents