From cb6f155b9800c8e0e2841c7ae086e806935642c2 Mon Sep 17 00:00:00 2001 From: Danny Elliott Date: Tue, 5 Mar 2019 16:50:01 -0400 Subject: [PATCH] fix: pass aql query to qradar as data instead of urldata (#121) --- .../src/modules/qradar/arielapiclient.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/stix_shifter/stix_transmission/src/modules/qradar/arielapiclient.py b/stix_shifter/stix_transmission/src/modules/qradar/arielapiclient.py index 2fe3e6e50..9c28d9522 100644 --- a/stix_shifter/stix_transmission/src/modules/qradar/arielapiclient.py +++ b/stix_shifter/stix_transmission/src/modules/qradar/arielapiclient.py @@ -36,13 +36,13 @@ def __init__(self, connection, configuration): headers['proxy-authorization'] = 'Basic ' + proxy_auth if proxy.get('x_forward_proxy', None) is not None: headers['x-forward-url'] = 'https://' + \ - host_port + '/'# + endpoint, is set by 'add_endpoint_to_url_header' + host_port + '/' # + endpoint, is set by 'add_endpoint_to_url_header' host_port = proxy.get('x_forward_proxy') if proxy.get('x_forward_proxy_auth', None) is not None: headers['x-forward-auth'] = proxy.get('x_forward_proxy_auth') headers['user-agent'] = 'UDS' url_modifier_function = self.add_endpoint_to_url_header - + self.client = RestApiClient(host_port, None, connection.get('cert', None), @@ -50,7 +50,7 @@ def __init__(self, connection, configuration): url_modifier_function, connection.get('cert_verify', 'True') ) - + def add_endpoint_to_url_header(self, url, endpoint, headers): # this function is called from 'call_api' with proxy forwarding, # it concatenates the endpoint to the header containing the url. @@ -59,35 +59,35 @@ def add_endpoint_to_url_header(self, url, endpoint, headers): return url def ping_box(self): - # Sends a GET request + # Sends a GET request # to https:///api/help/resources endpoint = 'api/help/resources' # no 'ariel' in the path return self.client.call_api(endpoint, 'GET') def get_databases(self): - # Sends a GET request + # Sends a GET request # to https:///api/ariel/databases endpoint = self.endpoint_start + 'databases' return self.client.call_api(endpoint, 'GET') def get_database(self, database_name): - # Sends a GET request + # Sends a GET request # to https:///api/ariel/databases/ endpoint = self.endpoint_start + 'databases' + '/' + database_name return self.client.call_api(endpoint, 'GET') def get_searches(self): - # Sends a GET request + # Sends a GET request # to https:///api/ariel/searches endpoint = self.endpoint_start + "searches" return self.client.call_api(endpoint, 'GET') def create_search(self, query_expression): - # Sends a POST request + # Sends a POST request # to https:///api/ariel/searches endpoint = self.endpoint_start + "searches" data = {'query_expression': query_expression} - return self.client.call_api(endpoint, 'POST', urldata=data) + return self.client.call_api(endpoint, 'POST', data=data) def get_search(self, search_id): # Sends a GET request to