From 9f2d56259c306ed546bf2858e2c3cab0acfd0af0 Mon Sep 17 00:00:00 2001 From: Mike Salvatore Date: Mon, 27 Jun 2022 17:28:41 -0400 Subject: [PATCH] Agent: Improve TCP port discovery log message --- monkey/infection_monkey/network_scanning/tcp_scanner.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/monkey/infection_monkey/network_scanning/tcp_scanner.py b/monkey/infection_monkey/network_scanning/tcp_scanner.py index 17c72f606..f10e74115 100644 --- a/monkey/infection_monkey/network_scanning/tcp_scanner.py +++ b/monkey/infection_monkey/network_scanning/tcp_scanner.py @@ -2,6 +2,7 @@ import logging import select import socket import time +from pprint import pformat from typing import Iterable, Mapping, Tuple from common.utils import Timer @@ -110,9 +111,9 @@ def _check_tcp_ports( sockets_to_try = sockets_to_try - connected_ports - logger.debug( - "On host %s discovered the following ports %s" - % (str(ip), ",".join([str(s[0]) for s in connected_ports])) + logger.info( + f"Discovered the following ports on {ip}: " + f"{pformat([port for port, _ in connected_ports])}" ) open_ports = {port: "" for port, _ in connected_ports}