amuehlem / MISP-RPM

RPM packages for MISP
32 stars 14 forks source link

No module named '_bz2' for STIX2 export #71

Closed JoePJisc closed 2 years ago

JoePJisc commented 2 years ago

I'm trying to export a MISP event to STIX2 using MISP installed on RHEL7 with MISP-RPM, but thisis failing with the following in exec-errors.log.

[2022-07-07 15:51:06 9357] Running command /var/www/cgi-bin/misp-virtualenv/bin/python3 /var/www/MISP/app/files/scripts/stix2/misp2stix2.py -v 2.0 -i /var/www/MISP/app/tmp/MISPPIhsc5
Traceback (most recent call last):
  File "/var/www/MISP/app/files/scripts/stix2/misp2stix2.py", line 34, in <module>
    from misp_stix_converter import MISPtoSTIX20Parser, MISPtoSTIX21Parser
  File "/var/www/MISP/app/files/scripts/misp-stix/misp_stix_converter/__init__.py", line 6, in <module>
    from .misp2stix import *
  File "/var/www/MISP/app/files/scripts/misp-stix/misp_stix_converter/misp2stix/__init__.py", line 2, in <module>
    from .misp_to_stix1 import MISPtoSTIX1AttributesParser, MISPtoSTIX1EventsParser
  File "/var/www/MISP/app/files/scripts/misp-stix/misp_stix_converter/misp2stix/misp_to_stix1.py", line 16, in <module>
    from cybox.objects.artifact_object import Artifact, RawArtifact
  File "/var/www/MISP/app/files/scripts/python-cybox/cybox/objects/artifact_object.py", line 4, in <module>
    import bz2
  File "/var/www/cgi-bin/misp-python/lib/python3.9/bz2.py", line 18, in <module>
    from _bz2 import BZ2Compressor, BZ2Decompressor
ModuleNotFoundError: No module named '_bz2'
[2022-07-07 15:51:07 9357] Process finished with return code 1

Can the required bz2 module be added to the misp-python-virtualenv package?

its the same error as I'm currently seeing for the modules that need disabling in #59

amuehlem commented 2 years ago

Hi JoeP-oss

I created a new misp-pyton-3.9.13-4.el7 package, the bz2 packge is included there. It should be available in the repository within the next minutes

Best Andreas

JoePJisc commented 2 years ago

That has fixed the issue and I can now export as STIX 2.

Thanks