Skip to content

Instantly share code, notes, and snippets.

@jeffbryner
Created February 10, 2014 16:03
Show Gist options
  • Save jeffbryner/8918508 to your computer and use it in GitHub Desktop.
Save jeffbryner/8918508 to your computer and use it in GitHub Desktop.
dump the veris framework to a item.item.value structure
#!/usr/bin/env python
import json
vDict=json.loads(open('verisc-enum.json').read())
def dict_walker(inCollection, pre=None):
pre = pre[:] if pre else []
#print(pre)
if isinstance(inCollection, dict):
for key, value in inCollection.iteritems():
if isinstance(value, dict):
for d in dict_walker(value, pre+ [key]):
yield d
elif isinstance(value, list) or isinstance(value, tuple):
for v in value:
for d in dict_walker(v, pre+ [key] ):
yield d
else:
print(end)
yield '.'.join(pre) + '.' + d
elif isinstance(inCollection, list) or isinstance(inCollection, tuple):
for v in inCollection:
for d in dict_walker(v, pre ):
yield d
else:
yield '.'.join(pre) + '.' + inCollection
for key in vDict.keys():
for y in dict_walker(vDict[key],[key]):
print(y)
@jeffbryner
Copy link
Author

Download: https://github.com/vz-risk/veris/blob/master/verisc-enum.json, run this and get category.category.value VERIS values like this:

./verisTagDump.py
action.physical.location.Victim grounds
action.physical.location.Unknown
action.physical.location.Other
action.physical.variety.Assault
action.physical.variety.Sabotage
action.physical.variety.Snooping
action.physical.variety.Surveillance
...
confidence.High
confidence.Medium
confidence.Low
confidence.None

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment