From 0d6e3809d7420051d5c26cf099c31e15d9e9e3f8 Mon Sep 17 00:00:00 2001 From: Shreya Malviya Date: Mon, 29 Aug 2022 17:24:30 +0530 Subject: [PATCH] Common: Rename all new pydantic configurations appropriately --- .../agent_configuration.py | 18 +++++----- .../agent_sub_configurations.py | 36 +++++++++---------- 2 files changed, 27 insertions(+), 27 deletions(-) diff --git a/monkey/common/agent_configuration/agent_configuration.py b/monkey/common/agent_configuration/agent_configuration.py index 34635577f..80924257f 100644 --- a/monkey/common/agent_configuration/agent_configuration.py +++ b/monkey/common/agent_configuration/agent_configuration.py @@ -7,9 +7,9 @@ from pydantic import PositiveFloat from common.base_models import MutableInfectionMonkeyBaseModel from .agent_sub_configurations import ( - Pydantic___CustomPBAConfiguration, - Pydantic___PluginConfiguration, - Pydantic___PropagationConfiguration, + CustomPBAConfiguration, + PluginConfiguration, + PropagationConfiguration, ) @@ -24,10 +24,10 @@ class InvalidConfigurationError(Exception): ) -class Pydantic___AgentConfiguration(MutableInfectionMonkeyBaseModel): +class AgentConfiguration(MutableInfectionMonkeyBaseModel): keep_tunnel_open_time: PositiveFloat - custom_pbas: Pydantic___CustomPBAConfiguration - post_breach_actions: Tuple[Pydantic___PluginConfiguration, ...] - credential_collectors: Tuple[Pydantic___PluginConfiguration, ...] - payloads: Tuple[Pydantic___PluginConfiguration, ...] - propagation: Pydantic___PropagationConfiguration + custom_pbas: CustomPBAConfiguration + post_breach_actions: Tuple[PluginConfiguration, ...] + credential_collectors: Tuple[PluginConfiguration, ...] + payloads: Tuple[PluginConfiguration, ...] + propagation: PropagationConfiguration diff --git a/monkey/common/agent_configuration/agent_sub_configurations.py b/monkey/common/agent_configuration/agent_sub_configurations.py index 81e8acfbf..e358c91a9 100644 --- a/monkey/common/agent_configuration/agent_sub_configurations.py +++ b/monkey/common/agent_configuration/agent_sub_configurations.py @@ -12,7 +12,7 @@ from .validators import ( ) -class Pydantic___CustomPBAConfiguration(MutableInfectionMonkeyBaseModel): +class CustomPBAConfiguration(MutableInfectionMonkeyBaseModel): """ A configuration for custom post-breach actions @@ -44,7 +44,7 @@ class Pydantic___CustomPBAConfiguration(MutableInfectionMonkeyBaseModel): return filename -class Pydantic___PluginConfiguration(MutableInfectionMonkeyBaseModel): +class PluginConfiguration(MutableInfectionMonkeyBaseModel): """ A configuration for plugins @@ -70,7 +70,7 @@ class Pydantic___PluginConfiguration(MutableInfectionMonkeyBaseModel): options: Dict -class Pydantic___ScanTargetConfiguration(MutableInfectionMonkeyBaseModel): +class ScanTargetConfiguration(MutableInfectionMonkeyBaseModel): """ Configuration of network targets to scan and exploit @@ -106,7 +106,7 @@ class Pydantic___ScanTargetConfiguration(MutableInfectionMonkeyBaseModel): return subnet_range -class Pydantic___ICMPScanConfiguration(MutableInfectionMonkeyBaseModel): +class ICMPScanConfiguration(MutableInfectionMonkeyBaseModel): """ A configuration for ICMP scanning @@ -117,7 +117,7 @@ class Pydantic___ICMPScanConfiguration(MutableInfectionMonkeyBaseModel): timeout: PositiveFloat -class Pydantic___TCPScanConfiguration(MutableInfectionMonkeyBaseModel): +class TCPScanConfiguration(MutableInfectionMonkeyBaseModel): """ A configuration for TCP scanning @@ -130,7 +130,7 @@ class Pydantic___TCPScanConfiguration(MutableInfectionMonkeyBaseModel): ports: Tuple[conint(ge=0, le=65535), ...] -class Pydantic___NetworkScanConfiguration(MutableInfectionMonkeyBaseModel): +class NetworkScanConfiguration(MutableInfectionMonkeyBaseModel): """ A configuration for network scanning @@ -141,13 +141,13 @@ class Pydantic___NetworkScanConfiguration(MutableInfectionMonkeyBaseModel): :param targets: Configuration for targets to scan """ - tcp: Pydantic___TCPScanConfiguration - icmp: Pydantic___ICMPScanConfiguration - fingerprinters: Tuple[Pydantic___PluginConfiguration, ...] - targets: Pydantic___ScanTargetConfiguration + tcp: TCPScanConfiguration + icmp: ICMPScanConfiguration + fingerprinters: Tuple[PluginConfiguration, ...] + targets: ScanTargetConfiguration -class Pydantic___ExploitationOptionsConfiguration(MutableInfectionMonkeyBaseModel): +class ExploitationOptionsConfiguration(MutableInfectionMonkeyBaseModel): """ A configuration for exploitation options @@ -158,7 +158,7 @@ class Pydantic___ExploitationOptionsConfiguration(MutableInfectionMonkeyBaseMode http_ports: Tuple[conint(ge=0, le=65535), ...] -class Pydantic___ExploitationConfiguration(MutableInfectionMonkeyBaseModel): +class ExploitationConfiguration(MutableInfectionMonkeyBaseModel): """ A configuration for exploitation @@ -168,12 +168,12 @@ class Pydantic___ExploitationConfiguration(MutableInfectionMonkeyBaseModel): :param vulnerability: Configuration for vulnerability exploiters """ - options: Pydantic___ExploitationOptionsConfiguration - brute_force: Tuple[Pydantic___PluginConfiguration, ...] - vulnerability: Tuple[Pydantic___PluginConfiguration, ...] + options: ExploitationOptionsConfiguration + brute_force: Tuple[PluginConfiguration, ...] + vulnerability: Tuple[PluginConfiguration, ...] -class Pydantic___PropagationConfiguration(MutableInfectionMonkeyBaseModel): +class PropagationConfiguration(MutableInfectionMonkeyBaseModel): """ A configuration for propagation @@ -186,5 +186,5 @@ class Pydantic___PropagationConfiguration(MutableInfectionMonkeyBaseModel): """ maximum_depth: PositiveInt - network_scan: Pydantic___NetworkScanConfiguration - exploitation: Pydantic___ExploitationConfiguration + network_scan: NetworkScanConfiguration + exploitation: ExploitationConfiguration