From 4a872ea28bdd9f245382a29a56e50aa4647238b0 Mon Sep 17 00:00:00 2001 From: Jonathan Abrahamy Date: Wed, 20 Mar 2024 15:12:00 +0100 Subject: [PATCH] feat: Add sandbox machine type to SDK TKT-3138 --- intezer_sdk/__init__.py | 2 +- intezer_sdk/_api.py | 11 +++++------ intezer_sdk/analysis.py | 3 +-- intezer_sdk/api.py | 11 +++++------ intezer_sdk/consts.py | 5 ----- 5 files changed, 12 insertions(+), 20 deletions(-) diff --git a/intezer_sdk/__init__.py b/intezer_sdk/__init__.py index 70d557a..69532f3 100644 --- a/intezer_sdk/__init__.py +++ b/intezer_sdk/__init__.py @@ -1 +1 @@ -__version__ = '1.19.17' +__version__ = '1.19.18' diff --git a/intezer_sdk/_api.py b/intezer_sdk/_api.py index 4b7768d..84f4357 100644 --- a/intezer_sdk/_api.py +++ b/intezer_sdk/_api.py @@ -18,7 +18,6 @@ from intezer_sdk.api import raise_for_status from intezer_sdk.consts import IndexType from intezer_sdk.consts import OnPremiseVersion -from intezer_sdk.consts import SandboxMachineType class IntezerApi: @@ -34,7 +33,7 @@ def analyze_by_hash(self, disable_dynamic_unpacking: Optional[bool], disable_static_unpacking: Optional[bool], sandbox_command_line_arguments: str = None, - sandbox_machine_type: SandboxMachineType = None, + sandbox_machine_type: str = None, file_name: str = None, **additional_parameters) -> str: """ @@ -70,7 +69,7 @@ def analyze_by_download_url(self, code_item_type: str = None, zip_password: str = None, sandbox_command_line_arguments: str = None, - sandbox_machine_type: SandboxMachineType = None, + sandbox_machine_type: str = None, **additional_parameters) -> str: """ Analyze a file by its download URL. @@ -123,7 +122,7 @@ def analyze_by_file(self, code_item_type: str = None, zip_password: str = None, sandbox_command_line_arguments: str = None, - sandbox_machine_type: SandboxMachineType = None, + sandbox_machine_type: str = None, **additional_parameters) -> Optional[str]: """ Analyze a file by its path or stream. @@ -737,7 +736,7 @@ def _param_initialize(disable_dynamic_unpacking: bool, code_item_type: str = None, zip_password: str = None, sandbox_command_line_arguments: str = None, - sandbox_machine_type: SandboxMachineType = None, + sandbox_machine_type: str = None, **additional_parameters): data = {} @@ -752,7 +751,7 @@ def _param_initialize(disable_dynamic_unpacking: bool, if sandbox_command_line_arguments: data['sandbox_command_line_arguments'] = sandbox_command_line_arguments if sandbox_machine_type: - data['sandbox_machine_type'] = sandbox_machine_type.value + data['sandbox_machine_type'] = sandbox_machine_type data.update(additional_parameters) diff --git a/intezer_sdk/analysis.py b/intezer_sdk/analysis.py index 8a74c60..b0378fd 100644 --- a/intezer_sdk/analysis.py +++ b/intezer_sdk/analysis.py @@ -22,7 +22,6 @@ from intezer_sdk.api import IntezerApiClient from intezer_sdk.api import get_global_api from intezer_sdk.base_analysis import Analysis -from intezer_sdk.consts import SandboxMachineType from intezer_sdk.sub_analysis import SubAnalysis logger = logging.getLogger(__name__) @@ -52,7 +51,7 @@ def __init__(self, zip_password: str = None, download_url: str = None, sandbox_command_line_arguments: str = None, - sandbox_machine_type: SandboxMachineType = None): + sandbox_machine_type: str = None): """ FileAnalysis is a class for analyzing files. It is a subclass of the BaseAnalysis class and requires an API connection to Intezer. diff --git a/intezer_sdk/api.py b/intezer_sdk/api.py index bf90862..7cf19d1 100644 --- a/intezer_sdk/api.py +++ b/intezer_sdk/api.py @@ -20,7 +20,6 @@ from intezer_sdk._util import deprecated from intezer_sdk.consts import IndexType from intezer_sdk.consts import OnPremiseVersion -from intezer_sdk.consts import SandboxMachineType _global_api: Optional['IntezerApi'] = None @@ -264,7 +263,7 @@ def analyze_by_hash(self, disable_dynamic_unpacking: Optional[bool], disable_static_unpacking: Optional[bool], sandbox_command_line_arguments: str = None, - sandbox_machine_type: SandboxMachineType = None, + sandbox_machine_type: str = None, **additional_parameters) -> str: data = self._param_initialize(disable_dynamic_unpacking=disable_dynamic_unpacking, disable_static_unpacking=disable_static_unpacking, @@ -286,7 +285,7 @@ def analyze_by_download_url(self, code_item_type: str = None, zip_password: str = None, sandbox_command_line_arguments: str = None, - sandbox_machine_type: SandboxMachineType = None, + sandbox_machine_type: str = None, **additional_parameters) -> str: data = self._param_initialize(disable_dynamic_unpacking=disable_dynamic_unpacking, disable_static_unpacking=disable_static_unpacking, @@ -324,7 +323,7 @@ def analyze_by_file(self, code_item_type: str = None, zip_password: str = None, sandbox_command_line_arguments: str = None, - sandbox_machine_type: SandboxMachineType = None, + sandbox_machine_type: str = None, **additional_parameters) -> Optional[str]: options = self._param_initialize(disable_dynamic_unpacking=disable_dynamic_unpacking, disable_static_unpacking=disable_static_unpacking, @@ -662,7 +661,7 @@ def _param_initialize(disable_dynamic_unpacking: bool, code_item_type: str = None, zip_password: str = None, sandbox_command_line_arguments: str = None, - sandbox_machine_type: SandboxMachineType = None, + sandbox_machine_type: str = None, **additional_parameters): data = {} @@ -677,7 +676,7 @@ def _param_initialize(disable_dynamic_unpacking: bool, if sandbox_command_line_arguments: data['sandbox_command_line_arguments'] = sandbox_command_line_arguments if sandbox_machine_type: - data['sandbox_machine_type'] = sandbox_machine_type.value + data['sandbox_machine_type'] = sandbox_machine_type data.update(additional_parameters) diff --git a/intezer_sdk/consts.py b/intezer_sdk/consts.py index 844b008..01d1f4d 100644 --- a/intezer_sdk/consts.py +++ b/intezer_sdk/consts.py @@ -98,11 +98,6 @@ class OnPremiseVersion(enum.IntEnum): V23_10 = 23.10 -class SandboxMachineType(AutoName): - WIN7 = enum.auto() - WIN10 = enum.auto() - - ANALYZE_URL = 'https://analyze.intezer.com' BASE_URL = f'{ANALYZE_URL}/api/' API_VERSION = 'v2-0'