csle_common.dao.emulation_action_result package

Submodules

csle_common.dao.emulation_action_result.nikto_scan_result module

class csle_common.dao.emulation_action_result.nikto_scan_result.NiktoScanResult(vulnerabilities: List[csle_common.dao.emulation_action_result.nikto_vuln.NiktoVuln], port: int, ip: str, sitename: str)[source]

Bases: csle_base.json_serializable.JSONSerializable

DTO representing the result of a NiktoScan

static from_dict(d: Dict[str, Any]) csle_common.dao.emulation_action_result.nikto_scan_result.NiktoScanResult[source]

Converts a dict representation 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_action_result.nikto_scan_result.NiktoScanResult[source]

Reads a json file and converts it to a DTO

Parameters

json_file_path – the json file path

Returns

the converted DTO

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

Converts the object to a dict representation

Returns

a dict representation of the object

csle_common.dao.emulation_action_result.nikto_vuln module

class csle_common.dao.emulation_action_result.nikto_vuln.NiktoVuln(id: str, osvdb_id: int, method: str, iplink: str, namelink: str, uri: str, description: str)[source]

Bases: csle_base.json_serializable.JSONSerializable

DTO representing a vulnerability found with a Nikto scan

static from_dict(d: Dict[str, Any]) csle_common.dao.emulation_action_result.nikto_vuln.NiktoVuln[source]

Converts a dict representation 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_action_result.nikto_vuln.NiktoVuln[source]

Reads a json file and converts it to a DTO

Parameters

json_file_path – the json file path

Returns

the converted DTO

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

Converts the object to a dict representation

Returns

a dict representation of the object

to_obs() csle_common.dao.emulation_observation.common.emulation_vulnerability_observation_state.EmulationVulnerabilityObservationState[source]

Converts the object into a VulnerabilityObservationState

Returns

the created VulnerabilityObservationState object

csle_common.dao.emulation_action_result.nmap_addr_type module

Type of nmap addresses

class csle_common.dao.emulation_action_result.nmap_addr_type.NmapAddrType(value)[source]

Bases: enum.IntEnum

Enum representing the different address types in the network.

IP = 0
MAC = 1

csle_common.dao.emulation_action_result.nmap_brute_credentials module

class csle_common.dao.emulation_action_result.nmap_brute_credentials.NmapBruteCredentials(username: str, pw: str, state: str, port: int, protocol: csle_common.dao.emulation_config.transport_protocol.TransportProtocol, service: str)[source]

Bases: csle_base.json_serializable.JSONSerializable

A DTO representing credentials found with NMAP Brute-Force Scans

static from_dict(d: Dict[str, Any]) csle_common.dao.emulation_action_result.nmap_brute_credentials.NmapBruteCredentials[source]

Converts a dict representation 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_action_result.nmap_brute_credentials.NmapBruteCredentials[source]

Reads a json file and converts it to a DTO

Parameters

json_file_path – the json file path

Returns

the converted DTO

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

Converts the object to a dict representation

Returns

a dict representation of the object

to_obs() csle_common.dao.emulation_config.credential.Credential[source]

Converts the Object into a Credential Object

Returns

the created Credential Object

csle_common.dao.emulation_action_result.nmap_hop module

class csle_common.dao.emulation_action_result.nmap_hop.NmapHop(ttl: int, ipaddr: str, rtt: float, host: str)[source]

Bases: csle_base.json_serializable.JSONSerializable

DTO representing a Nmap Hop

static from_dict(d: Dict[str, Any]) csle_common.dao.emulation_action_result.nmap_hop.NmapHop[source]

