csle_common.dao.emulation_observation.defender package
Submodules
csle_common.dao.emulation_observation.defender.emulation_defender_machine_observation_state module
- class csle_common.dao.emulation_observation.defender.emulation_defender_machine_observation_state.EmulationDefenderMachineObservationState(ips: List[str], kafka_config: Optional[KafkaConfig], host_metrics: HostMetrics, docker_stats: DockerStats, snort_ids_ip_alert_counters: SnortIdsIPAlertCounters, ossec_ids_alert_counters: OSSECIdsAlertCounters)[source]
Bases:
JSONSerializable
Represents the defender’s belief state of a component in the emulation
- cleanup() None [source]
Cleans up environment state. This method is particularly useful in emulation mode where there are SSH/Telnet/FTP… connections that should be cleaned up, as well as background threads.
- Returns
None
- copy() EmulationDefenderMachineObservationState [source]
- Returns
a copy of the object
- static from_container(container: NodeContainerConfig, kafka_config: KafkaConfig)[source]
Creates an instance from a container configuration
- Parameters
container – the container to create the instance from
kafka_config – the kafka config
- Returns
the created instance
- static from_dict(d: Dict[str, Any]) EmulationDefenderMachineObservationState [source]
Converts a dict representation of the object to an instance
- Parameters
d – the dict representation
- Returns
the object instance
- static from_json_file(json_file_path: str) EmulationDefenderMachineObservationState [source]
Reads a json file and converts it to a DTO
- Parameters
json_file_path – the json file path
- Returns
the converted DTO
- static schema() EmulationDefenderMachineObservationState [source]
- Returns
get the schema of the DTO
csle_common.dao.emulation_observation.defender.emulation_defender_observation_state module
- class csle_common.dao.emulation_observation.defender.emulation_defender_observation_state.EmulationDefenderObservationState(kafka_config: Optional[KafkaConfig], client_population_metrics: ClientPopulationMetrics, docker_stats: DockerStats, snort_ids_alert_counters: SnortIdsAlertCounters, ossec_ids_alert_counters: OSSECIdsAlertCounters, aggregated_host_metrics: HostMetrics, defender_actions: List[EmulationDefenderAction], attacker_actions: List[EmulationAttackerAction], snort_ids_rule_counters: SnortIdsRuleCounters)[source]
Bases:
JSONSerializable
Represents the defender’s agent’s current belief state of the emulation
- copy() EmulationDefenderObservationState [source]
- Returns
a copy of the object
- static from_dict(d: Dict[str, Any]) EmulationDefenderObservationState [source]
Converts a dict representation of the object to an instance
- Parameters
d – the dict to convert
- Returns
the created instance
- static from_json_file(json_file_path: str) EmulationDefenderObservationState [source]
Reads a json file and converts it to a DTO
- Parameters
json_file_path – the json file path
- Returns
the converted DTO
- get_action_ips(a: EmulationDefenderAction, emulation_env_config: EmulationEnvConfig) List[str] [source]
Gets the ips of the node that a defender action is targeted for
- Parameters
a – the action
emulation_env_config – the emulation env config
- Returns
the ip of the target node
- static schema() EmulationDefenderObservationState [source]
- Returns
get the schema of the DTO