Skip to content

Commit

Permalink
fix: pass aql query to qradar as data instead of urldata (#121)
Browse files Browse the repository at this point in the history
  • Loading branch information
delliott90 authored and yurii-klymenko committed Mar 5, 2019
1 parent a4f4b07 commit cb6f155
Showing 1 changed file with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,21 +36,21 @@ 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),
headers,
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.
Expand All @@ -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://<server_ip>/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://<server_ip>/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://<server_ip>/api/ariel/databases/<database_name>
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://<server_ip>/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://<server_ip>/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
Expand Down

0 comments on commit cb6f155

Please sign in to comment.