From 1a01b7c5dc9ea2c4147a3aeb9d7479ee7d5bc8bd Mon Sep 17 00:00:00 2001 From: Mike Salvatore Date: Fri, 30 Sep 2022 09:14:22 -0400 Subject: [PATCH] Common: Use NetworkPort in TCPScanConfiguration --- monkey/common/agent_configuration/agent_sub_configurations.py | 3 ++- monkey/tests/common/example_agent_configuration.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/monkey/common/agent_configuration/agent_sub_configurations.py b/monkey/common/agent_configuration/agent_sub_configurations.py index 41c416911..7d72a5f2f 100644 --- a/monkey/common/agent_configuration/agent_sub_configurations.py +++ b/monkey/common/agent_configuration/agent_sub_configurations.py @@ -3,6 +3,7 @@ from typing import Dict, Tuple from pydantic import PositiveFloat, conint, validator from common.base_models import MutableInfectionMonkeyBaseModel +from common.types import NetworkPort from .validators import ( validate_ip, @@ -128,7 +129,7 @@ class TCPScanConfiguration(MutableInfectionMonkeyBaseModel): """ timeout: PositiveFloat - ports: Tuple[conint(ge=0, le=65535), ...] + ports: Tuple[NetworkPort, ...] class NetworkScanConfiguration(MutableInfectionMonkeyBaseModel): diff --git a/monkey/tests/common/example_agent_configuration.py b/monkey/tests/common/example_agent_configuration.py index 304e85cee..c9adc36cc 100644 --- a/monkey/tests/common/example_agent_configuration.py +++ b/monkey/tests/common/example_agent_configuration.py @@ -27,7 +27,7 @@ SCAN_TARGET_CONFIGURATION = { TIMEOUT = 2.525 ICMP_CONFIGURATION = {"timeout": TIMEOUT} -PORTS = [8080, 443] +PORTS = [0, 8080, 443] TCP_SCAN_CONFIGURATION = {"timeout": TIMEOUT, "ports": PORTS} FINGERPRINTERS = [{"name": "mssql", "options": {}}]