misp-stix icon indicating copy to clipboard operation
misp-stix copied to clipboard

Bug: STIX1toMISPParser doesn't work at all

Open maciej-lech opened this issue 2 years ago • 1 comments

MISP-STIX usage

No response

Expected behavior

Function stix_1_to_misp converts STIX1 to MISP as the main script allows setting STIX1 version:

parser.add_argument('-v', '--version', choices=['1.1.1', '1.2', '2.0', '2.1'], required=True, help='STIX version.')

Actual behavior

It uses:

stix_parser.load_event()
stix_parser.build_misp_event(event)

... but both methods are undefined, so the implementation is completely missing. However, it fails even prior to that with: TypeError: descriptor '__init__' of 'super' object needs an argument

Steps to reproduce

Run misp_stix_converter -i -v 1.2 -f ../../example_stix1.xml

Version

2.4.168

Python version

3.8

Relevant log output

Traceback (most recent call last):
  File "./ve/bin/misp_stix_converter", line 8, in <module>
    sys.exit(main())
  File "./ve/lib/python3.8/site-packages/misp_stix_converter/__init__.py", line 174, in main
    results = _misp_to_stix(stix_args) if stix_args.export else _stix_to_misp(stix_args)
  File "./ve/lib/python3.8/site-packages/misp_stix_converter/__init__.py", line 150, in _stix_to_misp
    return _process_files(stix_args.file, method)
  File "./ve/lib/python3.8/site-packages/misp_stix_converter/__init__.py", line 137, in _process_files
    status = method(filename)
  File "./ve/lib/python3.8/site-packages/misp_stix_converter/misp_stix_converter.py", line 440, in stix_1_to_misp
    stix_parser = InternalSTIX1toMISPParser() if from_misp else ExternalSTIX1toMISPParser()
  File "./ve/lib/python3.8/site-packages/misp_stix_converter/stix2misp/external_stix1_to_misp.py", line 9, in __init__
    super().__init__()
  File "./ve/lib/python3.8/site-packages/misp_stix_converter/stix2misp/stix1_to_misp.py", line 9, in __init__
    super.__init__()
TypeError: descriptor '__init__' of 'super' object needs an argument

Extra attachments

No response

Code of Conduct

  • [X] I agree to follow this project's Code of Conduct

maciej-lech avatar Mar 19 '23 09:03 maciej-lech

Tests are also failing,

poetry run pytest tests/test_stix1_export.py - pass
poetry run pytest tests/test_stix20_export.py - fail
poetry run pytest tests/test_stix21_export.py - fail

dragsu avatar Mar 23 '23 04:03 dragsu