Common: Rename all new pydantic configurations appropriately

This commit is contained in:
Shreya Malviya 2022-08-29 17:24:30 +05:30
parent 41e7cfb768
commit 0d6e3809d7
2 changed files with 27 additions and 27 deletions

View File

@ -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

View File

@ -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