mirror of https://github.com/MISP/PyMISP
Merge branch 'master' of github.com:CIRCL/PyMISP
commit
e1b5000a16
|
@ -2,7 +2,8 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from misp_stix_converter.converters.buildMISPAttribute import buildEvent, open_stix
|
from misp_stix_converter.converters.buildMISPAttribute import buildEvent
|
||||||
|
from misp_stix_converter.converters import convert
|
||||||
from misp_stix_converter.converters.convert import MISPtoSTIX
|
from misp_stix_converter.converters.convert import MISPtoSTIX
|
||||||
has_misp_stix_converter = True
|
has_misp_stix_converter = True
|
||||||
except ImportError:
|
except ImportError:
|
||||||
|
@ -13,7 +14,7 @@ def load_stix(stix, distribution=3, threat_level_id=2, analysis=0):
|
||||||
'''Returns a MISPEvent object from a STIX package'''
|
'''Returns a MISPEvent object from a STIX package'''
|
||||||
if not has_misp_stix_converter:
|
if not has_misp_stix_converter:
|
||||||
raise Exception('You need to install misp_stix_converter: pip install git+https://github.com/MISP/MISP-STIX-Converter.git')
|
raise Exception('You need to install misp_stix_converter: pip install git+https://github.com/MISP/MISP-STIX-Converter.git')
|
||||||
stix = open_stix(stix)
|
stix = convert.load_stix(stix)
|
||||||
return buildEvent(stix, distribution=distribution,
|
return buildEvent(stix, distribution=distribution,
|
||||||
threat_level_id=threat_level_id, analysis=analysis)
|
threat_level_id=threat_level_id, analysis=analysis)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue