dxlthehiveservice.thehive_client module

class dxlthehiveservice.thehive_client.TheHiveClient(dxl_client, api_url, api_principal, api_password, verify_certificate)

Bases: object

HTTP client through which requests to TheHive server should be sent.

Constructor parameters:

Parameters:
  • dxl_client (dxlclient.client.DxlClient) -- DXL client through which responses can be sent.
  • api_url (str) -- URL of TheHive API server.
  • api_principal (str) -- API key or username to use for requests made to TheHive server. The value is treated as a username only if a non-empty value is specified for the api_password parameter.
  • api_password (str) -- API password to use for requests made to TheHive server.
  • verify_certificate -- For a value of False, do not verify the server certificate in requests. For a value of True, verify the server certificate using the default trust store. For a string value, read the associated file name contents and use as a certificate trust store.
get(dxl_request, path)

Perform an HTTP GET request to TheHive server, delivering the response to the DXL fabric.

Parameters:
  • dxl_request (dxlclient.message.Request) -- DXL request containing parameters to forward along in a request to TheHive server.
  • path (str) -- URL subpath for the request to send to TheHive server.
post(dxl_request, path, body=None)

Perform an HTTP POST request to TheHive server, delivering the response to the DXL fabric.

Parameters:
  • dxl_request (dxlclient.message.Request) -- DXL request containing parameters to forward along in a request to TheHive server.
  • path (str) -- URL subpath for the request to send to TheHive server.
  • body (str) -- Body to include in the HTTP request.