From bbe2223b8d75541e7cfa1cff68f8993d9bdab973 Mon Sep 17 00:00:00 2001 From: mr-tz Date: Mon, 2 Dec 2024 16:57:49 +0000 Subject: [PATCH] sanitize strings in model --- capa/features/extractors/vmray/__init__.py | 14 +++----------- capa/features/extractors/vmray/models.py | 4 ++-- 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/capa/features/extractors/vmray/__init__.py b/capa/features/extractors/vmray/__init__.py index 93f0330ee..dc719211a 100644 --- a/capa/features/extractors/vmray/__init__.py +++ b/capa/features/extractors/vmray/__init__.py @@ -13,15 +13,7 @@ from dataclasses import dataclass from capa.exceptions import UnsupportedFormatError -from capa.features.extractors.vmray.models import ( - File, - Flog, - SummaryV2, - StaticData, - FunctionCall, - xml_to_dict, - sanitize_string, -) +from capa.features.extractors.vmray.models import File, Flog, SummaryV2, StaticData, FunctionCall, xml_to_dict logger = logging.getLogger(__name__) @@ -174,8 +166,8 @@ def _compute_monitor_processes(self): ppid, process.monitor_id, process.image_name, - sanitize_string(process.filename), - sanitize_string(process.cmd_line), + process.filename, + process.cmd_line, ) # not all processes are recorded in SummaryV2.json, get missing data from flog.xml, see #2394 diff --git a/capa/features/extractors/vmray/models.py b/capa/features/extractors/vmray/models.py index 728361c69..755f494fe 100644 --- a/capa/features/extractors/vmray/models.py +++ b/capa/features/extractors/vmray/models.py @@ -315,9 +315,9 @@ class Process(BaseModel): monitor_id: int # monitor_reason: str os_pid: int - filename: str + filename: SanitizedString image_name: str - cmd_line: str + cmd_line: SanitizedString ref_parent_process: Optional[GenericReference] = None