Island: Return config timeouts in seconds

The old config scheme stored timeouts as milliseconds, whereas the new
one uses seconds. Seconds are more convenient because most python
methods expecting timeouts are expecting floating-point seconds.
This commit is contained in:
Mike Salvatore 2022-06-23 16:54:27 -04:00
parent 05f640d487
commit 6d156b8fee
3 changed files with 6 additions and 6 deletions

View File

@ -23,8 +23,8 @@ from .option_parsing import custom_pba_is_enabled
CHECK_ISLAND_FOR_STOP_COMMAND_INTERVAL_SEC = 5
CHECK_FOR_TERMINATE_INTERVAL_SEC = CHECK_ISLAND_FOR_STOP_COMMAND_INTERVAL_SEC / 5
SHUTDOWN_TIMEOUT = 5
NUM_SCAN_THREADS = 16
NUM_EXPLOIT_THREADS = 6
NUM_SCAN_THREADS = 1
NUM_EXPLOIT_THREADS = 1
CHECK_FOR_STOP_AGENT_COUNT = 5
CHECK_FOR_CONFIG_COUNT = 3

View File

@ -460,7 +460,7 @@ class ConfigService:
formatted_tcp_scan_config = {}
formatted_tcp_scan_config["timeout"] = config[flat_tcp_timeout_field]
formatted_tcp_scan_config["timeout"] = config[flat_tcp_timeout_field] / 1000
ports = ConfigService._union_tcp_and_http_ports(
config[flat_tcp_ports_field], config[flat_http_ports_field]
@ -484,7 +484,7 @@ class ConfigService:
flat_ping_timeout_field = "ping_scan_timeout"
formatted_icmp_scan_config = {}
formatted_icmp_scan_config["timeout"] = config[flat_ping_timeout_field]
formatted_icmp_scan_config["timeout"] = config[flat_ping_timeout_field] / 1000
config.pop(flat_ping_timeout_field, None)

View File

@ -99,7 +99,7 @@ def test_format_config_for_agent__propagation():
def test_format_config_for_agent__network_scan():
expected_network_scan_config = {
"tcp": {
"timeout": 3000,
"timeout": 3.0,
"ports": [
22,
80,
@ -117,7 +117,7 @@ def test_format_config_for_agent__network_scan():
],
},
"icmp": {
"timeout": 1000,
"timeout": 1.0,
},
"targets": {
"blocked_ips": ["192.168.1.1", "192.168.1.100"],