diff --git a/envs/monkey_zoo/blackbox/analyzers/zerologon_analyzer.py b/envs/monkey_zoo/blackbox/analyzers/zerologon_analyzer.py index 6f71256b9..5c256beaf 100644 --- a/envs/monkey_zoo/blackbox/analyzers/zerologon_analyzer.py +++ b/envs/monkey_zoo/blackbox/analyzers/zerologon_analyzer.py @@ -1,13 +1,13 @@ -from typing import List from pprint import pformat +from typing import List import dpath.util from common.config_value_paths import ( - USER_LIST_PATH, - PASSWORD_LIST_PATH, - NTLM_HASH_LIST_PATH, LM_HASH_LIST_PATH, + NTLM_HASH_LIST_PATH, + PASSWORD_LIST_PATH, + USER_LIST_PATH, ) from envs.monkey_zoo.blackbox.analyzers.analyzer import Analyzer from envs.monkey_zoo.blackbox.analyzers.analyzer_log import AnalyzerLog diff --git a/envs/monkey_zoo/blackbox/island_client/island_config_parser.py b/envs/monkey_zoo/blackbox/island_client/island_config_parser.py index 8c7edaa58..eda2def01 100644 --- a/envs/monkey_zoo/blackbox/island_client/island_config_parser.py +++ b/envs/monkey_zoo/blackbox/island_client/island_config_parser.py @@ -3,8 +3,8 @@ import json import dpath.util from typing_extensions import Type -from envs.monkey_zoo.blackbox.island_client.monkey_island_client import MonkeyIslandClient from envs.monkey_zoo.blackbox.config_templates.config_template import ConfigTemplate +from envs.monkey_zoo.blackbox.island_client.monkey_island_client import MonkeyIslandClient class IslandConfigParser: diff --git a/envs/monkey_zoo/blackbox/test_blackbox.py b/envs/monkey_zoo/blackbox/test_blackbox.py index 303d0be52..3da99becf 100644 --- a/envs/monkey_zoo/blackbox/test_blackbox.py +++ b/envs/monkey_zoo/blackbox/test_blackbox.py @@ -7,8 +7,6 @@ from typing_extensions import Type from envs.monkey_zoo.blackbox.analyzers.communication_analyzer import CommunicationAnalyzer from envs.monkey_zoo.blackbox.analyzers.zerologon_analyzer import ZerologonAnalyzer -from envs.monkey_zoo.blackbox.island_client.island_config_parser import IslandConfigParser -from envs.monkey_zoo.blackbox.island_client.monkey_island_client import MonkeyIslandClient from envs.monkey_zoo.blackbox.config_templates.config_template import ConfigTemplate from envs.monkey_zoo.blackbox.config_templates.drupal import Drupal from envs.monkey_zoo.blackbox.config_templates.elastic import Elastic @@ -25,6 +23,8 @@ from envs.monkey_zoo.blackbox.config_templates.weblogic import Weblogic from envs.monkey_zoo.blackbox.config_templates.wmi_mimikatz import WmiMimikatz from envs.monkey_zoo.blackbox.config_templates.wmi_pth import WmiPth from envs.monkey_zoo.blackbox.config_templates.zerologon import Zerologon +from envs.monkey_zoo.blackbox.island_client.island_config_parser import IslandConfigParser +from envs.monkey_zoo.blackbox.island_client.monkey_island_client import MonkeyIslandClient from envs.monkey_zoo.blackbox.log_handlers.test_logs_handler import TestLogsHandler from envs.monkey_zoo.blackbox.tests.exploitation import ExploitationTest from envs.monkey_zoo.blackbox.tests.performance.map_generation import MapGenerationTest diff --git a/envs/monkey_zoo/blackbox/utils/config_generation_script.py b/envs/monkey_zoo/blackbox/utils/config_generation_script.py index 603e9fe4d..b2c69acda 100644 --- a/envs/monkey_zoo/blackbox/utils/config_generation_script.py +++ b/envs/monkey_zoo/blackbox/utils/config_generation_script.py @@ -18,12 +18,8 @@ from envs.monkey_zoo.blackbox.config_templates.weblogic import Weblogic from envs.monkey_zoo.blackbox.config_templates.wmi_mimikatz import WmiMimikatz from envs.monkey_zoo.blackbox.config_templates.wmi_pth import WmiPth from envs.monkey_zoo.blackbox.config_templates.zerologon import Zerologon -from envs.monkey_zoo.blackbox.island_client.island_config_parser import ( - IslandConfigParser, -) -from envs.monkey_zoo.blackbox.island_client.monkey_island_client import ( - MonkeyIslandClient, -) +from envs.monkey_zoo.blackbox.island_client.island_config_parser import IslandConfigParser +from envs.monkey_zoo.blackbox.island_client.monkey_island_client import MonkeyIslandClient DST_DIR_NAME = "generated_configs" DST_DIR_PATH = pathlib.Path(pathlib.Path(__file__).parent.absolute(), DST_DIR_NAME) diff --git a/monkey/common/cloud/aws/aws_instance.py b/monkey/common/cloud/aws/aws_instance.py index 5cdf3bdd3..236cde5e1 100644 --- a/monkey/common/cloud/aws/aws_instance.py +++ b/monkey/common/cloud/aws/aws_instance.py @@ -1,6 +1,7 @@ import json import logging import re + import requests from common.cloud.environment_names import Environment diff --git a/monkey/common/cloud/aws/test_aws_instance.py b/monkey/common/cloud/aws/test_aws_instance.py index 146326518..d3c89f067 100644 --- a/monkey/common/cloud/aws/test_aws_instance.py +++ b/monkey/common/cloud/aws/test_aws_instance.py @@ -5,7 +5,6 @@ import requests_mock from common.cloud.aws.aws_instance import AWS_LATEST_METADATA_URI_PREFIX, AwsInstance from common.cloud.environment_names import Environment - INSTANCE_ID_RESPONSE = "i-1234567890abcdef0" AVAILABILITY_ZONE_RESPONSE = "us-west-2b" diff --git a/monkey/common/cloud/azure/test_azure_instance.py b/monkey/common/cloud/azure/test_azure_instance.py index 7c5770446..fb1e01abb 100644 --- a/monkey/common/cloud/azure/test_azure_instance.py +++ b/monkey/common/cloud/azure/test_azure_instance.py @@ -6,7 +6,6 @@ import simplejson from common.cloud.azure.azure_instance import AZURE_METADATA_SERVICE_URL, AzureInstance from common.cloud.environment_names import Environment - GOOD_DATA = { "compute": { "azEnvironment": "AZUREPUBLICCLOUD", diff --git a/monkey/infection_monkey/control.py b/monkey/infection_monkey/control.py index 19428b17a..4ccd2bec4 100644 --- a/monkey/infection_monkey/control.py +++ b/monkey/infection_monkey/control.py @@ -9,12 +9,12 @@ from requests.exceptions import ConnectionError import infection_monkey.monkeyfs as monkeyfs import infection_monkey.tunnel as tunnel +from common.common_consts.api_url_consts import T1216_PBA_FILE_DOWNLOAD_PATH from common.common_consts.timeouts import ( LONG_REQUEST_TIMEOUT, MEDIUM_REQUEST_TIMEOUT, SHORT_REQUEST_TIMEOUT, ) -from common.common_consts.api_url_consts import T1216_PBA_FILE_DOWNLOAD_PATH from infection_monkey.config import GUID, WormConfiguration from infection_monkey.network.info import check_internet_access, local_ips from infection_monkey.transport.http import HTTPConnectProxy diff --git a/monkey/infection_monkey/exploit/hadoop.py b/monkey/infection_monkey/exploit/hadoop.py index b9dd20159..d92c39f6c 100644 --- a/monkey/infection_monkey/exploit/hadoop.py +++ b/monkey/infection_monkey/exploit/hadoop.py @@ -11,8 +11,8 @@ import string import requests -from infection_monkey.exploit.tools.helpers import build_monkey_commandline, get_monkey_depth from common.common_consts.timeouts import LONG_REQUEST_TIMEOUT +from infection_monkey.exploit.tools.helpers import build_monkey_commandline, get_monkey_depth from infection_monkey.exploit.tools.http_tools import HTTPTools from infection_monkey.exploit.web_rce import WebRCE from infection_monkey.model import ( diff --git a/monkey/infection_monkey/exploit/tests/test_zerologon.py b/monkey/infection_monkey/exploit/tests/test_zerologon.py index b4a0833ce..a2956887f 100644 --- a/monkey/infection_monkey/exploit/tests/test_zerologon.py +++ b/monkey/infection_monkey/exploit/tests/test_zerologon.py @@ -3,7 +3,6 @@ import pytest from infection_monkey.exploit.zerologon import ZerologonExploiter from infection_monkey.model.host import VictimHost - DOMAIN_NAME = "domain-name" IP = "0.0.0.0" NETBIOS_NAME = "NetBIOS Name" diff --git a/monkey/infection_monkey/exploit/tests/zerologon_utils/test_vuln_assessment.py b/monkey/infection_monkey/exploit/tests/zerologon_utils/test_vuln_assessment.py index 99ab690b4..525cd8e3f 100644 --- a/monkey/infection_monkey/exploit/tests/zerologon_utils/test_vuln_assessment.py +++ b/monkey/infection_monkey/exploit/tests/zerologon_utils/test_vuln_assessment.py @@ -5,7 +5,6 @@ from common.utils.exceptions import DomainControllerNameFetchError from infection_monkey.exploit.zerologon_utils.vuln_assessment import get_dc_details from infection_monkey.model.host import VictimHost - DOMAIN_NAME = "domain-name" IP = "0.0.0.0" diff --git a/monkey/infection_monkey/exploit/zerologon.py b/monkey/infection_monkey/exploit/zerologon.py index a30ceda2d..9c18b2de3 100644 --- a/monkey/infection_monkey/exploit/zerologon.py +++ b/monkey/infection_monkey/exploit/zerologon.py @@ -21,7 +21,6 @@ from infection_monkey.exploit.zerologon_utils.vuln_assessment import get_dc_deta from infection_monkey.exploit.zerologon_utils.wmiexec import Wmiexec from infection_monkey.utils.capture_output import StdoutCapture - LOG = logging.getLogger(__name__) diff --git a/monkey/infection_monkey/monkey.py b/monkey/infection_monkey/monkey.py index d1871da22..7123d8b9e 100644 --- a/monkey/infection_monkey/monkey.py +++ b/monkey/infection_monkey/monkey.py @@ -7,7 +7,6 @@ import time from threading import Thread import infection_monkey.tunnel as tunnel -from infection_monkey.network.tools import is_running_on_island from common.utils.attack_utils import ScanStatus, UsageEnum from common.utils.exceptions import ExploitingVulnerableMachineError, FailedExploitationError from common.version import get_version @@ -18,7 +17,7 @@ from infection_monkey.model import DELAY_DELETE_CMD from infection_monkey.network.firewall import app as firewall from infection_monkey.network.HostFinger import HostFinger from infection_monkey.network.network_scanner import NetworkScanner -from infection_monkey.network.tools import get_interface_to_target +from infection_monkey.network.tools import get_interface_to_target, is_running_on_island from infection_monkey.post_breach.post_breach_handler import PostBreach from infection_monkey.system_info import SystemInfoCollector from infection_monkey.system_singleton import SystemSingleton diff --git a/monkey/infection_monkey/telemetry/scoutsuite_telem.py b/monkey/infection_monkey/telemetry/scoutsuite_telem.py index f6bb123d4..91b26f69d 100644 --- a/monkey/infection_monkey/telemetry/scoutsuite_telem.py +++ b/monkey/infection_monkey/telemetry/scoutsuite_telem.py @@ -1,5 +1,6 @@ from ScoutSuite.output.result_encoder import ScoutJsonEncoder from ScoutSuite.providers.base.provider import BaseProvider + from common.common_consts.telem_categories import TelemCategoryEnum from infection_monkey.telemetry.base_telem import BaseTelem diff --git a/monkey/infection_monkey/telemetry/tests/attack/test_attack_telem.py b/monkey/infection_monkey/telemetry/tests/attack/test_attack_telem.py index 0812b1ea6..02d591f3e 100644 --- a/monkey/infection_monkey/telemetry/tests/attack/test_attack_telem.py +++ b/monkey/infection_monkey/telemetry/tests/attack/test_attack_telem.py @@ -5,7 +5,6 @@ import pytest from common.utils.attack_utils import ScanStatus from infection_monkey.telemetry.attack.attack_telem import AttackTelem - STATUS = ScanStatus.USED TECHNIQUE = "T9999" diff --git a/monkey/infection_monkey/telemetry/tests/attack/test_t1005_telem.py b/monkey/infection_monkey/telemetry/tests/attack/test_t1005_telem.py index 6464d1121..7ad7e074c 100644 --- a/monkey/infection_monkey/telemetry/tests/attack/test_t1005_telem.py +++ b/monkey/infection_monkey/telemetry/tests/attack/test_t1005_telem.py @@ -5,7 +5,6 @@ import pytest from common.utils.attack_utils import ScanStatus from infection_monkey.telemetry.attack.t1005_telem import T1005Telem - GATHERED_DATA_TYPE = "[Type of data collected]" INFO = "[Additional info]" STATUS = ScanStatus.USED diff --git a/monkey/infection_monkey/telemetry/tests/attack/test_t1035_telem.py b/monkey/infection_monkey/telemetry/tests/attack/test_t1035_telem.py index 6313278ff..f927e7b91 100644 --- a/monkey/infection_monkey/telemetry/tests/attack/test_t1035_telem.py +++ b/monkey/infection_monkey/telemetry/tests/attack/test_t1035_telem.py @@ -5,7 +5,6 @@ import pytest from common.utils.attack_utils import ScanStatus, UsageEnum from infection_monkey.telemetry.attack.t1035_telem import T1035Telem - STATUS = ScanStatus.USED USAGE = UsageEnum.SMB diff --git a/monkey/infection_monkey/telemetry/tests/attack/test_t1064_telem.py b/monkey/infection_monkey/telemetry/tests/attack/test_t1064_telem.py index 08031316b..1d242d4ef 100644 --- a/monkey/infection_monkey/telemetry/tests/attack/test_t1064_telem.py +++ b/monkey/infection_monkey/telemetry/tests/attack/test_t1064_telem.py @@ -5,7 +5,6 @@ import pytest from common.utils.attack_utils import ScanStatus from infection_monkey.telemetry.attack.t1064_telem import T1064Telem - STATUS = ScanStatus.USED USAGE_STR = "[Usage info]" diff --git a/monkey/infection_monkey/telemetry/tests/attack/test_t1105_telem.py b/monkey/infection_monkey/telemetry/tests/attack/test_t1105_telem.py index 4c3947141..690c4508c 100644 --- a/monkey/infection_monkey/telemetry/tests/attack/test_t1105_telem.py +++ b/monkey/infection_monkey/telemetry/tests/attack/test_t1105_telem.py @@ -5,7 +5,6 @@ import pytest from common.utils.attack_utils import ScanStatus from infection_monkey.telemetry.attack.t1105_telem import T1105Telem - DST_IP = "0.0.0.1" FILENAME = "virus.exe" SRC_IP = "0.0.0.0" diff --git a/monkey/infection_monkey/telemetry/tests/attack/test_t1106_telem.py b/monkey/infection_monkey/telemetry/tests/attack/test_t1106_telem.py index db537cc51..2857bbc11 100644 --- a/monkey/infection_monkey/telemetry/tests/attack/test_t1106_telem.py +++ b/monkey/infection_monkey/telemetry/tests/attack/test_t1106_telem.py @@ -5,7 +5,6 @@ import pytest from common.utils.attack_utils import ScanStatus, UsageEnum from infection_monkey.telemetry.attack.t1106_telem import T1106Telem - STATUS = ScanStatus.USED USAGE = UsageEnum.SMB diff --git a/monkey/infection_monkey/telemetry/tests/attack/test_t1107_telem.py b/monkey/infection_monkey/telemetry/tests/attack/test_t1107_telem.py index 993040244..bb1bf2088 100644 --- a/monkey/infection_monkey/telemetry/tests/attack/test_t1107_telem.py +++ b/monkey/infection_monkey/telemetry/tests/attack/test_t1107_telem.py @@ -5,7 +5,6 @@ import pytest from common.utils.attack_utils import ScanStatus from infection_monkey.telemetry.attack.t1107_telem import T1107Telem - PATH = "path/to/file.txt" STATUS = ScanStatus.USED diff --git a/monkey/infection_monkey/telemetry/tests/attack/test_t1129_telem.py b/monkey/infection_monkey/telemetry/tests/attack/test_t1129_telem.py index fa619f148..41178a749 100644 --- a/monkey/infection_monkey/telemetry/tests/attack/test_t1129_telem.py +++ b/monkey/infection_monkey/telemetry/tests/attack/test_t1129_telem.py @@ -5,7 +5,6 @@ import pytest from common.utils.attack_utils import ScanStatus, UsageEnum from infection_monkey.telemetry.attack.t1129_telem import T1129Telem - STATUS = ScanStatus.USED USAGE = UsageEnum.SMB diff --git a/monkey/infection_monkey/telemetry/tests/attack/test_t1197_telem.py b/monkey/infection_monkey/telemetry/tests/attack/test_t1197_telem.py index c5aa8874a..a7556e952 100644 --- a/monkey/infection_monkey/telemetry/tests/attack/test_t1197_telem.py +++ b/monkey/infection_monkey/telemetry/tests/attack/test_t1197_telem.py @@ -6,7 +6,6 @@ from common.utils.attack_utils import ScanStatus from infection_monkey.model import VictimHost from infection_monkey.telemetry.attack.t1197_telem import T1197Telem - DOMAIN_NAME = "domain-name" IP = "127.0.0.1" MACHINE = VictimHost(IP, DOMAIN_NAME) diff --git a/monkey/infection_monkey/telemetry/tests/attack/test_t1222_telem.py b/monkey/infection_monkey/telemetry/tests/attack/test_t1222_telem.py index d3aeaddd6..1b78bef5b 100644 --- a/monkey/infection_monkey/telemetry/tests/attack/test_t1222_telem.py +++ b/monkey/infection_monkey/telemetry/tests/attack/test_t1222_telem.py @@ -6,7 +6,6 @@ from common.utils.attack_utils import ScanStatus from infection_monkey.model import VictimHost from infection_monkey.telemetry.attack.t1222_telem import T1222Telem - COMMAND = "echo hi" DOMAIN_NAME = "domain-name" IP = "127.0.0.1" diff --git a/monkey/infection_monkey/telemetry/tests/attack/test_usage_telem.py b/monkey/infection_monkey/telemetry/tests/attack/test_usage_telem.py index 983c1961d..511cc51b8 100644 --- a/monkey/infection_monkey/telemetry/tests/attack/test_usage_telem.py +++ b/monkey/infection_monkey/telemetry/tests/attack/test_usage_telem.py @@ -5,7 +5,6 @@ import pytest from common.utils.attack_utils import ScanStatus, UsageEnum from infection_monkey.telemetry.attack.usage_telem import UsageTelem - STATUS = ScanStatus.USED TECHNIQUE = "T9999" USAGE = UsageEnum.SMB diff --git a/monkey/infection_monkey/telemetry/tests/attack/test_victim_host_telem.py b/monkey/infection_monkey/telemetry/tests/attack/test_victim_host_telem.py index f519b8153..a3853e78c 100644 --- a/monkey/infection_monkey/telemetry/tests/attack/test_victim_host_telem.py +++ b/monkey/infection_monkey/telemetry/tests/attack/test_victim_host_telem.py @@ -6,7 +6,6 @@ from common.utils.attack_utils import ScanStatus from infection_monkey.model import VictimHost from infection_monkey.telemetry.attack.victim_host_telem import VictimHostTelem - DOMAIN_NAME = "domain-name" IP = "127.0.0.1" MACHINE = VictimHost(IP, DOMAIN_NAME) diff --git a/monkey/infection_monkey/telemetry/tests/test_exploit_telem.py b/monkey/infection_monkey/telemetry/tests/test_exploit_telem.py index 56d39fe06..95f853922 100644 --- a/monkey/infection_monkey/telemetry/tests/test_exploit_telem.py +++ b/monkey/infection_monkey/telemetry/tests/test_exploit_telem.py @@ -6,7 +6,6 @@ from infection_monkey.exploit.wmiexec import WmiExploiter from infection_monkey.model.host import VictimHost from infection_monkey.telemetry.exploit_telem import ExploitTelem - DOMAIN_NAME = "domain-name" IP = "0.0.0.0" HOST = VictimHost(IP, DOMAIN_NAME) diff --git a/monkey/infection_monkey/telemetry/tests/test_post_breach_telem.py b/monkey/infection_monkey/telemetry/tests/test_post_breach_telem.py index 4aaaedb08..d6ce48825 100644 --- a/monkey/infection_monkey/telemetry/tests/test_post_breach_telem.py +++ b/monkey/infection_monkey/telemetry/tests/test_post_breach_telem.py @@ -4,7 +4,6 @@ import pytest from infection_monkey.telemetry.post_breach_telem import PostBreachTelem - HOSTNAME = "hostname" IP = "0.0.0.0" PBA_COMMAND = "run some pba" diff --git a/monkey/infection_monkey/telemetry/tests/test_scan_telem.py b/monkey/infection_monkey/telemetry/tests/test_scan_telem.py index 017a7d062..07c6fbf41 100644 --- a/monkey/infection_monkey/telemetry/tests/test_scan_telem.py +++ b/monkey/infection_monkey/telemetry/tests/test_scan_telem.py @@ -2,9 +2,8 @@ import json import pytest -from infection_monkey.telemetry.scan_telem import ScanTelem from infection_monkey.model.host import VictimHost - +from infection_monkey.telemetry.scan_telem import ScanTelem DOMAIN_NAME = "domain-name" IP = "0.0.0.0" diff --git a/monkey/infection_monkey/telemetry/tests/test_state_telem.py b/monkey/infection_monkey/telemetry/tests/test_state_telem.py index fe7bb3293..18776f987 100644 --- a/monkey/infection_monkey/telemetry/tests/test_state_telem.py +++ b/monkey/infection_monkey/telemetry/tests/test_state_telem.py @@ -4,7 +4,6 @@ import pytest from infection_monkey.telemetry.state_telem import StateTelem - IS_DONE = True VERSION = "version" diff --git a/monkey/infection_monkey/telemetry/tests/test_system_info_telem.py b/monkey/infection_monkey/telemetry/tests/test_system_info_telem.py index 0caba8967..146919899 100644 --- a/monkey/infection_monkey/telemetry/tests/test_system_info_telem.py +++ b/monkey/infection_monkey/telemetry/tests/test_system_info_telem.py @@ -4,7 +4,6 @@ import pytest from infection_monkey.telemetry.system_info_telem import SystemInfoTelem - SYSTEM_INFO = {} diff --git a/monkey/infection_monkey/telemetry/tests/test_trace_telem.py b/monkey/infection_monkey/telemetry/tests/test_trace_telem.py index 567750e96..0c4027a05 100644 --- a/monkey/infection_monkey/telemetry/tests/test_trace_telem.py +++ b/monkey/infection_monkey/telemetry/tests/test_trace_telem.py @@ -4,7 +4,6 @@ import pytest from infection_monkey.telemetry.trace_telem import TraceTelem - MSG = "message" diff --git a/monkey/monkey_island.py b/monkey/monkey_island.py index 88e41b6e2..d32019b6a 100644 --- a/monkey/monkey_island.py +++ b/monkey/monkey_island.py @@ -8,7 +8,6 @@ import json # noqa: E402 from monkey_island.cc.server_utils.island_logger import json_setup_logging # noqa: E402 - if "__main__" == __name__: island_args = parse_cli_args() diff --git a/monkey/monkey_island/cc/app.py b/monkey/monkey_island/cc/app.py index 846a8663d..b06494c21 100644 --- a/monkey/monkey_island/cc/app.py +++ b/monkey/monkey_island/cc/app.py @@ -7,10 +7,6 @@ from werkzeug.exceptions import NotFound import monkey_island.cc.environment.environment_singleton as env_singleton from common.common_consts.api_url_consts import T1216_PBA_FILE_DOWNLOAD_PATH -from monkey_island.cc.resources.test.telemetry_test import TelemetryTest -from monkey_island.cc.resources.zero_trust.zero_trust_report import ZeroTrustReport -from monkey_island.cc.server_utils.consts import MONKEY_ISLAND_ABS_PATH -from monkey_island.cc.server_utils.custom_json_encoder import CustomJSONEncoder from monkey_island.cc.database import database, mongo from monkey_island.cc.resources.attack.attack_config import AttackConfiguration from monkey_island.cc.resources.attack.attack_report import AttackReport @@ -35,18 +31,22 @@ from monkey_island.cc.resources.node_states import NodeStates from monkey_island.cc.resources.pba_file_download import PBAFileDownload from monkey_island.cc.resources.pba_file_upload import FileUpload from monkey_island.cc.resources.remote_run import RemoteRun -from monkey_island.cc.resources.security_report import SecurityReport from monkey_island.cc.resources.root import Root +from monkey_island.cc.resources.security_report import SecurityReport from monkey_island.cc.resources.T1216_pba_file_download import T1216PBAFileDownload from monkey_island.cc.resources.telemetry import Telemetry from monkey_island.cc.resources.telemetry_feed import TelemetryFeed from monkey_island.cc.resources.test.clear_caches import ClearCaches from monkey_island.cc.resources.test.log_test import LogTest from monkey_island.cc.resources.test.monkey_test import MonkeyTest +from monkey_island.cc.resources.test.telemetry_test import TelemetryTest from monkey_island.cc.resources.version_update import VersionUpdate from monkey_island.cc.resources.zero_trust.finding_event import ZeroTrustFindingEvent from monkey_island.cc.resources.zero_trust.scoutsuite_auth.aws_keys import AWSKeys from monkey_island.cc.resources.zero_trust.scoutsuite_auth.scoutsuite_auth import ScoutSuiteAuth +from monkey_island.cc.resources.zero_trust.zero_trust_report import ZeroTrustReport +from monkey_island.cc.server_utils.consts import MONKEY_ISLAND_ABS_PATH +from monkey_island.cc.server_utils.custom_json_encoder import CustomJSONEncoder from monkey_island.cc.services.database import Database from monkey_island.cc.services.remote_run_aws import RemoteRunAwsService from monkey_island.cc.services.representations import output_json diff --git a/monkey/monkey_island/cc/arg_parser.py b/monkey/monkey_island/cc/arg_parser.py index 73b145dd4..91a2b7d25 100644 --- a/monkey/monkey_island/cc/arg_parser.py +++ b/monkey/monkey_island/cc/arg_parser.py @@ -1,8 +1,8 @@ from dataclasses import dataclass from monkey_island.cc.server_utils.consts import ( - DEFAULT_SERVER_CONFIG_PATH, DEFAULT_LOGGER_CONFIG_PATH, + DEFAULT_SERVER_CONFIG_PATH, ) diff --git a/monkey/monkey_island/cc/environment/environment_config.py b/monkey/monkey_island/cc/environment/environment_config.py index 731ecfe34..70d27e546 100644 --- a/monkey/monkey_island/cc/environment/environment_config.py +++ b/monkey/monkey_island/cc/environment/environment_config.py @@ -6,10 +6,10 @@ from pathlib import Path from typing import Dict, List import monkey_island.cc.environment.server_config_generator as server_config_generator -from monkey_island.cc.server_utils.consts import DEFAULT_DATA_DIR from monkey_island.cc.environment.user_creds import UserCreds from monkey_island.cc.resources.auth.auth_user import User from monkey_island.cc.resources.auth.user_store import UserStore +from monkey_island.cc.server_utils.consts import DEFAULT_DATA_DIR class EnvironmentConfig: diff --git a/monkey/monkey_island/cc/environment/test__init__.py b/monkey/monkey_island/cc/environment/test__init__.py index aea1263c2..dbf98eefe 100644 --- a/monkey/monkey_island/cc/environment/test__init__.py +++ b/monkey/monkey_island/cc/environment/test__init__.py @@ -4,7 +4,6 @@ from typing import Dict from unittest import TestCase from unittest.mock import MagicMock, patch -from monkey_island.cc.server_utils.consts import MONKEY_ISLAND_ABS_PATH from common.utils.exceptions import ( AlreadyRegisteredError, CredentialsNotRequiredError, @@ -12,6 +11,7 @@ from common.utils.exceptions import ( RegistrationNotNeededError, ) from monkey_island.cc.environment import Environment, EnvironmentConfig, UserCreds +from monkey_island.cc.server_utils.consts import MONKEY_ISLAND_ABS_PATH TEST_RESOURCES_DIR = os.path.join(MONKEY_ISLAND_ABS_PATH, "cc", "testing", "environment") diff --git a/monkey/monkey_island/cc/environment/test_environment_config.py b/monkey/monkey_island/cc/environment/test_environment_config.py index d2ac052c7..9bf6bfc2b 100644 --- a/monkey/monkey_island/cc/environment/test_environment_config.py +++ b/monkey/monkey_island/cc/environment/test_environment_config.py @@ -4,10 +4,9 @@ import shutil import pytest -from monkey_island.cc.server_utils.consts import DEFAULT_DATA_DIR, MONKEY_ISLAND_ABS_PATH from monkey_island.cc.environment.environment_config import EnvironmentConfig from monkey_island.cc.environment.user_creds import UserCreds - +from monkey_island.cc.server_utils.consts import DEFAULT_DATA_DIR, MONKEY_ISLAND_ABS_PATH TEST_RESOURCES_DIR = os.path.join(MONKEY_ISLAND_ABS_PATH, "cc", "testing", "environment") diff --git a/monkey/monkey_island/cc/main.py b/monkey/monkey_island/cc/main.py index bc7b8e283..75d105f70 100644 --- a/monkey/monkey_island/cc/main.py +++ b/monkey/monkey_island/cc/main.py @@ -17,16 +17,16 @@ from monkey_island.cc.server_utils.consts import MONKEY_ISLAND_ABS_PATH # noqa: logger = logging.getLogger(__name__) import monkey_island.cc.environment.environment_singleton as env_singleton # noqa: E402 -from monkey_island.cc.server_utils.consts import DEFAULT_SERVER_CONFIG_PATH # noqa: E402 from common.version import get_version # noqa: E402 from monkey_island.cc.app import init_app # noqa: E402 -from monkey_island.cc.server_utils.bootloader_server import BootloaderHttpServer # noqa: E402 from monkey_island.cc.database import get_db_version # noqa: E402 from monkey_island.cc.database import is_db_server_up # noqa: E402 -from monkey_island.cc.server_utils.encryptor import initialize_encryptor # noqa: E402 -from monkey_island.cc.services.utils.network_utils import local_ip_addresses # noqa: E402 from monkey_island.cc.resources.monkey_download import MonkeyDownload # noqa: E402 +from monkey_island.cc.server_utils.bootloader_server import BootloaderHttpServer # noqa: E402 +from monkey_island.cc.server_utils.consts import DEFAULT_SERVER_CONFIG_PATH # noqa: E402 +from monkey_island.cc.server_utils.encryptor import initialize_encryptor # noqa: E402 from monkey_island.cc.services.reporting.exporter_init import populate_exporter_list # noqa: E402 +from monkey_island.cc.services.utils.network_utils import local_ip_addresses # noqa: E402 from monkey_island.cc.setup import setup # noqa: E402 MINIMUM_MONGO_DB_VERSION_REQUIRED = "4.2.0" diff --git a/monkey/monkey_island/cc/models/monkey.py b/monkey/monkey_island/cc/models/monkey.py index c375a3858..90255099e 100644 --- a/monkey/monkey_island/cc/models/monkey.py +++ b/monkey/monkey_island/cc/models/monkey.py @@ -15,9 +15,9 @@ from mongoengine import ( ) from common.cloud import environment_names -from monkey_island.cc.server_utils.consts import DEFAULT_MONKEY_TTL_EXPIRY_DURATION_IN_SECONDS from monkey_island.cc.models.command_control_channel import CommandControlChannel from monkey_island.cc.models.monkey_ttl import MonkeyTtl, create_monkey_ttl_document +from monkey_island.cc.server_utils.consts import DEFAULT_MONKEY_TTL_EXPIRY_DURATION_IN_SECONDS from monkey_island.cc.services.utils.network_utils import local_ip_addresses MAX_MONKEYS_AMOUNT_TO_CACHE = 100 diff --git a/monkey/monkey_island/cc/models/test_monkey.py b/monkey/monkey_island/cc/models/test_monkey.py index 404078c27..d21776f6f 100644 --- a/monkey/monkey_island/cc/models/test_monkey.py +++ b/monkey/monkey_island/cc/models/test_monkey.py @@ -6,8 +6,8 @@ import pytest from monkey_island.cc.models.monkey import Monkey, MonkeyNotFoundError -from .monkey_ttl import MonkeyTtl from ..test_common.fixtures import FixtureEnum +from .monkey_ttl import MonkeyTtl logger = logging.getLogger(__name__) diff --git a/monkey/monkey_island/cc/resources/local_run.py b/monkey/monkey_island/cc/resources/local_run.py index 021df512a..727357ab3 100644 --- a/monkey/monkey_island/cc/resources/local_run.py +++ b/monkey/monkey_island/cc/resources/local_run.py @@ -8,12 +8,12 @@ import flask_restful from flask import jsonify, make_response, request import monkey_island.cc.environment.environment_singleton as env_singleton -from monkey_island.cc.server_utils.consts import MONKEY_ISLAND_ABS_PATH from monkey_island.cc.models import Monkey -from monkey_island.cc.services.utils.network_utils import local_ip_addresses from monkey_island.cc.resources.auth.auth import jwt_required from monkey_island.cc.resources.monkey_download import get_monkey_executable +from monkey_island.cc.server_utils.consts import MONKEY_ISLAND_ABS_PATH from monkey_island.cc.services.node import NodeService +from monkey_island.cc.services.utils.network_utils import local_ip_addresses __author__ = "Barak" diff --git a/monkey/monkey_island/cc/resources/monkey.py b/monkey/monkey_island/cc/resources/monkey.py index 9f5c9670b..66dbd881a 100644 --- a/monkey/monkey_island/cc/resources/monkey.py +++ b/monkey/monkey_island/cc/resources/monkey.py @@ -5,10 +5,10 @@ import dateutil.parser import flask_restful from flask import request -from monkey_island.cc.server_utils.consts import DEFAULT_MONKEY_TTL_EXPIRY_DURATION_IN_SECONDS from monkey_island.cc.database import mongo from monkey_island.cc.models.monkey_ttl import create_monkey_ttl_document from monkey_island.cc.resources.test.utils.telem_store import TestTelemStore +from monkey_island.cc.server_utils.consts import DEFAULT_MONKEY_TTL_EXPIRY_DURATION_IN_SECONDS from monkey_island.cc.services.config import ConfigService from monkey_island.cc.services.edge.edge import EdgeService from monkey_island.cc.services.node import NodeService diff --git a/monkey/monkey_island/cc/resources/root.py b/monkey/monkey_island/cc/resources/root.py index b7fc53d60..57d20904a 100644 --- a/monkey/monkey_island/cc/resources/root.py +++ b/monkey/monkey_island/cc/resources/root.py @@ -5,10 +5,10 @@ import flask_restful from flask import jsonify, make_response, request from monkey_island.cc.database import mongo -from monkey_island.cc.services.utils.network_utils import local_ip_addresses from monkey_island.cc.resources.auth.auth import jwt_required from monkey_island.cc.services.database import Database from monkey_island.cc.services.infection_lifecycle import InfectionLifecycle +from monkey_island.cc.services.utils.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 5978431d6..d6fe0a3cb 100644 --- a/monkey/monkey_island/cc/services/config.py +++ b/monkey/monkey_island/cc/services/config.py @@ -9,8 +9,8 @@ import monkey_island.cc.environment.environment_singleton as env_singleton import monkey_island.cc.services.post_breach_files from monkey_island.cc.database import mongo from monkey_island.cc.server_utils.encryptor import get_encryptor -from monkey_island.cc.services.utils.network_utils import local_ip_addresses from monkey_island.cc.services.config_schema.config_schema import SCHEMA +from monkey_island.cc.services.utils.network_utils import local_ip_addresses __author__ = "itay.mizeretz" diff --git a/monkey/monkey_island/cc/services/configuration/utils.py b/monkey/monkey_island/cc/services/configuration/utils.py index 493d5af03..8d2b5c18c 100644 --- a/monkey/monkey_island/cc/services/configuration/utils.py +++ b/monkey/monkey_island/cc/services/configuration/utils.py @@ -1,5 +1,5 @@ -from monkey_island.cc.services.config import ConfigService from common.config_value_paths import INACCESSIBLE_SUBNETS_PATH +from monkey_island.cc.services.config import ConfigService def get_config_network_segments_as_subnet_groups(): diff --git a/monkey/monkey_island/cc/services/node.py b/monkey/monkey_island/cc/services/node.py index 5bfb60776..2c1fe731a 100644 --- a/monkey/monkey_island/cc/services/node.py +++ b/monkey/monkey_island/cc/services/node.py @@ -8,9 +8,9 @@ import monkey_island.cc.services.log from monkey_island.cc import models from monkey_island.cc.database import mongo from monkey_island.cc.models import Monkey -from monkey_island.cc.services.utils.network_utils import is_local_ips, local_ip_addresses from monkey_island.cc.services.edge.displayed_edge import DisplayedEdgeService from monkey_island.cc.services.edge.edge import EdgeService +from monkey_island.cc.services.utils.network_utils import is_local_ips, local_ip_addresses from monkey_island.cc.services.utils.node_states import NodeStates __author__ = "itay.mizeretz" diff --git a/monkey/monkey_island/cc/services/reporting/issue_processing/exploit_processing/exploiter_descriptor_enum.py b/monkey/monkey_island/cc/services/reporting/issue_processing/exploit_processing/exploiter_descriptor_enum.py index f519100ed..d930b4b24 100644 --- a/monkey/monkey_island/cc/services/reporting/issue_processing/exploit_processing/exploiter_descriptor_enum.py +++ b/monkey/monkey_island/cc/services/reporting/issue_processing/exploit_processing/exploiter_descriptor_enum.py @@ -1,6 +1,6 @@ from dataclasses import dataclass from enum import Enum -from typing import Type, Dict +from typing import Dict, Type from monkey_island.cc.services.reporting.issue_processing.exploit_processing.processors.cred_exploit import ( CredExploitProcessor, diff --git a/monkey/monkey_island/cc/services/reporting/issue_processing/exploit_processing/exploiter_report_info.py b/monkey/monkey_island/cc/services/reporting/issue_processing/exploit_processing/exploiter_report_info.py index c7a4bd1d0..087ee6a39 100644 --- a/monkey/monkey_island/cc/services/reporting/issue_processing/exploit_processing/exploiter_report_info.py +++ b/monkey/monkey_island/cc/services/reporting/issue_processing/exploit_processing/exploiter_report_info.py @@ -1,6 +1,6 @@ from dataclasses import dataclass from enum import Enum -from typing import Union, List +from typing import List, Union class CredentialType(Enum): diff --git a/monkey/monkey_island/cc/services/reporting/issue_processing/exploit_processing/processors/cred_exploit.py b/monkey/monkey_island/cc/services/reporting/issue_processing/exploit_processing/processors/cred_exploit.py index 7ccce8e00..842fe9eb2 100644 --- a/monkey/monkey_island/cc/services/reporting/issue_processing/exploit_processing/processors/cred_exploit.py +++ b/monkey/monkey_island/cc/services/reporting/issue_processing/exploit_processing/processors/cred_exploit.py @@ -1,6 +1,6 @@ from monkey_island.cc.services.reporting.issue_processing.exploit_processing.exploiter_report_info import ( - ExploiterReportInfo, CredentialType, + ExploiterReportInfo, ) from monkey_island.cc.services.reporting.issue_processing.exploit_processing.processors.exploit import ( ExploitProcessor, diff --git a/monkey/monkey_island/cc/services/reporting/issue_processing/exploit_processing/processors/zerologon.py b/monkey/monkey_island/cc/services/reporting/issue_processing/exploit_processing/processors/zerologon.py index 09bbce0d6..d9c9d7d49 100644 --- a/monkey/monkey_island/cc/services/reporting/issue_processing/exploit_processing/processors/zerologon.py +++ b/monkey/monkey_island/cc/services/reporting/issue_processing/exploit_processing/processors/zerologon.py @@ -1,6 +1,6 @@ from monkey_island.cc.services.reporting.issue_processing.exploit_processing.processors.exploit import ( - ExploitProcessor, ExploiterReportInfo, + ExploitProcessor, ) diff --git a/monkey/monkey_island/cc/services/reporting/report.py b/monkey/monkey_island/cc/services/reporting/report.py index 5bbb64f39..87a99a2ad 100644 --- a/monkey/monkey_island/cc/services/reporting/report.py +++ b/monkey/monkey_island/cc/services/reporting/report.py @@ -6,12 +6,6 @@ from typing import List from bson import json_util -from common.network.network_range import NetworkRange -from common.network.segmentation_utils import get_ip_in_src_and_not_in_dst -from monkey_island.cc.database import mongo -from monkey_island.cc.models import Monkey -from monkey_island.cc.services.utils.network_utils import get_subnets, local_ip_addresses -from monkey_island.cc.services.config import ConfigService from common.config_value_paths import ( EXPLOITER_CLASSES_PATH, LOCAL_NETWORK_SCAN_PATH, @@ -19,6 +13,11 @@ from common.config_value_paths import ( SUBNET_SCAN_LIST_PATH, USER_LIST_PATH, ) +from common.network.network_range import NetworkRange +from common.network.segmentation_utils import get_ip_in_src_and_not_in_dst +from monkey_island.cc.database import mongo +from monkey_island.cc.models import Monkey +from monkey_island.cc.services.config import ConfigService from monkey_island.cc.services.configuration.utils import ( get_config_network_segments_as_subnet_groups, ) @@ -37,6 +36,7 @@ from monkey_island.cc.services.reporting.report_exporter_manager import ReportEx from monkey_island.cc.services.reporting.report_generation_synchronisation import ( safe_generate_regular_report, ) +from monkey_island.cc.services.utils.network_utils import get_subnets, local_ip_addresses __author__ = "itay.mizeretz" diff --git a/monkey/monkey_island/cc/services/telemetry/processing/exploit.py b/monkey/monkey_island/cc/services/telemetry/processing/exploit.py index acd8f261b..6eb759b21 100644 --- a/monkey/monkey_island/cc/services/telemetry/processing/exploit.py +++ b/monkey/monkey_island/cc/services/telemetry/processing/exploit.py @@ -2,8 +2,8 @@ import copy import dateutil -from monkey_island.cc.server_utils.encryptor import get_encryptor from monkey_island.cc.models import Monkey +from monkey_island.cc.server_utils.encryptor import get_encryptor from monkey_island.cc.services.config import ConfigService from monkey_island.cc.services.edge.displayed_edge import EdgeService from monkey_island.cc.services.node import NodeService diff --git a/monkey/monkey_island/cc/services/zero_trust/monkey_findings/monkey_zt_details_service.py b/monkey/monkey_island/cc/services/zero_trust/monkey_findings/monkey_zt_details_service.py index 7870b97bd..8b4c7d97e 100644 --- a/monkey/monkey_island/cc/services/zero_trust/monkey_findings/monkey_zt_details_service.py +++ b/monkey/monkey_island/cc/services/zero_trust/monkey_findings/monkey_zt_details_service.py @@ -5,7 +5,6 @@ from bson import ObjectId from common.utils.exceptions import FindingWithoutDetailsError from monkey_island.cc.models.zero_trust.monkey_finding_details import MonkeyFindingDetails - # How many events of a single finding to return to UI. # 100 will return 50 latest and 50 oldest events from a finding MAX_EVENT_FETCH_CNT = 100 diff --git a/monkey/monkey_island/cc/services/zero_trust/scoutsuite/consts/scoutsuite_findings_list.py b/monkey/monkey_island/cc/services/zero_trust/scoutsuite/consts/scoutsuite_findings_list.py index e66c47782..65f85aa9d 100644 --- a/monkey/monkey_island/cc/services/zero_trust/scoutsuite/consts/scoutsuite_findings_list.py +++ b/monkey/monkey_island/cc/services/zero_trust/scoutsuite/consts/scoutsuite_findings_list.py @@ -1,11 +1,11 @@ from monkey_island.cc.services.zero_trust.scoutsuite.consts.scoutsuite_finding_maps import ( + DataLossPrevention, + Logging, + PermissiveFirewallRules, RestrictivePolicies, SecureAuthentication, - DataLossPrevention, - UnencryptedData, - PermissiveFirewallRules, ServiceSecurity, - Logging, + UnencryptedData, ) SCOUTSUITE_FINDINGS = [ diff --git a/monkey/monkey_island/cc/services/zero_trust/scoutsuite/scoutsuite_auth_service.py b/monkey/monkey_island/cc/services/zero_trust/scoutsuite/scoutsuite_auth_service.py index 05bcebd03..36eae6271 100644 --- a/monkey/monkey_island/cc/services/zero_trust/scoutsuite/scoutsuite_auth_service.py +++ b/monkey/monkey_island/cc/services/zero_trust/scoutsuite/scoutsuite_auth_service.py @@ -3,10 +3,10 @@ from typing import Tuple from ScoutSuite.providers.base.authentication_strategy import AuthenticationException from common.cloud.scoutsuite_consts import CloudProviders +from common.config_value_paths import AWS_KEYS_PATH from common.utils.exceptions import InvalidAWSKeys from monkey_island.cc.server_utils.encryptor import get_encryptor from monkey_island.cc.services.config import ConfigService -from common.config_value_paths import AWS_KEYS_PATH def is_cloud_authentication_setup(provider: CloudProviders) -> Tuple[bool, str]: diff --git a/monkey/monkey_island/cc/services/zero_trust/scoutsuite/test_scoutsuite_auth_service.py b/monkey/monkey_island/cc/services/zero_trust/scoutsuite/test_scoutsuite_auth_service.py index 5ffe194a4..00eae32e7 100644 --- a/monkey/monkey_island/cc/services/zero_trust/scoutsuite/test_scoutsuite_auth_service.py +++ b/monkey/monkey_island/cc/services/zero_trust/scoutsuite/test_scoutsuite_auth_service.py @@ -1,12 +1,12 @@ from unittest.mock import MagicMock -import pytest import dpath.util +import pytest -from monkey_island.cc.database import mongo -from monkey_island.cc.server_utils.encryptor import initialize_encryptor, get_encryptor -from monkey_island.cc.services.config import ConfigService from common.config_value_paths import AWS_KEYS_PATH +from monkey_island.cc.database import mongo +from monkey_island.cc.server_utils.encryptor import get_encryptor, initialize_encryptor +from monkey_island.cc.services.config import ConfigService from monkey_island.cc.services.zero_trust.scoutsuite.scoutsuite_auth_service import ( is_aws_keys_setup, ) diff --git a/monkey/monkey_island/cc/services/zero_trust/scoutsuite/test_scoutsuite_rule_service.py b/monkey/monkey_island/cc/services/zero_trust/scoutsuite/test_scoutsuite_rule_service.py index 32491b2c5..04e085eb1 100644 --- a/monkey/monkey_island/cc/services/zero_trust/scoutsuite/test_scoutsuite_rule_service.py +++ b/monkey/monkey_island/cc/services/zero_trust/scoutsuite/test_scoutsuite_rule_service.py @@ -1,8 +1,8 @@ from copy import deepcopy from monkey_island.cc.services.zero_trust.scoutsuite.consts.rule_consts import ( - RULE_LEVEL_WARNING, RULE_LEVEL_DANGER, + RULE_LEVEL_WARNING, ) from monkey_island.cc.services.zero_trust.scoutsuite.scoutsuite_rule_service import ( ScoutSuiteRuleService, diff --git a/monkey/monkey_island/cc/services/zero_trust/test_common/finding_data.py b/monkey/monkey_island/cc/services/zero_trust/test_common/finding_data.py index 5582bb83d..36a8761cb 100644 --- a/monkey/monkey_island/cc/services/zero_trust/test_common/finding_data.py +++ b/monkey/monkey_island/cc/services/zero_trust/test_common/finding_data.py @@ -1,8 +1,8 @@ from common.common_consts.zero_trust_consts import ( - TEST_SCOUTSUITE_SERVICE_SECURITY, STATUS_FAILED, - TEST_ENDPOINT_SECURITY_EXISTS, STATUS_PASSED, + TEST_ENDPOINT_SECURITY_EXISTS, + TEST_SCOUTSUITE_SERVICE_SECURITY, ) from monkey_island.cc.models.zero_trust.finding import Finding from monkey_island.cc.models.zero_trust.monkey_finding import MonkeyFinding diff --git a/monkey/monkey_island/cc/services/zero_trust/zero_trust_report/test_finding_service.py b/monkey/monkey_island/cc/services/zero_trust/zero_trust_report/test_finding_service.py index 67bdbc308..37d432bf4 100644 --- a/monkey/monkey_island/cc/services/zero_trust/zero_trust_report/test_finding_service.py +++ b/monkey/monkey_island/cc/services/zero_trust/zero_trust_report/test_finding_service.py @@ -3,24 +3,24 @@ from unittest.mock import MagicMock import pytest from common.common_consts.zero_trust_consts import ( - TESTS_MAP, - TEST_SCOUTSUITE_SERVICE_SECURITY, - STATUS_FAILED, DEVICES, NETWORKS, + STATUS_FAILED, STATUS_PASSED, TEST_ENDPOINT_SECURITY_EXISTS, + TEST_SCOUTSUITE_SERVICE_SECURITY, + TESTS_MAP, ) from monkey_island.cc.services.zero_trust.monkey_findings.monkey_zt_details_service import ( MonkeyZTDetailsService, ) from monkey_island.cc.services.zero_trust.test_common.finding_data import ( - get_scoutsuite_finding_dto, get_monkey_finding_dto, + get_scoutsuite_finding_dto, ) from monkey_island.cc.services.zero_trust.zero_trust_report.finding_service import ( - FindingService, EnrichedFinding, + FindingService, ) from monkey_island.cc.test_common.fixtures.fixture_enum import FixtureEnum diff --git a/monkey/monkey_island/cc/services/zero_trust/zero_trust_report/test_pillar_service.py b/monkey/monkey_island/cc/services/zero_trust/zero_trust_report/test_pillar_service.py index 32dbaadc9..36691e00e 100644 --- a/monkey/monkey_island/cc/services/zero_trust/zero_trust_report/test_pillar_service.py +++ b/monkey/monkey_island/cc/services/zero_trust/zero_trust_report/test_pillar_service.py @@ -4,13 +4,13 @@ import pytest from common.common_consts import zero_trust_consts from common.common_consts.zero_trust_consts import ( - DATA, - PEOPLE, - NETWORKS, - WORKLOADS, - VISIBILITY_ANALYTICS, AUTOMATION_ORCHESTRATION, + DATA, DEVICES, + NETWORKS, + PEOPLE, + VISIBILITY_ANALYTICS, + WORKLOADS, ) from monkey_island.cc.services.zero_trust.zero_trust_report.pillar_service import PillarService from monkey_island.cc.services.zero_trust.zero_trust_report.test_common.example_finding_data import ( diff --git a/monkey/monkey_island/cc/services/zero_trust/zero_trust_report/test_principle_service.py b/monkey/monkey_island/cc/services/zero_trust/zero_trust_report/test_principle_service.py index 23d3cd08e..7eb6b19cd 100644 --- a/monkey/monkey_island/cc/services/zero_trust/zero_trust_report/test_principle_service.py +++ b/monkey/monkey_island/cc/services/zero_trust/zero_trust_report/test_principle_service.py @@ -10,7 +10,6 @@ from monkey_island.cc.services.zero_trust.zero_trust_report.principle_service im ) from monkey_island.cc.test_common.fixtures import FixtureEnum - EXPECTED_DICT = { "test_pillar1": [ { diff --git a/monkey/monkey_island/cc/test_consts.py b/monkey/monkey_island/cc/test_consts.py index 76a08a258..eebb7414f 100644 --- a/monkey/monkey_island/cc/test_consts.py +++ b/monkey/monkey_island/cc/test_consts.py @@ -1,4 +1,5 @@ import platform + import monkey_island.cc.server_utils.consts as consts diff --git a/monkey/monkey_island/cc/test_encryptor.py b/monkey/monkey_island/cc/test_encryptor.py index b2564b16c..7823c64ec 100644 --- a/monkey/monkey_island/cc/test_encryptor.py +++ b/monkey/monkey_island/cc/test_encryptor.py @@ -1,8 +1,7 @@ import os from monkey_island.cc.server_utils.consts import MONKEY_ISLAND_ABS_PATH -from monkey_island.cc.server_utils.encryptor import initialize_encryptor, get_encryptor - +from monkey_island.cc.server_utils.encryptor import get_encryptor, initialize_encryptor TEST_DATA_DIR = os.path.join(MONKEY_ISLAND_ABS_PATH, "cc", "testing") PASSWORD_FILENAME = "mongo_key.bin"