From 292ff742ddb2287042d15ce89531f4f92cbb2212 Mon Sep 17 00:00:00 2001 From: Radek Vyhnal Date: Fri, 18 Oct 2024 16:48:36 +0200 Subject: [PATCH 1/2] use PyMISP, ExpandedPyMISP is deprecated --- intelmq/bots/collectors/misp/collector.py | 5 +---- intelmq/bots/experts/misp/expert.py | 12 ++++++------ 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/intelmq/bots/collectors/misp/collector.py b/intelmq/bots/collectors/misp/collector.py index b32417bc4..b78555f00 100644 --- a/intelmq/bots/collectors/misp/collector.py +++ b/intelmq/bots/collectors/misp/collector.py @@ -25,10 +25,7 @@ from intelmq.lib.exceptions import MissingDependencyError try: - try: - from pymisp import ExpandedPyMISP as PyMISP - except ImportError: - from pymisp import PyMISP + from pymisp import PyMISP except ImportError: PyMISP = None import_fail_reason = 'import' diff --git a/intelmq/bots/experts/misp/expert.py b/intelmq/bots/experts/misp/expert.py index 149f8ef33..81c013d50 100644 --- a/intelmq/bots/experts/misp/expert.py +++ b/intelmq/bots/experts/misp/expert.py @@ -17,9 +17,9 @@ from intelmq.lib.exceptions import MissingDependencyError try: - from pymisp import ExpandedPyMISP + from pymisp import PyMISP except ImportError: - ExpandedPyMISP = None + PyMISP = None class MISPExpertBot(ExpertBot): @@ -28,13 +28,13 @@ class MISPExpertBot(ExpertBot): misp_url: str = "" def init(self): - if ExpandedPyMISP is None: + if PyMISP is None: raise MissingDependencyError('pymisp', '>=2.4.117.3') # Initialize MISP connection - self.misp = ExpandedPyMISP(self.misp_url, - self.misp_key, - self.http_verify_cert) + self.misp = PyMISP(self.misp_url, + self.misp_key, + self.http_verify_cert) def process(self): event = self.receive_message() From a6a86b066b74fe96d601fc77f7231bcaf097453d Mon Sep 17 00:00:00 2001 From: Sebastian Wagner Date: Sun, 8 Dec 2024 12:54:51 +0100 Subject: [PATCH 2/2] doc: add changelog entry for certtools/intelmq#2532 --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 476f5d3a1..8b3e084be 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,7 @@ #### Collectors - `intelmq.bots.collectors.shadowserver.collector_reports_api.py`: - Fixed behaviour if parameter `types` value is empty string, behave the same way as not set, not like no type. +- `intelmq.bots.collectors.misp`: Use `PyMISP` class instead of deprecated `ExpandedPyMISP` (PR#2532 by Radek Vyhnal) #### Parsers - `intelmq.bots.parsers.shadowserver._config`: @@ -29,6 +30,7 @@ - Fix to avoid schema download if not configured #2530. #### Experts +- `intelmq.bots.experts.misp`: Use `PyMISP` class instead of deprecated `ExpandedPyMISP` (PR#2532 by Radek Vyhnal) #### Outputs