oasis-open / cti-stix-generator

OASIS Cyber Threat Intelligence (CTI) TC: A tool for generating STIX content for prototyping and testing. https://github.com/oasis-open/cti-stix-generator
https://stix2-generator.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
40 stars 16 forks source link

stix2 3.0.0 breaks utils.make_bundle #22

Closed zeddee closed 3 years ago

zeddee commented 3 years ago

stix2==3.0.0 breaks stix2generator.utils.make_bundle, throwing this stacktrace:

$ python ./scripts/get_stix2_tests.py
    Traceback (most recent call last):
      File "./scripts/get_stix2_tests.py", line 184, in <module>
        testfile = parse_testfile(load_ast_from_file(TESTFILE))
      File "./scripts/get_stix2_tests.py", line 149, in parse_testfile
        "2.1"
      File "/Users/zeddee/working/eiq/platform-docs-site/.direnv/python-3.6.8/lib/python3.6/site-packages/stix2generator/utils.py", line 373, in make_bundle
        cls_maps = _get_stix2_class_maps(stix_version)
      File "/Users/zeddee/working/eiq/platform-docs-site/.direnv/python-3.6.8/lib/python3.6/site-packages/stix2generator/utils.py", line 203, in _get_stix2_class_maps
        cls_maps = mappings.STIX2_OBJ_MAPS[stix_vid]
    AttributeError: module 'stix2.parsing' has no attribute 'STIX2_OBJ_MAPS'

so it looks like where stix2generator expects 'STIX2_OBJ_MAPS' is no longer true for stix2==3.0.0

pinning stix2 to 2.1.0 allows my make_bundle call to work

chisholm commented 3 years ago

Yeah, released stix2generator (0.1.0) is not compatible with stix2 3.0.0. There were backward-incompatible changes in the new stix2 library version, so there will be some ripple effects. We will release a newer version of stix2generator, hopefully before long.

zeddee commented 3 years ago

ah! i see this might have been fixed by https://github.com/oasis-open/cti-stix-generator/pull/4 😅 sorry, should have checked earlier!

chisholm commented 3 years ago

Version 0.2.0 is released, which should fix this problem. Let us know if there are still issues!