From b69070a8e8929a7e4cc9c1a11de9a7de3eba4475 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Praszmo?= Date: Thu, 7 Mar 2024 14:10:13 +0100 Subject: [PATCH] Add configurable PyMISP timeout (#25) * Add configurable PyMISP timeout --- karton/misp_pusher/misp_pusher.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/karton/misp_pusher/misp_pusher.py b/karton/misp_pusher/misp_pusher.py index 8f67645..8aff5e5 100644 --- a/karton/misp_pusher/misp_pusher.py +++ b/karton/misp_pusher/misp_pusher.py @@ -5,7 +5,7 @@ from karton.core import Config, Karton, Task from mwdb_iocextract import parse # type: ignore from mwdblib.util import config_dhash # type: ignore -from pymisp import ExpandedPyMISP, MISPEvent +from pymisp import MISPEvent, PyMISP from pymisp.mispevent import MISPGalaxyCluster @@ -64,10 +64,11 @@ def process(self, task: Task) -> None: # Nothing actionable found - skip the config return - misp = ExpandedPyMISP( - http_url(self.config.get("misp", "url")), - self.config.get("misp", "key"), - not self.config.getboolean("misp", "insecure", False), + misp = PyMISP( + url=http_url(self.config.get("misp", "url")), + key=self.config.get("misp", "key"), + ssl=not self.config.getboolean("misp", "insecure", False), + timeout=self.config.getint("misp", "timeout", 10), ) # Upload structured data to MISP