update mitre 2.0 scripts to add external_id in meta (still need to be tested)

This commit is contained in:
Deborah Servili 2018-05-18 16:15:26 +02:00
parent 3d5c697761
commit 4c07e583fe
12 changed files with 24 additions and 0 deletions

View file

@ -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:

View file

@ -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 = {}

View file

@ -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)

View file

@ -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:]

View file

@ -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:]

View file

@ -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:

View file

@ -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 = {}

View file

@ -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)

View file

@ -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:]

View file

@ -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:]

View file

@ -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:

View file

@ -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)