Common: Create TCPScanConfiguration using pydantic

This commit is contained in:
Shreya Malviya 2022-08-29 13:50:24 +05:30
parent 858b7650ac
commit 63a8e81c74
1 changed files with 14 additions and 1 deletions

View File

@ -1,7 +1,7 @@
from dataclasses import dataclass
from typing import Dict, Tuple
from pydantic import PositiveFloat, validator
from pydantic import PositiveFloat, conint, validator
from common.base_models import MutableInfectionMonkeyBaseModel
@ -219,6 +219,19 @@ class TCPScanConfiguration:
ports: Tuple[int, ...]
class Pydantic___TCPScanConfiguration(MutableInfectionMonkeyBaseModel):
"""
A configuration for TCP scanning
Attributes:
:param timeout: Maximum time in seconds to wait for a response from the target
:param ports: Ports to scan
"""
timeout: PositiveFloat
ports: Tuple[conint(ge=0, le=65535), ...]
@dataclass(frozen=True)
class NetworkScanConfiguration:
"""