Trigger Scan for an AssetId

Cortex XSIAM Platform APIs

post /public_api/vulnerability-management/v1/scan

Trigger On demand Scan based on AssetId on one of CORTEX_NETWORK_SCANNER, CORTEX_XDR_AGENT, CORTEX_XDR_AGENTLESS scanners.

Required license: Cortex Cloud Runtime Security or Cortex Cloud Posture Management

Request headers
x-xdr-auth-id required
Authorization String required
Example: authorization_example
CLIENT REQUEST
curl -X 'POST'
-H 'Accept: application/json'
-H 'Content-Type: application/json'
-H 'x-xdr-auth-id: ' -H 'Authorization: authorization_example'
'https://api-yourfqdn/public_api/vulnerability-management/v1/scan'
-d '{ "scanner_type" : "", "scan_target" : "CONTAINER", "cve_id" : "cve_id", "asset_id" : "asset_id" }'
import http.client conn = http.client.HTTPSConnection("api-yourfqdn") payload = "{\"asset_id\":\"string\",\"scanner_type\":\"CORTEX_NETWORK_SCANNER\",\"cve_id\":\"string\",\"scan_target\":\"CONTAINER\"}" headers = { 'x-xdr-auth-id': "SOME_INTEGER_VALUE", 'Authorization': "SOME_STRING_VALUE", 'content-type': "application/json" } conn.request("POST", "/public_api/vulnerability-management/v1/scan", 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/vulnerability-management/v1/scan") 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["x-xdr-auth-id"] = 'SOME_INTEGER_VALUE' request["Authorization"] = 'SOME_STRING_VALUE' request["content-type"] = 'application/json' request.body = "{\"asset_id\":\"string\",\"scanner_type\":\"CORTEX_NETWORK_SCANNER\",\"cve_id\":\"string\",\"scan_target\":\"CONTAINER\"}" response = http.request(request) puts response.read_body
const data = JSON.stringify({ "asset_id": "string", "scanner_type": "CORTEX_NETWORK_SCANNER", "cve_id": "string", "scan_target": "CONTAINER" }); 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/vulnerability-management/v1/scan"); xhr.setRequestHeader("x-xdr-auth-id", "SOME_INTEGER_VALUE"); xhr.setRequestHeader("Authorization", "SOME_STRING_VALUE"); xhr.setRequestHeader("content-type", "application/json"); xhr.send(data);
HttpResponse<String> response = Unirest.post("https://api-yourfqdn/public_api/vulnerability-management/v1/scan") .header("x-xdr-auth-id", "SOME_INTEGER_VALUE") .header("Authorization", "SOME_STRING_VALUE") .header("content-type", "application/json") .body("{\"asset_id\":\"string\",\"scanner_type\":\"CORTEX_NETWORK_SCANNER\",\"cve_id\":\"string\",\"scan_target\":\"CONTAINER\"}") .asString();
import Foundation let headers = [ "x-xdr-auth-id": "SOME_INTEGER_VALUE", "Authorization": "SOME_STRING_VALUE", "content-type": "application/json" ] let parameters = [ "asset_id": "string", "scanner_type": "CORTEX_NETWORK_SCANNER", "cve_id": "string", "scan_target": "CONTAINER" ] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://api-yourfqdn/public_api/vulnerability-management/v1/scan")! 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/vulnerability-management/v1/scan", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "POST", CURLOPT_POSTFIELDS => "{\"asset_id\":\"string\",\"scanner_type\":\"CORTEX_NETWORK_SCANNER\",\"cve_id\":\"string\",\"scan_target\":\"CONTAINER\"}", CURLOPT_HTTPHEADER => [ "Authorization: SOME_STRING_VALUE", "content-type: application/json", "x-xdr-auth-id: SOME_INTEGER_VALUE" ], ]); $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/vulnerability-management/v1/scan"); struct curl_slist *headers = NULL; headers = curl_slist_append(headers, "x-xdr-auth-id: SOME_INTEGER_VALUE"); headers = curl_slist_append(headers, "Authorization: SOME_STRING_VALUE"); headers = curl_slist_append(headers, "content-type: application/json"); curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers); curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\"asset_id\":\"string\",\"scanner_type\":\"CORTEX_NETWORK_SCANNER\",\"cve_id\":\"string\",\"scan_target\":\"CONTAINER\"}"); CURLcode ret = curl_easy_perform(hnd);
var client = new RestClient("https://api-yourfqdn/public_api/vulnerability-management/v1/scan"); var request = new RestRequest(Method.POST); request.AddHeader("x-xdr-auth-id", "SOME_INTEGER_VALUE"); request.AddHeader("Authorization", "SOME_STRING_VALUE"); request.AddHeader("content-type", "application/json"); request.AddParameter("application/json", "{\"asset_id\":\"string\",\"scanner_type\":\"CORTEX_NETWORK_SCANNER\",\"cve_id\":\"string\",\"scan_target\":\"CONTAINER\"}", ParameterType.RequestBody); IRestResponse response = client.Execute(request);
Body parameters
required
application/json

Request model for triggering a vulnerability scan

asset_idstringrequired

The unique identifier of the asset to scan

scanner_typeobjectrequired

The type of scanner to use for the scan

string (Enum)

Type of vulnerability scanner

Allowed values:"CORTEX_NETWORK_SCANNER""CORTEX_XDR_AGENT""CORTEX_XDR_AGENTLESS"
cve_idstring

CVE identifier (e.g., 'CVE-2024-1234'). Required when scanner_type is CORTEX_NETWORK_SCANNER, optional for other scanner types.

scan_targetstring (Enum)

Scan Target (e.g., 'CONTAINER' or 'HOST' or 'IMAGE'). Required when scanner_type is CORTEX_XDR_AGENT and its Linux endpoint, optional for other scanner types.

Allowed values:"CONTAINER""HOST""IMAGE"
REQUEST
{ "asset_id": "example", "scanner_type": "CORTEX_NETWORK_SCANNER", "cve_id": "example", "scan_target": "CONTAINER" }
Responses

Successful Response

Body
application/json

Response model for scan trigger operation

messagestringrequired
scan_idinteger
RESPONSE
{ "message": "example", "scan_id": 0 }

Validation Error

Body
application/json
detailarray
[
locarrayrequired
[
string
integer
]
msgstringrequired
typestringrequired
]
RESPONSE
{ "detail": [ { "loc": [ 0 ], "msg": "example", "type": "example" } ] }