-
Notifications
You must be signed in to change notification settings - Fork 31
Open
Description
There is a huge difference in quality performance between using cortex4py and cortex API.
When I use cortex API to run analizer job with post requests I get valid response every time.
When I use cortex4py to do the same - the script fails at very high rate.
Consider two functions:
- Using cortex4py:
def run_vt(domain):
result = None
job = capi.analyzers.run_by_name('VirusTotal_GetReport_3_0', {
'data': str(domain),
'dataType': 'domain',
'tlp': 1,
'message': 'alerts verificiation'
}, force=1)
try:
result = job.json()
return result
except Exception as ex:
print(get_time_now(), status('EXPT'), 'Exception running VT analizer:', ex)
return result
return result- Using Cortex API directly:
def run_vt_request(domain):
headers = {}
headers.update(cortex_auth)
headers.update(content_type)
url = cortex_url + '/api/analyzer/ [id] /run'
j = {
'data': domain,
'dataType': 'domain',
'tlp': 1
}
resp = None
try:
resp = requests.post(url, headers=headers, json=j, verify=False)
return resp.json()
except Exception as ex:
print(get_time_now(), status('EXPT'), 'Exception running VT analizer:', ex)
return resp
return respFirst one fails a lot (HTTP Error 500, Invalid input exception).
Second did not failed once.
I suspect force parameter placement or interpretation in the cortex4py implementation might be at fault. I am not completely sure.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels