mirror of https://github.com/MISP/MISP
fix: [stix2 export] Fixed TLP marking definition objects creation
parent
b40fa0d69f
commit
4d590160da
|
@ -676,10 +676,15 @@ class StixBuilder():
|
|||
'from_object']
|
||||
|
||||
def create_marking(self, tag):
|
||||
id = 'marking-definition--%s' % uuid.uuid4()
|
||||
definition_type, definition = tag.split(':')
|
||||
self.markings[tag] = {'type': 'marking-definition', 'id': id, 'definition_type': definition_type,
|
||||
'definition': {definition_type: definition}}
|
||||
try:
|
||||
marking_definition = globals()[tlp_markings[tag]]
|
||||
id = marking_definition.id
|
||||
except KeyError:
|
||||
id = 'marking-definition--%s' % uuid.uuid4()
|
||||
definition_type, definition = tag.split(':')
|
||||
marking_definition = {'type': 'marking-definition', 'id': id, 'definition_type': definition_type,
|
||||
'definition': {definition_type: definition}}
|
||||
self.markings[tag] = marking_definition
|
||||
return id
|
||||
|
||||
@staticmethod
|
||||
|
|
|
@ -360,6 +360,9 @@ x509mapping = {'pubkey-info-algorithm': 'subject_public_key_algorithm', 'subject
|
|||
|
||||
defineProtocols = {'80': 'http', '443': 'https'}
|
||||
|
||||
tlp_markings = {'tlp:white': 'TLP_WHITE', 'tlp:green': 'TLP_GREEN',
|
||||
'tlp:amber': 'TLP_AMBER', 'tlp:red': 'TLP_RED'}
|
||||
|
||||
relationshipsSpecifications = {'attack-pattern': {'vulnerability': 'targets', 'identity': 'targets',
|
||||
'malware': 'uses', 'tool': 'uses'},
|
||||
'campaign': {'intrusion-set': 'attributed-to', 'threat-actor': 'attributed-to',
|
||||
|
|
Loading…
Reference in New Issue