gcrahay / otx_misp

Imports Alienvault OTX pulses to a MISP instance
Other
52 stars 42 forks source link

AttributeError: 'IndexError' object has no attribute 'message' #18

Closed KALRONG closed 7 years ago

KALRONG commented 7 years ago

Description

While dry run works when I disable it I keep getting this error after the script queries MISP (I can see it in the server usage).

Versions

Traceback or error

Connection to MISP instance: https://172.24.2.1:2443 Traceback (most recent call last): File "/usr/local/lib/python3.5/dist-packages/otx_misp/cli.py", line 165, in main create_events(pulses, author=config.author, **kwargs) File "/usr/local/lib/python3.5/dist-packages/otx_misp/init.py", line 185, in create_events tags[get_tag_name(tag['name'])] = tag['name'] File "/usr/local/lib/python3.5/dist-packages/otx_misp/init.py", line 177, in get_tag_name if last[0] == '"': IndexError: string index out of range

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/local/bin/otx-misp", line 11, in sys.exit(main()) File "/usr/local/lib/python3.5/dist-packages/otx_misp/cli.py", line 167, in main log.error(ex.message) AttributeError: 'IndexError' object has no attribute 'message'

KALRONG commented 7 years ago

I found that the issue were some tags existing in my misp that didn't contain a value after the "=" I have applied a little fix and now its working, here is my pull request: https://github.com/gcrahay/otx_misp/pull/19