Merge pull request #452 from camAtGitHub/master

Make client_certs out of the box friendly
pull/464/head
Raphaël Vinot 2019-09-12 13:42:34 +02:00 committed by GitHub
commit 1a8ceacee1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 2 deletions

View File

@ -4,3 +4,4 @@
misp_url = 'https://<your MISP URL>/' 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_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_verifycert = True
misp_client_cert = ''

View File

@ -2,7 +2,7 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
from pymisp import ExpandedPyMISP 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 argparse
import os import os
@ -23,7 +23,12 @@ if __name__ == '__main__':
print('Output file already exists, aborted.') print('Output file already exists, aborted.')
exit(0) 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) result = misp.search(publish_timestamp=args.last, limit=args.limit, page=args.page, pythonify=True)
if not result: if not result: