add: mapping of taxonomy added in the asciidoc output

pull/75/head
Alexandre Dulaunoy 2017-10-24 07:49:19 +02:00
parent d0e7e5e419
commit cd51e9148e
No known key found for this signature in database
GPG Key ID: 09E2CD4944E6CBCD
1 changed files with 11 additions and 0 deletions

View File

@ -146,5 +146,16 @@ for taxonomy in taxonomies:
if'expanded' in v:
print("--> " + machineTag(namespace=namespace, predicate=expanded, value=v['expanded']))
with open('../mapping/mapping.json') as mapping:
m = json.load(mapping)
output = '\n= Mapping of taxonomies\n'
output = '{}{}'.format(output, 'Analysts relying on taxonomies don\'t always know the appropriate namespace to use but know which value to use for classification. The MISP mapping taxonomy allows to map a single classification into a series of machine-tag synonyms.\n')
for value in sorted(m.keys()):
output = '{}{} **{}**{}{}\n'.format(output,'\n.Mapping table - ',value,'\n|===\n|',value)
for mapped in m[value]['values']:
output = '{}|{}\n'.format(output,mapped)
output = '{}|===\n'.format(output)
doc = doc + output
if args.a:
print(doc)