mirror of
https://github.com/valitydev/Cortex-Analyzers.git
synced 2024-11-07 09:28:58 +00:00
Merge branch 'hotfix/1.9.2'
This commit is contained in:
commit
c5100de872
@ -95,8 +95,9 @@ class VxStreamSandboxAnalyzer(Analyzer):
|
|||||||
error = True
|
error = True
|
||||||
while error:
|
while error:
|
||||||
r = requests.get(url, headers=self.headers, auth=HTTPBasicAuth(self.api_key, self.secret), verify=False)
|
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.":
|
if "error" in r.json().get('response'):
|
||||||
time.sleep(60)
|
if "Exceeded maximum API requests per minute(5)" in r.json().get('response').get('error'):
|
||||||
|
time.sleep(60)
|
||||||
else:
|
else:
|
||||||
error = False
|
error = False
|
||||||
|
|
||||||
|
@ -10,8 +10,6 @@ from cortexutils.analyzer import Analyzer
|
|||||||
class OTXQueryAnalyzer(Analyzer):
|
class OTXQueryAnalyzer(Analyzer):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
Analyzer.__init__(self)
|
Analyzer.__init__(self)
|
||||||
self.service = self.get_param(
|
|
||||||
'config.service', None, 'Service parameter is missing')
|
|
||||||
self.otx_key = self.get_param('config.key', None, 'Missing OTX API key')
|
self.otx_key = self.get_param('config.key', None, 'Missing OTX API key')
|
||||||
|
|
||||||
def _get_headers(self):
|
def _get_headers(self):
|
||||||
|
@ -41,7 +41,7 @@ class Analyzer:
|
|||||||
self.artifact = self.__input
|
self.artifact = self.__input
|
||||||
|
|
||||||
# Check for auto extraction config
|
# 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
|
# Not breaking compatibility
|
||||||
def notSupported(self):
|
def notSupported(self):
|
||||||
@ -119,6 +119,8 @@ class Analyzer:
|
|||||||
"""Wrapper for getting data from input dict.
|
"""Wrapper for getting data from input dict.
|
||||||
|
|
||||||
:return: Data (observable value) given through Cortex"""
|
: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')
|
return self.get_param('data', None, 'Missing data field')
|
||||||
|
|
||||||
def get_param(self, name, default=None, message=None):
|
def get_param(self, name, default=None, message=None):
|
||||||
|
@ -2,7 +2,7 @@ from setuptools import setup
|
|||||||
|
|
||||||
setup(
|
setup(
|
||||||
name='cortexutils',
|
name='cortexutils',
|
||||||
version='1.2.2',
|
version='1.2.3',
|
||||||
description='A Python library for including utility classes for Cortex analyzers',
|
description='A Python library for including utility classes for Cortex analyzers',
|
||||||
long_description=open('README').read(),
|
long_description=open('README').read(),
|
||||||
author='TheHive-Project',
|
author='TheHive-Project',
|
||||||
|
Loading…
Reference in New Issue
Block a user