2016-04-28 14:44:01 +02:00
|
|
|
#!/usr/bin/env python
|
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
|
|
|
|
from pymisp import PyMISP
|
|
|
|
from keys import misp_url, misp_key, misp_verifycert
|
|
|
|
import argparse
|
|
|
|
|
|
|
|
|
|
|
|
def init(url, key):
|
|
|
|
return PyMISP(url, key, misp_verifycert, 'json')
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
parser = argparse.ArgumentParser(description='Output attributes statistics from a MISP instance.')
|
|
|
|
args = parser.parse_args()
|
|
|
|
|
|
|
|
misp = init(misp_url, misp_key)
|
|
|
|
|
2016-04-28 15:05:31 +02:00
|
|
|
print (misp.get_attributes_statistics(misp, percentage=True))
|
|
|
|
print (misp.get_attributes_statistics(context='category', percentage=True))
|