From 507bf43b9b0bd95a913c5e92232fd4ef953654f6 Mon Sep 17 00:00:00 2001 From: VakarisZ Date: Wed, 20 May 2020 11:24:35 +0300 Subject: [PATCH] Renamed monkey_island.cc.utils to monkey_island.cc.network_utils as it contains only networking related code --- monkey/monkey_island/cc/main.py | 2 +- monkey/monkey_island/cc/models/monkey.py | 2 +- monkey/monkey_island/cc/{utils.py => network_utils.py} | 8 ++++---- monkey/monkey_island/cc/resources/local_run.py | 2 +- monkey/monkey_island/cc/resources/root.py | 2 +- monkey/monkey_island/cc/services/config.py | 2 +- monkey/monkey_island/cc/services/node.py | 2 +- monkey/monkey_island/cc/services/reporting/report.py | 2 +- 8 files changed, 11 insertions(+), 11 deletions(-) rename monkey/monkey_island/cc/{utils.py => network_utils.py} (99%) diff --git a/monkey/monkey_island/cc/main.py b/monkey/monkey_island/cc/main.py index 50e3bdd7c..0bc52e54f 100644 --- a/monkey/monkey_island/cc/main.py +++ b/monkey/monkey_island/cc/main.py @@ -22,7 +22,7 @@ logger = logging.getLogger(__name__) from monkey_island.cc.app import init_app from monkey_island.cc.services.reporting.exporter_init import populate_exporter_list -from monkey_island.cc.utils import local_ip_addresses +from monkey_island.cc.network_utils import local_ip_addresses from monkey_island.cc.environment.environment import env from monkey_island.cc.database import is_db_server_up, get_db_version from monkey_island.cc.resources.monkey_download import MonkeyDownload diff --git a/monkey/monkey_island/cc/models/monkey.py b/monkey/monkey_island/cc/models/monkey.py index f658a3d06..ad10084d9 100644 --- a/monkey/monkey_island/cc/models/monkey.py +++ b/monkey/monkey_island/cc/models/monkey.py @@ -8,7 +8,7 @@ import ring from monkey_island.cc.models.monkey_ttl import MonkeyTtl, create_monkey_ttl_document from monkey_island.cc.consts import DEFAULT_MONKEY_TTL_EXPIRY_DURATION_IN_SECONDS from monkey_island.cc.models.command_control_channel import CommandControlChannel -from monkey_island.cc.utils import local_ip_addresses +from monkey_island.cc.network_utils import local_ip_addresses from common.cloud import environment_names MAX_MONKEYS_AMOUNT_TO_CACHE = 100 diff --git a/monkey/monkey_island/cc/utils.py b/monkey/monkey_island/cc/network_utils.py similarity index 99% rename from monkey/monkey_island/cc/utils.py rename to monkey/monkey_island/cc/network_utils.py index 37af43745..1c4f59e34 100644 --- a/monkey/monkey_island/cc/utils.py +++ b/monkey/monkey_island/cc/network_utils.py @@ -1,12 +1,12 @@ +import array +import collections +import ipaddress import socket +import struct import sys from typing import List import collections -import array - -import struct -import ipaddress from netifaces import interfaces, ifaddresses, AF_INET from ring import lru diff --git a/monkey/monkey_island/cc/resources/local_run.py b/monkey/monkey_island/cc/resources/local_run.py index 41f5fa417..d63b21ffb 100644 --- a/monkey/monkey_island/cc/resources/local_run.py +++ b/monkey/monkey_island/cc/resources/local_run.py @@ -10,7 +10,7 @@ from monkey_island.cc.environment.environment import env from monkey_island.cc.models import Monkey from monkey_island.cc.resources.monkey_download import get_monkey_executable from monkey_island.cc.services.node import NodeService -from monkey_island.cc.utils import local_ip_addresses +from monkey_island.cc.network_utils import local_ip_addresses from monkey_island.cc.consts import MONKEY_ISLAND_ABS_PATH __author__ = 'Barak' diff --git a/monkey/monkey_island/cc/resources/root.py b/monkey/monkey_island/cc/resources/root.py index 216329905..5b319072b 100644 --- a/monkey/monkey_island/cc/resources/root.py +++ b/monkey/monkey_island/cc/resources/root.py @@ -8,7 +8,7 @@ from monkey_island.cc.auth import jwt_required from monkey_island.cc.database import mongo from monkey_island.cc.services.database import Database from monkey_island.cc.services.infection_lifecycle import InfectionLifecycle -from monkey_island.cc.utils import local_ip_addresses +from monkey_island.cc.network_utils import local_ip_addresses __author__ = 'Barak' diff --git a/monkey/monkey_island/cc/services/config.py b/monkey/monkey_island/cc/services/config.py index d4521b3f9..68a9885cd 100644 --- a/monkey/monkey_island/cc/services/config.py +++ b/monkey/monkey_island/cc/services/config.py @@ -7,7 +7,7 @@ import monkey_island.cc.services.post_breach_files from monkey_island.cc.database import mongo from monkey_island.cc.environment.environment import env -from monkey_island.cc.utils import local_ip_addresses +from monkey_island.cc.network_utils import local_ip_addresses from .config_schema import SCHEMA from monkey_island.cc.encryptor import encryptor diff --git a/monkey/monkey_island/cc/services/node.py b/monkey/monkey_island/cc/services/node.py index 3206fef95..9c0921580 100644 --- a/monkey/monkey_island/cc/services/node.py +++ b/monkey/monkey_island/cc/services/node.py @@ -8,7 +8,7 @@ import monkey_island.cc.services.log from monkey_island.cc.database import mongo from monkey_island.cc.models import Monkey from monkey_island.cc.services.edge import EdgeService -from monkey_island.cc.utils import local_ip_addresses, is_local_ips +from monkey_island.cc.network_utils import local_ip_addresses, is_local_ips from monkey_island.cc import models from monkey_island.cc.services.utils.node_states import NodeStates diff --git a/monkey/monkey_island/cc/services/reporting/report.py b/monkey/monkey_island/cc/services/reporting/report.py index f2c763d23..195eac3d6 100644 --- a/monkey/monkey_island/cc/services/reporting/report.py +++ b/monkey/monkey_island/cc/services/reporting/report.py @@ -16,7 +16,7 @@ from monkey_island.cc.services.node import NodeService from monkey_island.cc.services.reporting.pth_report import PTHReportService from monkey_island.cc.services.reporting.report_exporter_manager import ReportExporterManager from monkey_island.cc.services.reporting.report_generation_synchronisation import safe_generate_regular_report -from monkey_island.cc.utils import local_ip_addresses, get_subnets +from monkey_island.cc.network_utils import local_ip_addresses, get_subnets __author__ = "itay.mizeretz"