Skip to content

Commit

Permalink
misp fix: invalid json (#2481)
Browse files Browse the repository at this point in the history
* fix1

* adjusted pymisp and upgraded

* update pymisp

---------

Co-authored-by: Matteo Lodi <30625432+mlodic@users.noreply.github.com>
  • Loading branch information
g4ze and mlodic authored Aug 22, 2024
1 parent 4aa7360 commit 2a534f5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
15 changes: 11 additions & 4 deletions api_app/analyzers_manager/observable_analyzers/misp.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class MISP(classes.ObservableAnalyzer):
enforce_warninglist: bool
filter_on_type: bool
strict_search: bool
timeout: int
timeout: int = 5
published: bool
metadata: bool

Expand All @@ -51,10 +51,17 @@ def run(self):
date_from = now - datetime.timedelta(days=self.from_days)
params = {
"limit": self.limit,
"enforce_warninglist": self.enforce_warninglist,
"published": self.published,
"metadata": self.metadata,
}
if self.enforce_warninglist:
params["enforce_warninglist"] = self.enforce_warninglist
# https://pymisp.readthedocs.io/en/latest/modules.html#pymisp.PyMISP
# fixme: this should be None as default but is False
# so it's not possible to set it as False in this way.
# migration required
if self.published:
params["published"] = self.published
if self.metadata:
params["metadata"] = self.metadata

if self.strict_search:
params["value"] = self.observable_name
Expand Down
2 changes: 1 addition & 1 deletion requirements/project-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ pyelftools==0.31
PyExifTool==0.5.0
pyhashlookup==1.2.0
pyimpfuzzy==0.5
pymisp==2.4.190
pymisp==2.4.196
pyOneNote==0.0.2
pypdns==2.2.1
pypssl==2.2
Expand Down

0 comments on commit 2a534f5

Please sign in to comment.