mirror of
https://github.com/MISP/misp-galaxy.git
synced 2024-11-30 02:37:17 +00:00
fix: [att&ck converter] allow multiple external IDs
- There are in some cases external ID references to CAPEC in addition to ATT&CK in techniques - convert external ID to a list rather than a single string - as reported by @SYNchroACK - as hurried along by a disappointed @deresz
This commit is contained in:
parent
fda4160bed
commit
13dbf70d77
1 changed files with 3 additions and 2 deletions
|
@ -25,11 +25,12 @@ for element in os.listdir('.'):
|
||||||
value['value'] = temp['name'] + ' - ' + temp['external_references'][0]['external_id']
|
value['value'] = temp['name'] + ' - ' + temp['external_references'][0]['external_id']
|
||||||
value['meta'] = {}
|
value['meta'] = {}
|
||||||
value['meta']['refs'] = []
|
value['meta']['refs'] = []
|
||||||
|
value['meta']['external_id'] = []
|
||||||
for reference in temp['external_references']:
|
for reference in temp['external_references']:
|
||||||
if 'url' in reference and reference['url'] not in value['meta']['refs']:
|
if 'url' in reference and reference['url'] not in value['meta']['refs']:
|
||||||
value['meta']['refs'].append(reference['url'])
|
value['meta']['refs'].append(reference['url'])
|
||||||
if 'external_id' in reference:
|
if 'external_id' in reference and reference['external_id'] not in value['meta']['external_id]:
|
||||||
value['meta']['external_id'] = reference['external_id']
|
value['meta']['external_id'].append(reference['external_id'])
|
||||||
value['meta']['kill_chain'] = []
|
value['meta']['kill_chain'] = []
|
||||||
for killchain in temp['kill_chain_phases']:
|
for killchain in temp['kill_chain_phases']:
|
||||||
value['meta']['kill_chain'].append(killchain['kill_chain_name'] + ':enterprise-attack:' + killchain['phase_name'])
|
value['meta']['kill_chain'].append(killchain['kill_chain_name'] + ':enterprise-attack:' + killchain['phase_name'])
|
||||||
|
|
Loading…
Reference in a new issue