From 03037b566233864906e8bbcef49fc7e8bd83dd4b Mon Sep 17 00:00:00 2001 From: Shreya Malviya Date: Wed, 22 Jun 2022 08:28:57 -0700 Subject: [PATCH] Common: Remove `supported_os` field for exploiters in configuration --- .../agent_sub_configuration_schemas.py | 4 -- .../configuration/agent_sub_configurations.py | 3 -- .../default_agent_configuration.py | 44 ++++++------------- 3 files changed, 14 insertions(+), 37 deletions(-) diff --git a/monkey/common/configuration/agent_sub_configuration_schemas.py b/monkey/common/configuration/agent_sub_configuration_schemas.py index ceec0af24..4d2ee2d8e 100644 --- a/monkey/common/configuration/agent_sub_configuration_schemas.py +++ b/monkey/common/configuration/agent_sub_configuration_schemas.py @@ -1,7 +1,4 @@ from marshmallow import Schema, fields, post_load -from marshmallow_enum import EnumField - -from common import OperatingSystems from .agent_sub_configurations import ( CustomPBAConfiguration, @@ -87,7 +84,6 @@ class ExploitationOptionsConfigurationSchema(Schema): class ExploiterConfigurationSchema(Schema): name = fields.Str() options = fields.Mapping() - supported_os = fields.List(EnumField(OperatingSystems)) @post_load def _make_exploiter_configuration(self, data, **kwargs): diff --git a/monkey/common/configuration/agent_sub_configurations.py b/monkey/common/configuration/agent_sub_configurations.py index 560542e1d..c4a0c704c 100644 --- a/monkey/common/configuration/agent_sub_configurations.py +++ b/monkey/common/configuration/agent_sub_configurations.py @@ -1,8 +1,6 @@ from dataclasses import dataclass from typing import Dict, List -from common import OperatingSystems - @dataclass(frozen=True) class CustomPBAConfiguration: @@ -54,7 +52,6 @@ class ExploitationOptionsConfiguration: class ExploiterConfiguration: name: str options: Dict - supported_os: List[OperatingSystems] @dataclass(frozen=True) diff --git a/monkey/common/configuration/default_agent_configuration.py b/monkey/common/configuration/default_agent_configuration.py index 8c909f15d..c83169566 100644 --- a/monkey/common/configuration/default_agent_configuration.py +++ b/monkey/common/configuration/default_agent_configuration.py @@ -157,60 +157,44 @@ DEFAULT_AGENT_CONFIGURATION_JSON = """{ "brute_force": [ { "name": "MSSQLExploiter", - "options": {}, - "supported_os": [ - "WINDOWS" - ] + "options": {} + }, { "name": "PowerShellExploiter", - "options": {}, - "supported_os": [ - "WINDOWS" - ] + "options": {} + }, { "name": "SSHExploiter", - "options": {}, - "supported_os": [ - "LINUX" - ] + "options": {} + }, { "name": "SmbExploiter", "options": { "smb_download_timeout": 30 - }, - "supported_os": [ - "WINDOWS" - ] + } + }, { "name": "WmiExploiter", "options": { "smb_download_timeout": 30 - }, - "supported_os": [ - "WINDOWS" - ] + } + } ], "vulnerability": [ { "name": "HadoopExploiter", - "options": {}, - "supported_os": [ - "LINUX", - "WINDOWS" - ] + "options": {} + }, { "name": "Log4ShellExploiter", - "options": {}, - "supported_os": [ - "LINUX", - "WINDOWS" - ] + "options": {} + } ] }