Skip to content

Commit

Permalink
regex match on process_analysis rather than os.basepath
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorwalton committed Jun 28, 2024
1 parent 031ea37 commit ac779c2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions backend/app/threat_intel/schema/socfortress.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import os
import re
from typing import List
from typing import Optional

Expand Down Expand Up @@ -58,7 +58,8 @@ class SocfortressProcessNameAnalysisRequest(BaseModel):

@validator("process_name", pre=True)
def extract_filename(cls, v):
return os.path.basename(v)
match = re.search(r"[^\\]+$", v)
return match.group() if match else v


class Path(BaseModel):
Expand Down

0 comments on commit ac779c2

Please sign in to comment.