diff --git a/simulation-system/libs/csle-common/src/csle_common/dao/emulation_action/defender/emulation_defender_stopping_actions.py b/simulation-system/libs/csle-common/src/csle_common/dao/emulation_action/defender/emulation_defender_stopping_actions.py index f890e4c28..701d14051 100644 --- a/simulation-system/libs/csle-common/src/csle_common/dao/emulation_action/defender/emulation_defender_stopping_actions.py +++ b/simulation-system/libs/csle-common/src/csle_common/dao/emulation_action/defender/emulation_defender_stopping_actions.py @@ -2,7 +2,7 @@ from csle_common.dao.emulation_action.defender.emulation_defender_action_type import EmulationDefenderActionType from csle_common.dao.emulation_action.defender.emulation_defender_action_id import EmulationDefenderActionId from csle_common.dao.emulation_action.defender.emulation_defender_action_outcome import EmulationDefenderActionOutcome - +from typing import List class EmulationDefenderStoppingActions: """ @@ -18,8 +18,8 @@ def STOP(index: int) -> EmulationDefenderAction: :return: the action """ id = EmulationDefenderActionId.STOP - cmd = [] - alt_cmd = [] + cmd: List[str] = [] + alt_cmd: List[str] = [] return EmulationDefenderAction(id=id, name="Report Intrusion", cmds=cmd, type=EmulationDefenderActionType.STOP, descr="Reports an ongoing intrusion to the infrastructure and stops", @@ -35,8 +35,8 @@ def CONTINUE(index: int) -> EmulationDefenderAction: :return: the action """ id = EmulationDefenderActionId.CONTINUE - cmd = [] - alt_cmd = [] + cmd: List[str] = [] + alt_cmd: List[str] = [] return EmulationDefenderAction( id=id, name="Continue", cmds=cmd, type=EmulationDefenderActionType.CONTINUE, descr="A 'continue' action, the defender chooses to not make any action", index=index, ips=[], @@ -52,8 +52,8 @@ def RESET_USERS(index: int) -> EmulationDefenderAction: :return: the action """ id = EmulationDefenderActionId.RESET_USERS - cmd = [] - alt_cmd = [] + cmd: List[str] = [] + alt_cmd: List[str] = [] return EmulationDefenderAction( id=id, name="Reset Users", cmds=cmd, type=EmulationDefenderActionType.ADD_DEFENSIVE_MECHANISM, descr="A non terminal stop action the defender resets all user accounts, which means that " @@ -69,8 +69,8 @@ def ENABLE_DPI(index: int) -> EmulationDefenderAction: :return: the action """ id = EmulationDefenderActionId.ENABLE_DPI - cmd = [] - alt_cmd = [] + cmd: List[str] = [] + alt_cmd: List[str] = [] return EmulationDefenderAction(id=id, name="Enable DPI", cmds=cmd, type=EmulationDefenderActionType.ADD_DEFENSIVE_MECHANISM, descr="A non terminal stop action, the defender enables DPI by starting the IDS", @@ -88,8 +88,8 @@ def BLACKLIST_IPS(index: int) -> EmulationDefenderAction: :return: the action """ id = EmulationDefenderActionId.BLACKLIST_IPS - cmd = [] - alt_cmd = [] + cmd: List[str] = [] + alt_cmd: List[str] = [] return EmulationDefenderAction( id=id, name="Blacklist IPs", cmds=cmd, type=EmulationDefenderActionType.ADD_DEFENSIVE_MECHANISM, diff --git a/simulation-system/libs/csle-common/src/csle_common/dao/emulation_action_result/nmap_brute_credentials.py b/simulation-system/libs/csle-common/src/csle_common/dao/emulation_action_result/nmap_brute_credentials.py index 2ec5993d5..b66d98248 100644 --- a/simulation-system/libs/csle-common/src/csle_common/dao/emulation_action_result/nmap_brute_credentials.py +++ b/simulation-system/libs/csle-common/src/csle_common/dao/emulation_action_result/nmap_brute_credentials.py @@ -65,7 +65,7 @@ def to_dict(self) -> Dict[str, Any]: :return: a dict representation of the object """ - d = {} + d: Dict[str, Any] = {} d["username"] = self.username d["pw"] = self.pw d["state"] = self.state diff --git a/simulation-system/libs/csle-common/src/csle_common/dao/emulation_config/client_population_config.py b/simulation-system/libs/csle-common/src/csle_common/dao/emulation_config/client_population_config.py index 46cf56495..db60fa8d2 100644 --- a/simulation-system/libs/csle-common/src/csle_common/dao/emulation_config/client_population_config.py +++ b/simulation-system/libs/csle-common/src/csle_common/dao/emulation_config/client_population_config.py @@ -92,7 +92,7 @@ def to_dict(self) -> Dict[str, Any]: :return: a dict representation of the object """ - d = {} + d: Dict[str, Any] = {} d["ip"] = self.ip d["networks"] = list(map(lambda x: x.to_dict(), self.networks)) d["client_manager_port"] = self.client_manager_port diff --git a/simulation-system/libs/csle-common/src/csle_common/dao/emulation_config/node_beats_config.py b/simulation-system/libs/csle-common/src/csle_common/dao/emulation_config/node_beats_config.py index 8cb1879eb..fc4383a08 100644 --- a/simulation-system/libs/csle-common/src/csle_common/dao/emulation_config/node_beats_config.py +++ b/simulation-system/libs/csle-common/src/csle_common/dao/emulation_config/node_beats_config.py @@ -66,7 +66,7 @@ def to_dict(self) -> Dict[str, Any]: :return: a dict representation of the object """ - d = {} + d: Dict[str, Any] = {} d["ip"] = self.ip d["log_files_paths"] = self.log_files_paths d["filebeat_modules"] = self.filebeat_modules diff --git a/simulation-system/libs/csle-common/src/csle_common/dao/emulation_config/node_flags_config.py b/simulation-system/libs/csle-common/src/csle_common/dao/emulation_config/node_flags_config.py index d19ede985..93869e0b5 100644 --- a/simulation-system/libs/csle-common/src/csle_common/dao/emulation_config/node_flags_config.py +++ b/simulation-system/libs/csle-common/src/csle_common/dao/emulation_config/node_flags_config.py @@ -29,7 +29,7 @@ def to_dict(self) -> Dict[str, Any]: :return: a dict representation of the object """ - d = {} + d: Dict[str, Any] = {} d["ip"] = self.ip d["flags"] = list(map(lambda x: x.to_dict(), self.flags)) d["docker_gw_bridge_ip"] = self.docker_gw_bridge_ip diff --git a/simulation-system/libs/csle-common/src/csle_common/dao/emulation_config/node_traffic_config.py b/simulation-system/libs/csle-common/src/csle_common/dao/emulation_config/node_traffic_config.py index 95316fa65..a750b8930 100644 --- a/simulation-system/libs/csle-common/src/csle_common/dao/emulation_config/node_traffic_config.py +++ b/simulation-system/libs/csle-common/src/csle_common/dao/emulation_config/node_traffic_config.py @@ -56,7 +56,7 @@ def to_dict(self) -> Dict[str, Any]: :return: a dict representation of the object """ - d = {} + d: Dict[str, Any] = {} d["ip"] = self.ip d["commands"] = self.commands d["traffic_manager_port"] = self.traffic_manager_port diff --git a/simulation-system/libs/csle-common/src/csle_common/dao/emulation_config/node_users_config.py b/simulation-system/libs/csle-common/src/csle_common/dao/emulation_config/node_users_config.py index 4b4977320..0d4eb4969 100644 --- a/simulation-system/libs/csle-common/src/csle_common/dao/emulation_config/node_users_config.py +++ b/simulation-system/libs/csle-common/src/csle_common/dao/emulation_config/node_users_config.py @@ -44,7 +44,7 @@ def to_dict(self) -> Dict[str, Any]: :return: a dict representation of the object """ - d = {} + d: Dict[str, Any] = {} d["ip"] = self.ip d["users"] = list(map(lambda x: x.to_dict(), self.users)) d["docker_gw_bridge_ip"] = self.docker_gw_bridge_ip diff --git a/simulation-system/libs/csle-common/src/csle_common/dao/emulation_config/node_vulnerability_config.py b/simulation-system/libs/csle-common/src/csle_common/dao/emulation_config/node_vulnerability_config.py index 87730198c..7d43a5dd3 100644 --- a/simulation-system/libs/csle-common/src/csle_common/dao/emulation_config/node_vulnerability_config.py +++ b/simulation-system/libs/csle-common/src/csle_common/dao/emulation_config/node_vulnerability_config.py @@ -50,7 +50,7 @@ def to_dict(self) -> Dict[str, Any]: :return: a dict representation of the object """ - d = {} + d: Dict[str, Any] = {} d["ip"] = self.ip d["vuln_type"] = self.vuln_type d["name"] = self.name diff --git a/simulation-system/libs/csle-common/src/csle_common/dao/emulation_config/ovs_switch_config.py b/simulation-system/libs/csle-common/src/csle_common/dao/emulation_config/ovs_switch_config.py index 9f423f6a5..9510ba73c 100644 --- a/simulation-system/libs/csle-common/src/csle_common/dao/emulation_config/ovs_switch_config.py +++ b/simulation-system/libs/csle-common/src/csle_common/dao/emulation_config/ovs_switch_config.py @@ -54,7 +54,7 @@ def to_dict(self) -> Dict[str, Any]: :return: a dict representation of the object """ - d = {} + d: List[str, Any] = {} d["ip"] = self.ip d["container_name"] = self.container_name d["openflow_protocols"] = self.openflow_protocols