csle_common.dao.emulation_observation.common package
Submodules
csle_common.dao.emulation_observation.common.emulation_connection_observation_state module
- class csle_common.dao.emulation_observation.common.emulation_connection_observation_state.EmulationConnectionObservationState(conn, credential: csle_common.dao.emulation_config.credential.Credential, root: bool, service: str, port: int, tunnel_thread=None, tunnel_port: Optional[int] = None, interactive_shell=None, proxy: Optional[csle_common.dao.emulation_observation.common.emulation_connection_observation_state.EmulationConnectionObservationState] = None, ip: Optional[str] = None)[source]
Bases:
csle_base.json_serializable.JSONSerializable
A DTO representing a connection observation in the emulation
- static from_dict(d: Dict[str, Any]) csle_common.dao.emulation_observation.common.emulation_connection_observation_state.EmulationConnectionObservationState [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.common.emulation_connection_observation_state.EmulationConnectionObservationState [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() csle_common.dao.emulation_observation.common.emulation_connection_observation_state.EmulationConnectionObservationState [source]
- Returns
get the schema of the DTO
csle_common.dao.emulation_observation.common.emulation_port_observation_state module
- class csle_common.dao.emulation_observation.common.emulation_port_observation_state.EmulationPortObservationState(port: int, open: bool, service: str, protocol: csle_common.dao.emulation_config.transport_protocol.TransportProtocol, http_enum: str = '', http_grep: str = '', vulscan: str = '', version: str = '', fingerprint: str = '')[source]
Bases:
csle_base.json_serializable.JSONSerializable
DTO Representation a port observation in the emulation
- copy() csle_common.dao.emulation_observation.common.emulation_port_observation_state.EmulationPortObservationState [source]
- Returns
a copy of the object
- static from_dict(d: Dict[str, Any]) csle_common.dao.emulation_observation.common.emulation_port_observation_state.EmulationPortObservationState [source]
Converts a dict representation of the object to an instance
- Parameters
d – the dict to convert
- Returns
the created object instance
- static from_json_file(json_file_path: str) csle_common.dao.emulation_observation.common.emulation_port_observation_state.EmulationPortObservationState [source]
Reads a json file and converts it to a DTO
- Parameters
json_file_path – the json file path
- Returns
the converted DTO
- static from_network_service(network_service: csle_common.dao.emulation_config.network_service.NetworkService, service_lookup: Dict[str, str]) csle_common.dao.emulation_observation.common.emulation_port_observation_state.EmulationPortObservationState [source]
Converts a network service into a port observation state
- Parameters
network_service – the network service to convert
service_lookup – a lookup table for converting between service names and service ids
- Returns
- static schema() csle_common.dao.emulation_observation.common.emulation_port_observation_state.EmulationPortObservationState [source]
- Returns
get the schema of the DTO
- to_dict() Dict[str, Any] [source]
Converts the object to a dict representation
- Returns
a dict representation of the object
- to_network_service() csle_common.dao.emulation_config.network_service.NetworkService [source]
Converts the object into a network service representation
- Returns
the network service representation
csle_common.dao.emulation_observation.common.emulation_vulnerability_observation_state module
- class csle_common.dao.emulation_observation.common.emulation_vulnerability_observation_state.EmulationVulnerabilityObservationState(name: str, port: int, protocol: csle_common.dao.emulation_config.transport_protocol.TransportProtocol, cvss: float, credentials: List[csle_common.dao.emulation_config.credential.Credential], osvdbid: int = - 1, description: Optional[str] = None, service: Optional[str] = '')[source]
Bases:
csle_base.json_serializable.JSONSerializable
A DTO representing an observed vulnerability in the emulation
- static from_dict(d: Dict[str, Any]) csle_common.dao.emulation_observation.common.emulation_vulnerability_observation_state.EmulationVulnerabilityObservationState [source]
Converts a dict representation of the object into 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.common.emulation_vulnerability_observation_state.EmulationVulnerabilityObservationState [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() csle_common.dao.emulation_observation.common.emulation_vulnerability_observation_state.EmulationVulnerabilityObservationState [source]
- Returns
get the schema of the DTO
- to_dict() Dict[str, Any] [source]
Converts the object to a dict representation
- Returns
a dict representation of the object
- to_network_services() List[csle_common.dao.emulation_config.network_service.NetworkService] [source]
Converts the object into a network service representation
- Returns
the network service representation
- to_vulnerability() csle_common.dao.emulation_config.node_vulnerability_config.NodeVulnerabilityConfig [source]
Converts the object into a vulnerability representation
- Returns
A vulnerability representation of the object