mirror of https://github.com/MISP/MISP
Merge pull request #7500 from JakubOnderka/stix-to-misp-types-path
Stix to misp types pathpull/7614/head
commit
7748598750
|
@ -21,6 +21,7 @@ import json
|
|||
import os
|
||||
import time
|
||||
import io
|
||||
import pymisp
|
||||
import stix2
|
||||
import stix2misp_mapping
|
||||
from collections import defaultdict
|
||||
|
@ -28,9 +29,7 @@ from copy import deepcopy
|
|||
from pathlib import Path
|
||||
_misp_dir = Path(os.path.realpath(__file__)).parents[4]
|
||||
_misp_objects_path = _misp_dir / 'app' / 'files' / 'misp-objects' / 'objects'
|
||||
_pymisp_dir = _misp_dir / 'PyMISP'
|
||||
with open(_pymisp_dir / 'pymisp' / 'data' / 'describeTypes.json', 'r') as f:
|
||||
_misp_types = json.loads(f.read())['result'].get('types')
|
||||
_misp_types = pymisp.AbstractMISP().describe_types.get('types')
|
||||
from pymisp import MISPEvent, MISPObject, MISPAttribute
|
||||
|
||||
|
||||
|
|
|
@ -21,6 +21,7 @@ import os
|
|||
import time
|
||||
import uuid
|
||||
import base64
|
||||
import pymisp
|
||||
import stix2misp_mapping
|
||||
import stix.extensions.marking.ais
|
||||
from mixbox.namespaces import NamespaceNotFoundError
|
||||
|
@ -33,13 +34,12 @@ except ImportError:
|
|||
pass
|
||||
|
||||
_MISP_dir = "/".join([p for p in os.path.dirname(os.path.realpath(__file__)).split('/')[:-3]])
|
||||
_PyMISP_dir = '{_MISP_dir}/PyMISP'.format(_MISP_dir=_MISP_dir)
|
||||
_MISP_objects_path = '{_MISP_dir}/app/files/misp-objects/objects'.format(_MISP_dir=_MISP_dir)
|
||||
sys.path.append(_PyMISP_dir)
|
||||
|
||||
from pymisp.mispevent import MISPEvent, MISPObject, MISPAttribute
|
||||
|
||||
with open("{_PyMISP_dir}/pymisp/data/describeTypes.json".format(_PyMISP_dir=_PyMISP_dir), 'r') as f:
|
||||
categories = json.loads(f.read())['result'].get('categories')
|
||||
categories = pymisp.AbstractMISP().describe_types.get('categories')
|
||||
|
||||
|
||||
class StixParser():
|
||||
def __init__(self):
|
||||
|
|
Loading…
Reference in New Issue