mirror of
https://github.com/MISP/misp-galaxy.git
synced 2024-11-26 16:57:18 +00:00
update mitre 2.0 scripts to add external_id in meta (still need to be tested)
This commit is contained in:
parent
3d5c697761
commit
4c07e583fe
12 changed files with 24 additions and 0 deletions
|
@ -28,6 +28,8 @@ for element in os.listdir('.'):
|
|||
for reference in temp['external_references']:
|
||||
if 'url' in reference and reference['url'] not in value['meta']['refs']:
|
||||
value['meta']['refs'].append(reference['url'])
|
||||
if 'external_id' in reference:
|
||||
value['meta']['external_id'] = reference['external_id']
|
||||
if 'x_mitre_data_sources' in temp:
|
||||
value['meta']['mitre_data_sources'] = temp['x_mitre_data_sources']
|
||||
if 'x_mitre_platforms' in temp:
|
||||
|
|
|
@ -24,6 +24,8 @@ for element in os.listdir('.'):
|
|||
value['description'] = temp['description']
|
||||
value['value'] = temp['name'] + ' - ' + temp['external_references'][0]['external_id']
|
||||
value['uuid'] = re.search('--(.*)$', temp['id']).group(0)[2:]
|
||||
value['meta'] = {}
|
||||
value['meta']['external_id'] = temp['external_references'][0]['external_id']
|
||||
values.append(value)
|
||||
|
||||
galaxy = {}
|
||||
|
|
|
@ -29,6 +29,8 @@ for element in os.listdir('.'):
|
|||
for reference in temp['external_references']:
|
||||
if 'url' in reference and reference['url'] not in value['meta']['refs']:
|
||||
value['meta']['refs'].append(reference['url'])
|
||||
if 'external_id' in reference:
|
||||
value['meta']['external_id'] = reference['external_id']
|
||||
value['uuid'] = re.search('--(.*)$', temp['id']).group(0)[2:]
|
||||
values.append(value)
|
||||
|
||||
|
|
|
@ -28,6 +28,8 @@ for element in os.listdir('.'):
|
|||
for reference in temp['external_references']:
|
||||
if 'url' in reference and reference['url'] not in value['meta']['refs']:
|
||||
value['meta']['refs'].append(reference['url'])
|
||||
if 'external_id' in reference:
|
||||
value['meta']['external_id'] = reference['external_id']
|
||||
if'x_mitre_aliases' in temp:
|
||||
value['meta']['synonyms'] = temp['x_mitre_aliases']
|
||||
value['uuid'] = re.search('--(.*)$', temp['id']).group(0)[2:]
|
||||
|
|
|
@ -28,6 +28,8 @@ for element in os.listdir('.'):
|
|||
for reference in temp['external_references']:
|
||||
if 'url' in reference and reference['url'] not in value['meta']['refs']:
|
||||
value['meta']['refs'].append(reference['url'])
|
||||
if 'external_id' in reference:
|
||||
value['meta']['external_id'] = reference['external_id']
|
||||
if'x_mitre_aliases' in temp:
|
||||
value['meta']['synonyms'] = temp['x_mitre_aliases']
|
||||
value['uuid'] = re.search('--(.*)$', temp['id']).group(0)[2:]
|
||||
|
|
|
@ -28,6 +28,8 @@ for element in os.listdir('.'):
|
|||
for reference in temp['external_references']:
|
||||
if 'url' in reference and reference['url'] not in value['meta']['refs']:
|
||||
value['meta']['refs'].append(reference['url'])
|
||||
if 'external_id' in reference:
|
||||
value['meta']['external_id'] = reference['external_id']
|
||||
if 'x_mitre_data_sources' in temp:
|
||||
value['meta']['mitre_data_sources'] = temp['x_mitre_data_sources']
|
||||
if 'x_mitre_platforms' in temp:
|
||||
|
|
|
@ -24,6 +24,8 @@ for element in os.listdir('.'):
|
|||
value['description'] = temp['description']
|
||||
value['value'] = temp['name'] + ' - ' + temp['external_references'][0]['external_id']
|
||||
value['uuid'] = re.search('--(.*)$', temp['id']).group(0)[2:]
|
||||
value['meta'] = {}
|
||||
value['meta']['external_id'] = temp['external_references'][0]['external_id']
|
||||
values.append(value)
|
||||
|
||||
galaxy = {}
|
||||
|
|
|
@ -29,6 +29,8 @@ for element in os.listdir('.'):
|
|||
for reference in temp['external_references']:
|
||||
if 'url' in reference and reference['url'] not in value['meta']['refs']:
|
||||
value['meta']['refs'].append(reference['url'])
|
||||
if 'external_id' in reference:
|
||||
value['meta']['external_id'] = reference['external_id']
|
||||
value['uuid'] = re.search('--(.*)$', temp['id']).group(0)[2:]
|
||||
values.append(value)
|
||||
|
||||
|
|
|
@ -28,6 +28,8 @@ for element in os.listdir('.'):
|
|||
for reference in temp['external_references']:
|
||||
if 'url' in reference and reference['url'] not in value['meta']['refs']:
|
||||
value['meta']['refs'].append(reference['url'])
|
||||
if 'external_id' in reference:
|
||||
value['meta']['external_id'] = reference['external_id']
|
||||
if'x_mitre_aliases' in temp:
|
||||
value['meta']['synonyms'] = temp['x_mitre_aliases']
|
||||
value['uuid'] = re.search('--(.*)$', temp['id']).group(0)[2:]
|
||||
|
|
|
@ -28,6 +28,8 @@ for element in os.listdir('.'):
|
|||
for reference in temp['external_references']:
|
||||
if 'url' in reference and reference['url'] not in value['meta']['refs']:
|
||||
value['meta']['refs'].append(reference['url'])
|
||||
if 'external_id' in reference:
|
||||
value['meta']['external_id'] = reference['external_id']
|
||||
if'x_mitre_aliases' in temp:
|
||||
value['meta']['synonyms'] = temp['x_mitre_aliases']
|
||||
value['uuid'] = re.search('--(.*)$', temp['id']).group(0)[2:]
|
||||
|
|
|
@ -28,6 +28,8 @@ for element in os.listdir('.'):
|
|||
for reference in temp['external_references']:
|
||||
if 'url' in reference and reference['url'] not in value['meta']['refs']:
|
||||
value['meta']['refs'].append(reference['url'])
|
||||
if 'external_id' in reference:
|
||||
value['meta']['external_id'] = reference['external_id']
|
||||
if 'x_mitre_data_sources' in temp:
|
||||
value['meta']['mitre_data_sources'] = temp['x_mitre_data_sources']
|
||||
if 'x_mitre_platforms' in temp:
|
||||
|
|
|
@ -29,6 +29,8 @@ for element in os.listdir('.'):
|
|||
for reference in temp['external_references']:
|
||||
if 'url' in reference and reference['url'] not in value['meta']['refs']:
|
||||
value['meta']['refs'].append(reference['url'])
|
||||
if 'external_id' in reference:
|
||||
value['meta']['external_id'] = reference['external_id']
|
||||
value['uuid'] = re.search('--(.*)$', temp['id']).group(0)[2:]
|
||||
values.append(value)
|
||||
|
||||
|
|
Loading…
Reference in a new issue