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[csle_common.dao.emulation_config.kafka_config.KafkaConfig], host_metrics: csle_collector.host_manager.dao.host_metrics.HostMetrics, docker_stats: csle_collector.docker_stats_manager.dao.docker_stats.DockerStats, snort_ids_ip_alert_counters: csle_collector.snort_ids_manager.dao.snort_ids_ip_alert_counters.SnortIdsIPAlertCounters, ossec_ids_alert_counters: csle_collector.ossec_ids_manager.dao.ossec_ids_alert_counters.OSSECIdsAlertCounters)[source]

Bases: csle_base.json_serializable.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() csle_common.dao.emulation_observation.defender.emulation_defender_machine_observation_state.EmulationDefenderMachineObservationState[source]
Returns

a copy of the object

static from_container(container: csle_common.dao.emulation_config.node_container_config.NodeContainerConfig, kafka_config: csle_common.dao.emulation_config.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]) csle_common.dao.emulation_observation.defender.emulation_defender_machine_observation_state.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) csle_common.dao.emulation_observation.defender.emulation_defender_machine_observation_state.EmulationDefenderMachineObservationState[source]

Reads a json file and converts it to a DTO

Parameters

json_file_path – the json file path

Returns

the converted DTO

num_attributes() int[source]
Returns

The number of attribute of the DTO

static schema() csle_common.dao.emulation_observation.defender.emulation_defender_machine_observation_state.EmulationDefenderMachineObservationState[source]
Returns

get the schema of the DTO

sort_ports() None[source]

Sorts the list of ports

Returns

None

start_monitor_threads() None[source]

Starts the monitoring threads

Returns

None

to_dict() Dict[str, Any][source]

Converts the object to a dict representation

Returns

a dict representation of the object

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[csle_common.dao.emulation_config.kafka_config.KafkaConfig], client_population_metrics: csle_collector.client_manager.client_population_metrics.ClientPopulationMetrics, docker_stats: csle_collector.docker_stats_manager.dao.docker_stats.DockerStats, snort_ids_alert_counters: csle_collector.snort_ids_manager.dao.snort_ids_alert_counters.SnortIdsAlertCounters, ossec_ids_alert_counters: csle_collector.ossec_ids_manager.dao.ossec_ids_alert_counters.OSSECIdsAlertCounters, aggregated_host_metrics: csle_collector.host_manager.dao.host_metrics.HostMetrics, defender_actions: List[csle_common.dao.emulation_action.defender.emulation_defender_action.EmulationDefenderAction], attacker_actions: List[csle_common.dao.emulation_action.attacker.emulation_attacker_action.EmulationAttackerAction], snort_ids_rule_counters: csle_collector.snort_ids_manager.dao.snort_ids_rule_counters.SnortIdsRuleCounters)[source]

Bases: csle_base.json_serializable.JSONSerializable

Represents the defender’s agent’s current belief state of the emulation

average_metric_lists()[source]
Returns

computes the averages of the metric lists

cleanup() None[source]

Cleans up the machines in the observation

Returns

None

copy() csle_common.dao.emulation_observation.defender.emulation_defender_observation_state.EmulationDefenderObservationState[source]
Returns

a copy of the object

static from_dict(d: Dict[str, Any]) csle_common.dao.emulation_observation.defender.emulation_defender_observation_state.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) csle_common.dao.emulation_observation.defender.emulation_defender_observation_state.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: csle_common.dao.emulation_action.defender.emulation_defender_action.EmulationDefenderAction, emulation_env_config: csle_common.dao.emulation_config.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

num_attributes() int[source]
Returns

The number of attribute of the DTO

reset_metric_lists() None[source]

Resets the metric lists

Returns

None

static schema() csle_common.dao.emulation_observation.defender.emulation_defender_observation_state.EmulationDefenderObservationState[source]
Returns

get the schema of the DTO

sort_machines() None[source]

Sorts the machines in the observation

Returns

None

start_monitoring_threads() None[source]

Starts the avg host metrics thread

Returns

None

to_dict() Dict[str, Any][source]

Converts the object to a dict representation

Returns

a dict representation of the object

Module contents