From 0fad4d964004f53f2a1f7ddc627dd7b7fc70ba6f Mon Sep 17 00:00:00 2001 From: Campbell McKenzie Date: Thu, 12 Sep 2019 12:42:22 +1000 Subject: [PATCH] Make client_certs out of the box friendly --- examples/keys.py.sample | 1 + examples/last.py | 9 +++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/examples/keys.py.sample b/examples/keys.py.sample index 168b765..c3f8d0a 100644 --- a/examples/keys.py.sample +++ b/examples/keys.py.sample @@ -4,3 +4,4 @@ misp_url = 'https:///' 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 = '' diff --git a/examples/last.py b/examples/last.py index 89ba7be..207b0f8 100755 --- a/examples/last.py +++ b/examples/last.py @@ -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: