Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ReversingLabs TitaniumScale v2: Feature - Add new actions #3

Closed
wants to merge 12 commits into from
Prev Previous commit
Next Next commit
Update action names, bump phantom version
RLakukolja committed Jun 24, 2024

Unverified

This user has not yet uploaded their public signing key.
commit f6cc97c95e9711ae052f9a053f173413a8435de2
10 changes: 5 additions & 5 deletions reversinglabs_tiscalev2.json
Original file line number Diff line number Diff line change
@@ -26,7 +26,7 @@
"utctime_updated": "2023-04-13T12:48:58.213954Z",
"package_name": "phantom_reversinglabs_tiscalev2",
"main_module": "reversinglabs_tiscalev2_connector.py",
"min_phantom_version": "5.5.0",
"min_phantom_version": "6.2.1",
"app_wizard_version": "1.0.0",
"fips_compliant": false,
"configuration": {
@@ -267,7 +267,7 @@
"view": {
"description": "Applied report transformation, see Customizing Analysis Report",
"data_type": "string",
"order": 2,
"order": 3,
"required": false
}
},
@@ -440,7 +440,7 @@
"versions": "EQ(*)"
},
{
"action": "get tasks list",
"action": "get task list",
"identifier": "get_task_list",
"description": "List processing tasks generated by file submission requests",
"verbose": "When a file is submitted for analysis a processing task is created and queued on the TiScale Worker server. All processing results are retained until deleted by the user, or when the time configured using the conf_cleanup_task_age_limit expires (whichever comes first).",
@@ -519,7 +519,7 @@
},
{
"action": "delete processing task",
"identifier": "delete_task",
"identifier": "delete_processing_task",
"description": "Deletes a single processing task record from the system",
"verbose": "Users can manually delete task records from the system at any time.",
"type": "generic",
@@ -580,7 +580,7 @@
},
{
"action": "delete processing tasks",
"identifier": "delete_tasks",
"identifier": "delete_processing_tasks",
"description": "Delete task records from the system based on the time when they were submitted",
"verbose": "All file processing results are automatically removed from the platform 30 minutes after processing is completed. However, users can manually delete task records from the system at any time. Task age is calculated as being the difference between the current system timestamp and the timestamp of the task submission.",
"type": "generic",
19 changes: 10 additions & 9 deletions reversinglabs_tiscalev2_connector.py
Original file line number Diff line number Diff line change
@@ -62,10 +62,10 @@ class ReversinglabsTitaniumScaleConnector(BaseConnector):
ACTION_ID_DETONATE_FILE_AND_GET_REPORT = "detonate_file_and_get_report"
ACTION_ID_GET_REPORT = "get_report"
ACTION_ID_GET_REPORT_BY_ID = "get_report_by_id"
ACTION_ID_LIST_TASKS = "get_task_list"
ACTION_ID_DELETE_TASK = "delete_task"
ACTION_ID_DELETE_TASKS = "delete_tasks"
ACTION_ID_GET_YARA = "get_yara_id"
ACTION_ID_GET_TASK_LIST = "get_task_list"
ACTION_ID_DELETE_PROCESSING_TASK = "delete_processing_task"
ACTION_ID_DELETE_PROCESSING_TASKS = "delete_processing_tasks"
ACTION_ID_GET_YARA_ID = "get_yara_id"

def __init__(self):
# Call the BaseConnectors init first
@@ -77,10 +77,10 @@ def __init__(self):
self.ACTION_ID_DETONATE_FILE_AND_GET_REPORT: self._handle_detonate_file_and_get_report,
self.ACTION_ID_GET_REPORT: self._handle_get_report,
self.ACTION_ID_GET_REPORT_BY_ID: self._handle_get_report_by_id,
self.ACTION_ID_LIST_TASKS: self._handle_get_task_list,
self.ACTION_ID_DELETE_TASK: self._handle_delete_task,
self.ACTION_ID_DELETE_TASKS: self._handle_delete_tasks,
self.ACTION_ID_GET_YARA: self._handle_get_yara,
self.ACTION_ID_GET_TASK_LIST: self._handle_get_task_list,
self.ACTION_ID_DELETE_PROCESSING_TASK: self._handle_delete_task,
self.ACTION_ID_DELETE_PROCESSING_TASKS: self._handle_delete_tasks,
self.ACTION_ID_GET_YARA_ID: self._handle_get_yara_id,
}

self._state = None
@@ -192,6 +192,7 @@ def _handle_test_connectivity(self, action_result, param):

self.tiscale.test_connection()

self.debug_print("Executed", self.get_action_identifier())
self.save_progress("Test Connectivity Passed")

def _handle_get_task_list(self, action_result, param):
@@ -217,7 +218,7 @@ def _handle_delete_tasks(self, action_result, param):
)
self.debug_print("Executed", self.get_action_identifier())

def _handle_get_yara(self, action_result, param):
def _handle_get_yara_id(self, action_result, param):
self.debug_print("Action handler", self.get_action_identifier())
response = self.tiscale.get_yara_id()
action_result.add_data(response.json())