Skip to content

Commit

Permalink
sanitize strings in model
Browse files Browse the repository at this point in the history
  • Loading branch information
mr-tz committed Dec 2, 2024
1 parent 5b737c8 commit bbe2223
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 13 deletions.
14 changes: 3 additions & 11 deletions capa/features/extractors/vmray/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__)

Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions capa/features/extractors/vmray/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down

0 comments on commit bbe2223

Please sign in to comment.