Converts a dict representation 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_action_result.nmap_hop.NmapHop[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_action_result.nmap_hop.NmapHop[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

csle_common.dao.emulation_action_result.nmap_host_result module

class csle_common.dao.emulation_action_result.nmap_host_result.NmapHostResult(status: csle_common.dao.emulation_action_result.nmap_host_status.NmapHostStatus = NmapHostStatus.DOWN, ips: Union[None, List[str]] = None, mac_addr: Optional[str] = None, hostnames: Union[None, List[str]] = None, ports: Optional[List[csle_common.dao.emulation_action_result.nmap_port.NmapPort]] = None, os: Optional[csle_common.dao.emulation_action_result.nmap_os.NmapOs] = None, os_matches: Optional[List[csle_common.dao.emulation_action_result.nmap_os.NmapOs]] = None, vulnerabilities: Optional[List[csle_common.dao.emulation_action_result.nmap_vuln.NmapVuln]] = None, credentials: Optional[List[csle_common.dao.emulation_action_result.nmap_brute_credentials.NmapBruteCredentials]] = None, trace: Optional[csle_common.dao.emulation_action_result.nmap_trace.NmapTrace] = None)[source]

Bases: csle_base.json_serializable.JSONSerializable

A DTO representing a host found with an NMAP scan

copy() csle_common.dao.emulation_action_result.nmap_host_result.NmapHostResult[source]
Returns

a copy of the object

static from_dict(d: Dict[str, Any]) csle_common.dao.emulation_action_result.nmap_host_result.NmapHostResult[source]

Converts a dict representation 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_action_result.nmap_host_result.NmapHostResult[source]

Reads a json file and converts it to a DTO

Parameters

json_file_path – the json file path

Returns

the converted DTO

ips_match(ips: List[str]) bool[source]

Checks if a list of ips overlap with the ips of this host

Parameters

ips – the list of ips to check

Returns

True if they match, False otherwise

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

Converts the object to a dict representation

Returns

a dict representation of the object

csle_common.dao.emulation_action_result.nmap_host_status module

Type of nmap host statuses

class csle_common.dao.emulation_action_result.nmap_host_status.NmapHostStatus(value)[source]

Bases: enum.IntEnum

Enum representing the different host statuses in the network.

DOWN = 1
UP = 0

csle_common.dao.emulation_action_result.nmap_http_enum module

class csle_common.dao.emulation_action_result.nmap_http_enum.NmapHttpEnum(output: str)[source]

Bases: csle_base.json_serializable.JSONSerializable

DTO representing a NMAP HTTP Enum

static from_dict(d: Dict[str, Any]) csle_common.dao.emulation_action_result.nmap_http_enum.NmapHttpEnum[source]

Converts a dict representation 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_action_result.nmap_http_enum.NmapHttpEnum[source]

Reads a json file and converts it to a DTO

Parameters

json_file_path – the json file path

Returns

the converted DTO

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

Converts the object to a dict representation

Returns

a dict representation of the object

csle_common.dao.emulation_action_result.nmap_http_grep module

class csle_common.dao.emulation_action_result.nmap_http_grep.NmapHttpGrep(output: str)[source]

Bases: csle_base.json_serializable.JSONSerializable

A DTO representing the output of a Nmap HTTP Grep

static from_dict(d: Dict[str, Any]) csle_common.dao.emulation_action_result.nmap_http_grep.NmapHttpGrep[source]

Converts a dict representation 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_action_result.nmap_http_grep.NmapHttpGrep[source]

Reads a json file and converts it to a DTO

Parameters

json_file_path – the json file path

Returns

the converted DTO

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

Converts the object to a dict representation

Returns

a dict representation of the object

csle_common.dao.emulation_action_result.nmap_os module

class csle_common.dao.emulation_action_result.nmap_os.NmapOs(name: str, vendor: str, osfamily: str, accuracy: int)[source]

Bases: csle_base.json_serializable.JSONSerializable

DTO representing the operating system found with an NMAP scan

static from_dict(d: Dict[str, Any]) csle_common.dao.emulation_action_result.nmap_os.NmapOs[source]

Converts a dict representation 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_action_result.nmap_os.NmapOs[source]

Reads a json file and converts it to a DTO

Parameters

json_file_path – the json file path

Returns

the converted DTO

static get_best_match(os_matches)[source]

Returns the best matching os

Parameters

os_matches – list of os matches

Returns

best matching os

to_dict() Dict[str, Union[str, int]][source]

Converts the object to a dict representation

Returns

a dict representation of the object

csle_common.dao.emulation_action_result.nmap_port module

class csle_common.dao.emulation_action_result.nmap_port.NmapPort(port_id: int, protocol: csle_common.dao.emulation_config.transport_protocol.TransportProtocol, status: csle_common.dao.emulation_action_result.nmap_port_status.NmapPortStatus = NmapPortStatus.DOWN, service_name: str = 'none', http_enum: Optional[csle_common.dao.emulation_action_result.nmap_http_enum.NmapHttpEnum] = None, http_grep: Optional[csle_common.dao.emulation_action_result.nmap_http_grep.NmapHttpGrep] = None, vulscan: Optional[csle_common.dao.emulation_action_result.nmap_vulscan.NmapVulscan] = None, service_version: str = '', service_fp: str = '')[source]

Bases: csle_base.json_serializable.JSONSerializable

DTO Representing a Port found with a NMAP scan

static from_dict(d: Dict[str, Any]) csle_common.dao.emulation_action_result.nmap_port.NmapPort[source]

Converts a dict representation 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_action_result.nmap_port.NmapPort[source]

Reads a json file and converts it to a DTO

Parameters

json_file_path – the json file path

Returns

the converted DTO

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

Converts the object to a dict representation

Returns

a dict representation of the object

to_obs() csle_common.dao.emulation_observation.common.emulation_port_observation_state.EmulationPortObservationState[source]

Converts the object into a PortObservationState

Returns

the created PortObservationState

csle_common.dao.emulation_action_result.nmap_port_status module

Type of nmap port statuses

class csle_common.dao.emulation_action_result.nmap_port_status.NmapPortStatus(value)[source]

Bases: enum.IntEnum

Enum representing the different port statuses in the network.

DOWN = 1
UP = 0

csle_common.dao.emulation_action_result.nmap_scan_result module

class csle_common.dao.emulation_action_result.nmap_scan_result.NmapScanResult(hosts: List[csle_common.dao.emulation_action_result.nmap_host_result.NmapHostResult], ips: List[str])[source]

Bases: csle_base.json_serializable.JSONSerializable

DTO representing the result of a NMAP Scan

copy() csle_common.dao.emulation_action_result.nmap_scan_result.NmapScanResult[source]
Returns

a copy of the object

static from_dict(d: Dict[str, Any]) csle_common.dao.emulation_action_result.nmap_scan_result.NmapScanResult[source]

Converts a dict representation 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_action_result.nmap_scan_result.NmapScanResult[source]

Reads a json file and converts it to a DTO

Parameters

json_file_path – the json file path

Returns

the converted DTO

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

Converts the object to a dict representation

Returns

a dict representation of the object

csle_common.dao.emulation_action_result.nmap_trace module

class csle_common.dao.emulation_action_result.nmap_trace.NmapTrace(hops: List[csle_common.dao.emulation_action_result.nmap_hop.NmapHop])[source]

Bases: csle_base.json_serializable.JSONSerializable

DTO Representing an NMAP Trace

static from_dict(d: Dict[str, Any]) csle_common.dao.emulation_action_result.nmap_trace.NmapTrace[source]

Converts a dict representation 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_action_result.nmap_trace.NmapTrace[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_action_result.nmap_trace.NmapTrace[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

csle_common.dao.emulation_action_result.nmap_vuln module

class csle_common.dao.emulation_action_result.nmap_vuln.NmapVuln(name: str, port: int, protocol: csle_common.dao.emulation_config.transport_protocol.TransportProtocol, cvss: float, service: str, credentials: Optional[List[csle_common.dao.emulation_config.credential.Credential]] = None)[source]

Bases: csle_base.json_serializable.JSONSerializable

DTO representing a vulnerability found with NMAP

static from_dict(d: Dict[str, Any]) csle_common.dao.emulation_action_result.nmap_vuln.NmapVuln[source]

Converts a dict representation 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_action_result.nmap_vuln.NmapVuln[source]

Reads a json file and converts it to a DTO

Parameters

json_file_path – the json file path

Returns

the converted DTO

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

Converts the object to a dict representation

Returns

a dict representation of the object

to_obs() csle_common.dao.emulation_observation.common.emulation_vulnerability_observation_state.EmulationVulnerabilityObservationState[source]

Converts the object into a VulnerabilityObservationState

Returns

the created VulnerabilityObservationState

csle_common.dao.emulation_action_result.nmap_vulscan module

class csle_common.dao.emulation_action_result.nmap_vulscan.NmapVulscan(output: str)[source]

Bases: csle_base.json_serializable.JSONSerializable

DTO representing the result of a NMAP Vulscan

static from_dict(d: Dict[str, Any]) csle_common.dao.emulation_action_result.nmap_vulscan.NmapVulscan[source]

Converts a dict representation 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_action_result.nmap_vulscan.NmapVulscan[source]

Reads a json file and converts it to a DTO

Parameters

json_file_path – the json file path

Returns

the converted DTO

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

Converts the object to a dict representation

Returns

a dict representation of the object

Module contents