Skip to content

Commit

Permalink
Merge pull request #2532 from rvyhnal/develop
Browse files Browse the repository at this point in the history
use PyMISP, ExpandedPyMISP is deprecated
  • Loading branch information
sebix authored Jan 3, 2025
2 parents 04c75a3 + 4b20fdb commit 98df0cd
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,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`:
Expand All @@ -32,6 +33,7 @@
#### Experts
- `intelmq.bots.experts.securitytxt`:
- Added new bot (PR#2538 by Frank Westers and Sebastian Wagner)
- `intelmq.bots.experts.misp`: Use `PyMISP` class instead of deprecated `ExpandedPyMISP` (PR#2532 by Radek Vyhnal)

#### Outputs
- `intelmq.bots.outputs.cif3.output`:
Expand Down
5 changes: 1 addition & 4 deletions intelmq/bots/collectors/misp/collector.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
12 changes: 6 additions & 6 deletions intelmq/bots/experts/misp/expert.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -28,13 +28,13 @@ class MISPExpertBot(ExpertBot):
misp_url: str = "<insert url of MISP server (with trailing '/')>"

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()
Expand Down

0 comments on commit 98df0cd

Please sign in to comment.