Create a new data source instance to connect an external system to your Cortex environment.
Required license:
Cortex XSIAM Premium. In Cortex XSIAM Enterprise and Cortex NG SIEM, requires the Cortex Cloud Posture Management add-on. Not supported in XSIAM Enterprise Plus.
Authorization
String
required
{api_key}
{api_key}
your_api_key_here
x-xdr-auth-id
String
required
{api_key_id}
{api_key_id}
1
curl -X 'POST'
-H
'Accept: application/json'
-H
'Content-Type: application/json'
-H
'Authorization: your_api_key_here'
-H
'x-xdr-auth-id: 1'
'https://api-yourfqdn/public_api/appsec/v1/data_source_instances'
-d
'{
"selfSignedCertificate" : "selfSignedCertificate",
"credentials" : {
"password" : "password",
"clientId" : "clientId",
"webhookAuthKeyId" : "webhookAuthKeyId",
"webhookAuthKey" : "webhookAuthKey",
"clientSecret" : "clientSecret",
"token" : "token",
"refreshToken" : "refreshToken",
"username" : "username"
},
"domain" : {
"hostname" : "hostname"
},
"transporter" : {
"connectionName" : "connectionName",
"brokerDeviceId" : "brokerDeviceId"
},
"uniqueProperties" : "{}"
}'
import http.client
conn = http.client.HTTPSConnection("api-yourfqdn")
payload = "{\"type\":\"COLLECTOR\",\"domain\":{\"hostname\":\"string\",\"protocol\":\"http\"},\"credentials\":{\"type\":\"OAUTH\",\"token\":\"string\",\"refreshToken\":\"string\",\"clientId\":\"string\",\"clientSecret\":\"string\",\"username\":\"string\",\"password\":\"string\",\"webhookAuthKeyId\":\"string\",\"webhookAuthKey\":\"string\"},\"uniqueProperties\":{},\"status\":\"COMPLETED\",\"transporter\":{\"brokerDeviceId\":\"string\",\"connectionName\":\"string\"},\"selfSignedCertificate\":\"string\"}"
headers = {
'Authorization': "your_api_key_here",
'x-xdr-auth-id': "1",
'content-type': "application/json"
}
conn.request("POST", "/public_api/appsec/v1/data_source_instances", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://api-yourfqdn/public_api/appsec/v1/data_source_instances")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'your_api_key_here'
request["x-xdr-auth-id"] = '1'
request["content-type"] = 'application/json'
request.body = "{\"type\":\"COLLECTOR\",\"domain\":{\"hostname\":\"string\",\"protocol\":\"http\"},\"credentials\":{\"type\":\"OAUTH\",\"token\":\"string\",\"refreshToken\":\"string\",\"clientId\":\"string\",\"clientSecret\":\"string\",\"username\":\"string\",\"password\":\"string\",\"webhookAuthKeyId\":\"string\",\"webhookAuthKey\":\"string\"},\"uniqueProperties\":{},\"status\":\"COMPLETED\",\"transporter\":{\"brokerDeviceId\":\"string\",\"connectionName\":\"string\"},\"selfSignedCertificate\":\"string\"}"
response = http.request(request)
puts response.read_bodyconst data = JSON.stringify({
"type": "COLLECTOR",
"domain": {
"hostname": "string",
"protocol": "http"
},
"credentials": {
"type": "OAUTH",
"token": "string",
"refreshToken": "string",
"clientId": "string",
"clientSecret": "string",
"username": "string",
"password": "string",
"webhookAuthKeyId": "string",
"webhookAuthKey": "string"
},
"uniqueProperties": {},
"status": "COMPLETED",
"transporter": {
"brokerDeviceId": "string",
"connectionName": "string"
},
"selfSignedCertificate": "string"
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://api-yourfqdn/public_api/appsec/v1/data_source_instances");
xhr.setRequestHeader("Authorization", "your_api_key_here");
xhr.setRequestHeader("x-xdr-auth-id", "1");
xhr.setRequestHeader("content-type", "application/json");
xhr.send(data);HttpResponse<String> response = Unirest.post("https://api-yourfqdn/public_api/appsec/v1/data_source_instances")
.header("Authorization", "your_api_key_here")
.header("x-xdr-auth-id", "1")
.header("content-type", "application/json")
.body("{\"type\":\"COLLECTOR\",\"domain\":{\"hostname\":\"string\",\"protocol\":\"http\"},\"credentials\":{\"type\":\"OAUTH\",\"token\":\"string\",\"refreshToken\":\"string\",\"clientId\":\"string\",\"clientSecret\":\"string\",\"username\":\"string\",\"password\":\"string\",\"webhookAuthKeyId\":\"string\",\"webhookAuthKey\":\"string\"},\"uniqueProperties\":{},\"status\":\"COMPLETED\",\"transporter\":{\"brokerDeviceId\":\"string\",\"connectionName\":\"string\"},\"selfSignedCertificate\":\"string\"}")
.asString();import Foundation
let headers = [
"Authorization": "your_api_key_here",
"x-xdr-auth-id": "1",
"content-type": "application/json"
]
let parameters = [
"type": "COLLECTOR",
"domain": [
"hostname": "string",
"protocol": "http"
],
"credentials": [
"type": "OAUTH",
"token": "string",
"refreshToken": "string",
"clientId": "string",
"clientSecret": "string",
"username": "string",
"password": "string",
"webhookAuthKeyId": "string",
"webhookAuthKey": "string"
],
"uniqueProperties": [],
"status": "COMPLETED",
"transporter": [
"brokerDeviceId": "string",
"connectionName": "string"
],
"selfSignedCertificate": "string"
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "https://api-yourfqdn/public_api/appsec/v1/data_source_instances")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api-yourfqdn/public_api/appsec/v1/data_source_instances",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "{\"type\":\"COLLECTOR\",\"domain\":{\"hostname\":\"string\",\"protocol\":\"http\"},\"credentials\":{\"type\":\"OAUTH\",\"token\":\"string\",\"refreshToken\":\"string\",\"clientId\":\"string\",\"clientSecret\":\"string\",\"username\":\"string\",\"password\":\"string\",\"webhookAuthKeyId\":\"string\",\"webhookAuthKey\":\"string\"},\"uniqueProperties\":{},\"status\":\"COMPLETED\",\"transporter\":{\"brokerDeviceId\":\"string\",\"connectionName\":\"string\"},\"selfSignedCertificate\":\"string\"}",
CURLOPT_HTTPHEADER => [
"Authorization: your_api_key_here",
"content-type: application/json",
"x-xdr-auth-id: 1"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "https://api-yourfqdn/public_api/appsec/v1/data_source_instances");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "Authorization: your_api_key_here");
headers = curl_slist_append(headers, "x-xdr-auth-id: 1");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\"type\":\"COLLECTOR\",\"domain\":{\"hostname\":\"string\",\"protocol\":\"http\"},\"credentials\":{\"type\":\"OAUTH\",\"token\":\"string\",\"refreshToken\":\"string\",\"clientId\":\"string\",\"clientSecret\":\"string\",\"username\":\"string\",\"password\":\"string\",\"webhookAuthKeyId\":\"string\",\"webhookAuthKey\":\"string\"},\"uniqueProperties\":{},\"status\":\"COMPLETED\",\"transporter\":{\"brokerDeviceId\":\"string\",\"connectionName\":\"string\"},\"selfSignedCertificate\":\"string\"}");
CURLcode ret = curl_easy_perform(hnd);var client = new RestClient("https://api-yourfqdn/public_api/appsec/v1/data_source_instances");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "your_api_key_here");
request.AddHeader("x-xdr-auth-id", "1");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\"type\":\"COLLECTOR\",\"domain\":{\"hostname\":\"string\",\"protocol\":\"http\"},\"credentials\":{\"type\":\"OAUTH\",\"token\":\"string\",\"refreshToken\":\"string\",\"clientId\":\"string\",\"clientSecret\":\"string\",\"username\":\"string\",\"password\":\"string\",\"webhookAuthKeyId\":\"string\",\"webhookAuthKey\":\"string\"},\"uniqueProperties\":{},\"status\":\"COMPLETED\",\"transporter\":{\"brokerDeviceId\":\"string\",\"connectionName\":\"string\"},\"selfSignedCertificate\":\"string\"}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);Define the integration configuration
typestring (Enum)requiredType of the data source instance, indicating the external system it connects to.
Type of the data source instance, indicating the external system it connects to.
domainobjectDomain configuration specifying the hostname and protocol for the data source instance
Domain configuration specifying the hostname and protocol for the data source instance
hostnamestringrequiredHostname or domain name of the external data source.
Hostname or domain name of the external data source.
protocolstring (Enum)requiredCommunication protocol used to connect to the data source.
Communication protocol used to connect to the data source.
credentialsobjectAuthentication credentials required to connect to the external data source. All properties are optional to support different authentication methods.
Authentication credentials required to connect to the external data source. All properties are optional to support different authentication methods.
typestring (Enum)Type of authentication method used for the data source connection.
Type of authentication method used for the data source connection.
tokenstringAuthentication token, such as a personal access token (PAT), used to authenticate with the data source.
Authentication token, such as a personal access token (PAT), used to authenticate with the data source.
refreshTokenstringRefresh token used to obtain a new authentication token when the current one expires.
Refresh token used to obtain a new authentication token when the current one expires.
clientIdstringClient ID for OAuth-based authentication with the data source.
Client ID for OAuth-based authentication with the data source.
clientSecretstringClient secret for OAuth-based authentication with the data source.
Client secret for OAuth-based authentication with the data source.
usernamestringUsername for basic authentication with the data source.
Username for basic authentication with the data source.
passwordstringPassword for basic authentication with the data source.
Password for basic authentication with the data source.
webhookAuthKeyIdstringWebhook authentication key ID used for webhook-based integrations.
Webhook authentication key ID used for webhook-based integrations.
webhookAuthKeystringAuthentication key used to validate incoming webhook requests from the data source.
Authentication key used to validate incoming webhook requests from the data source.
uniquePropertiesobjectA flexible key-value map for specifying additional properties. Keys are strings and values can be of any type.
A flexible key-value map for specifying additional properties. Keys are strings and values can be of any type.
statusstring (Enum)Current connection status of the data source instance.
COMPLETED — The data source instance setup is complete and operational.
CONNECTED — The data source instance is actively connected.
DESTROYING — The data source instance is being removed.
DISABLED — The data source instance is disabled and not actively scanning.
ERROR — The data source instance encountered an error and requires attention.
PENDING — The data source instance is being set up and is not yet active.
TEMPORARY — The data source instance is in a temporary state during configuration.
TRANSPORTER_CONNECTION_DISABLED — The transporter connection for this data source instance is disabled.
WARNING — The data source instance is operational but has warnings that may require attention.
Current connection status of the data source instance.
COMPLETED— The data source instance setup is complete and operational.CONNECTED— The data source instance is actively connected.DESTROYING— The data source instance is being removed.DISABLED— The data source instance is disabled and not actively scanning.ERROR— The data source instance encountered an error and requires attention.PENDING— The data source instance is being set up and is not yet active.TEMPORARY— The data source instance is in a temporary state during configuration.TRANSPORTER_CONNECTION_DISABLED— The transporter connection for this data source instance is disabled.WARNING— The data source instance is operational but has warnings that may require attention.
transporterobjectTransporter configuration for establishing secure communication between an on-premises or private data source and Cortex.
Transporter configuration for establishing secure communication between an on-premises or private data source and Cortex.
brokerDeviceIdstringrequiredUnique identifier of the broker device used for the transporter connection.
Unique identifier of the broker device used for the transporter connection.
connectionNamestringrequiredName of the transporter connection.
Name of the transporter connection.
selfSignedCertificatestringPEM-encoded self-signed certificate for secure communication.
PEM-encoded self-signed certificate for secure communication.
{
"type": "COLLECTOR",
"uniqueProperties": {
"name": "my-sast-collector",
"detectionMethod": "SAST",
"fileType": "SARIF"
}
}