Make client_certs out of the box friendly

pull/452/head
Campbell McKenzie 2019-09-12 12:42:22 +10:00
parent b800dcb4b4
commit 0fad4d9640
2 changed files with 8 additions and 2 deletions

View File

@ -4,3 +4,4 @@
misp_url = 'https://<your MISP URL>/'
misp_key = 'Your MISP auth key' # The MISP auth key can be found on the MISP web interface under the automation section
misp_verifycert = True
misp_client_cert = ''

View File

@ -2,7 +2,7 @@
# -*- coding: utf-8 -*-
from pymisp import ExpandedPyMISP
from keys import misp_url, misp_key, misp_verifycert
from keys import misp_url, misp_key, misp_verifycert, misp_client_cert
import argparse
import os
@ -23,7 +23,12 @@ if __name__ == '__main__':
print('Output file already exists, aborted.')
exit(0)
misp = ExpandedPyMISP(misp_url, misp_key, misp_verifycert)
if misp_client_cert == '':
misp_client_cert = None
else:
misp_client_cert = (misp_client_cert)
misp = ExpandedPyMISP(misp_url, misp_key, misp_verifycert, cert=misp_client_cert)
result = misp.search(publish_timestamp=args.last, limit=args.limit, page=args.page, pythonify=True)
if not result: