Merge branch 'hotfix/1.9.2'

This commit is contained in:
Nabil Adouani 2018-04-04 11:20:20 +02:00
commit c5100de872
4 changed files with 8 additions and 7 deletions

View File

@ -95,8 +95,9 @@ class VxStreamSandboxAnalyzer(Analyzer):
error = True
while error:
r = requests.get(url, headers=self.headers, auth=HTTPBasicAuth(self.api_key, self.secret), verify=False)
if "error" in r.json().get('response') == "Exceeded maximum API requests per minute(5). Please try again later.":
time.sleep(60)
if "error" in r.json().get('response'):
if "Exceeded maximum API requests per minute(5)" in r.json().get('response').get('error'):
time.sleep(60)
else:
error = False

View File

@ -9,9 +9,7 @@ from cortexutils.analyzer import Analyzer
class OTXQueryAnalyzer(Analyzer):
def __init__(self):
Analyzer.__init__(self)
self.service = self.get_param(
'config.service', None, 'Service parameter is missing')
Analyzer.__init__(self)
self.otx_key = self.get_param('config.key', None, 'Missing OTX API key')
def _get_headers(self):

View File

@ -41,7 +41,7 @@ class Analyzer:
self.artifact = self.__input
# Check for auto extraction config
self.auto_extract = self.get_param('config.auto_extract', True)
self.auto_extract = self.get_param('config.auto_extract', self.get_param('config.auto_extract_artifacts', True))
# Not breaking compatibility
def notSupported(self):
@ -119,6 +119,8 @@ class Analyzer:
"""Wrapper for getting data from input dict.
:return: Data (observable value) given through Cortex"""
if self.data_type == 'file':
return self.get_param('filename', None, 'Missing filename.')
return self.get_param('data', None, 'Missing data field')
def get_param(self, name, default=None, message=None):

View File

@ -2,7 +2,7 @@ from setuptools import setup
setup(
name='cortexutils',
version='1.2.2',
version='1.2.3',
description='A Python library for including utility classes for Cortex analyzers',
long_description=open('README').read(),
author='TheHive-Project',