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: Credential, root: bool, service: str, port: int, tunnel_thread=None, tunnel_port: Optional[int] = None, interactive_shell=None, proxy: Optional[EmulationConnectionObservationState] = None, ip: Optional[str] = None)[source]
Bases:
JSONSerializable
A DTO representing a connection observation in the emulation
- static from_dict(d: Dict[str, Any]) 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) 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() 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: TransportProtocol, http_enum: str = '', http_grep: str = '', vulscan: str = '', version: str = '', fingerprint: str = '')[source]
Bases:
JSONSerializable
DTO Representation a port observation in the emulation
- copy() EmulationPortObservationState [source]
- Returns
a copy of the object
- static from_dict(d: Dict[str, Any]) 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) 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: NetworkService, service_lookup: Dict[str, str]) 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() 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() 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: TransportProtocol, cvss: float, credentials: List[Credential], osvdbid: int = -1, description: Optional[str] = None, service: Optional[str] = '')[source]
Bases:
JSONSerializable
A DTO representing an observed vulnerability in the emulation
- static from_dict(d: Dict[str, Any]) 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) 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() 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[NetworkService] [source]
Converts the object into a network service representation
- Returns
the network service representation
- to_vulnerability() NodeVulnerabilityConfig [source]
Converts the object into a vulnerability representation
- Returns
A vulnerability representation of the object