Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error Download as "STIX 1 JSON (metadata + all attributes)" #43

Open
jarandas opened this issue Oct 26, 2021 · 0 comments
Open

Error Download as "STIX 1 JSON (metadata + all attributes)" #43

jarandas opened this issue Oct 26, 2021 · 0 comments

Comments

@jarandas
Copy link

When I download event from MISP Download as -> STIX 1 JSON (metadata + all attributes) or STIX 2 It doesn't work on a fresh installation of MISP v2.4.150

Data:
MISP v2.4.150
Python 3.6.8
CentOS 7
Guide: https://misp.github.io/MISP/INSTALL.rhel7/

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 3, in <module>
 from .misp_stix_converter import misp_attribute_collection_to_stix1, misp_collection_to_stix2_0, misp_collection_to_stix2_1, misp_event_collection_to_stix1, misp_to_stix1, misp_to_stix2_0, misp_to_stix2_1
 File "/var/www/MISP/app/files/scripts/misp-stix/misp_stix_converter/misp_stix_converter.py", line 22, in <module>
 from typing import List, TypedDict, Union
ImportError: cannot import name 'TypedDict'

I solve the error as follows:
References: https://pypi.org/project/typing-extensions/

git diff misp_stix_converter.py
diff --git a/misp_stix_converter/misp_stix_converter.py b/misp_stix_converter/misp_stix_converter.py
index 1ec7fa2..636cbe8 100644
--- a/misp_stix_converter/misp_stix_converter.py
+++ b/misp_stix_converter/misp_stix_converter.py
@@ -19,7 +19,8 @@ from stix.core.ttps import TTPs
 from stix2.base import STIXJSONEncoder
 from stix2.v20 import Bundle as Bundle_v20
 from stix2.v21 import Bundle as Bundle_v21
-from typing import List, TypedDict, Union
+from typing import List, Union
+from typing_extensions import TypedDict
 from uuid import uuid4

 _default_namespace = 'https://github.com/MISP/MISP'

Regards

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant