Compliance controls are measures related to the standard that ensure compliance and mitigate risks. Controls are built from one or more rules, the specific checks that run on an asset. Controls can be grouped into categories, for example RBAC and Pod security.
Retrieve compliance control details with optional filtering, sorting and pagination.
- The response is concatenated using AND condition (OR is not supported)
- The maximum result set size is >100
- Offset is the zero-based number of assessment profiles from the start of the result set
Required license: Cortex Cloud Runtime Security or Cortex Cloud Posture Management
curl -X 'POST'
-H "Authorization: [[apiKey]]"
\
-H "x-xdr-auth-id: [[apiKey]]"
\
-H
'Accept: application/json'
-H
'Content-Type: application/json'
'https://api-yourfqdn/public_api/v1/compliance/get_controls'
-d
''
import http.client
conn = http.client.HTTPSConnection("api-yourfqdn")
payload = "{\"request_data\":{\"filters\":[{\"field\":\"name\",\"operator\":\"eq\",\"value\":\"string\"}],\"sort\":{\"field\":\"name\",\"keyword\":\"asc\"},\"search_from\":0,\"search_to\":100}}"
headers = {
'x-xdr-auth-id': "REPLACE_KEY_VALUE",
'content-type': "application/json"
}
conn.request("POST", "/public_api/v1/compliance/get_controls", 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/v1/compliance/get_controls")
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"] = 'REPLACE_KEY_VALUE'
request["content-type"] = 'application/json'
request.body = "{\"request_data\":{\"filters\":[{\"field\":\"name\",\"operator\":\"eq\",\"value\":\"string\"}],\"sort\":{\"field\":\"name\",\"keyword\":\"asc\"},\"search_from\":0,\"search_to\":100}}"
response = http.request(request)
puts response.read_bodyconst data = JSON.stringify({
"request_data": {
"filters": [
{
"field": "name",
"operator": "eq",
"value": "string"
}
],
"sort": {
"field": "name",
"keyword": "asc"
},
"search_from": 0,
"search_to": 100
}
});
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/v1/compliance/get_controls");
xhr.setRequestHeader("x-xdr-auth-id", "REPLACE_KEY_VALUE");
xhr.setRequestHeader("content-type", "application/json");
xhr.send(data);HttpResponse<String> response = Unirest.post("https://api-yourfqdn/public_api/v1/compliance/get_controls")
.header("x-xdr-auth-id", "REPLACE_KEY_VALUE")
.header("content-type", "application/json")
.body("{\"request_data\":{\"filters\":[{\"field\":\"name\",\"operator\":\"eq\",\"value\":\"string\"}],\"sort\":{\"field\":\"name\",\"keyword\":\"asc\"},\"search_from\":0,\"search_to\":100}}")
.asString();import Foundation
let headers = [
"x-xdr-auth-id": "REPLACE_KEY_VALUE",
"content-type": "application/json"
]
let parameters = ["request_data": [
"filters": [
[
"field": "name",
"operator": "eq",
"value": "string"
]
],
"sort": [
"field": "name",
"keyword": "asc"
],
"search_from": 0,
"search_to": 100
]] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "https://api-yourfqdn/public_api/v1/compliance/get_controls")! 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/v1/compliance/get_controls",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "{\"request_data\":{\"filters\":[{\"field\":\"name\",\"operator\":\"eq\",\"value\":\"string\"}],\"sort\":{\"field\":\"name\",\"keyword\":\"asc\"},\"search_from\":0,\"search_to\":100}}",
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-xdr-auth-id: REPLACE_KEY_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/v1/compliance/get_controls");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-xdr-auth-id: REPLACE_KEY_VALUE");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\"request_data\":{\"filters\":[{\"field\":\"name\",\"operator\":\"eq\",\"value\":\"string\"}],\"sort\":{\"field\":\"name\",\"keyword\":\"asc\"},\"search_from\":0,\"search_to\":100}}");
CURLcode ret = curl_easy_perform(hnd);var client = new RestClient("https://api-yourfqdn/public_api/v1/compliance/get_controls");
var request = new RestRequest(Method.POST);
request.AddHeader("x-xdr-auth-id", "REPLACE_KEY_VALUE");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\"request_data\":{\"filters\":[{\"field\":\"name\",\"operator\":\"eq\",\"value\":\"string\"}],\"sort\":{\"field\":\"name\",\"keyword\":\"asc\"},\"search_from\":0,\"search_to\":100}}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);request_dataobject
filtersarray
fieldstring (Enum)requiredIdentifies the compliance control field the filter should match. Filters are based on the following keywords:
name: Compliance control name
category : Compliance control category
subcategory: Compliance control subcategory
description: Compliance control description
created_by: Creator of the compliance control
modified_by: Modifier of the compliance control
id: Compliance control ID
creation_time: Compliance control's creation time
modification_time: Compliance control's modification time
is_custom: Whether the compliance control is custom
Identifies the compliance control field the filter should match. Filters are based on the following keywords:
name: Compliance control namecategory: Compliance control categorysubcategory: Compliance control subcategorydescription: Compliance control descriptioncreated_by: Creator of the compliance controlmodified_by: Modifier of the compliance controlid: Compliance control IDcreation_time: Compliance control's creation timemodification_time: Compliance control's modification timeis_custom: Whether the compliance control is custom
operatorobject (Enum)requiredIdentifies the comparison operator you want to use for this filter. Valid keywords are:
eq / neq / contains / not_contains:
name, category, subcategory, created_by, modified_by, id, description: String
gte, lte, range, relative_timestamp:
creation_time, modification_time: Integer in timestamp epoch milliseconds
in:
is_custom: valid values are yes or no
Identifies the comparison operator you want to use for this filter. Valid keywords are:
eq / neq / contains / not_contains:
name,category,subcategory,created_by,modified_by,id,description: String
gte, lte, range, relative_timestamp:
creation_time,modification_time: Integer in timestamp epoch milliseconds
in:
is_custom: valid values areyesorno
valueobjectrequiredValue that this filter must match. The contents of this field will differ depending on the assessment profile field that you specified for this filter.
Value that this filter must match. The contents of this field will differ depending on the assessment profile field that you specified for this filter.
stringWhen the field value is one of the following, the value is type string: name, category, subcategory, created_by, modified_by, id, description
When the field value is one of the following, the value is type string: name, category, subcategory, created_by, modified_by, id, description
integerWhen the field value is one of the following, the value is type integer: creation_time, modification_time
When the field value is one of the following, the value is type integer: creation_time, modification_time
sortobject
fieldstring (Enum)Sort according to this field
Sort according to this field
"creation_time"keywordstring (Enum)Sort in ascending (asc) or descending (desc) order
Sort in ascending (asc) or descending (desc) order
"asc"search_fromintegerInteger representing the starting offset within the query result set from which you want compliance controls returned.
Compliance controls are returned as a zero-based list. Any compliance control indexed less than this value is not returned in the final result set and defaults to zero.
Integer representing the starting offset within the query result set from which you want compliance controls returned. Compliance controls are returned as a zero-based list. Any compliance control indexed less than this value is not returned in the final result set and defaults to zero.
search_tointegerInteger representing the end offset within the result set after which you do not want compliance controls returned.
Compliance controls in the compliance control list that are indexed higher than this value are not returned in the final results set. Defaults to >100, which returns all compliance controls to the end of the list.
Integer representing the end offset within the result set after which you do not want compliance controls returned. Compliance controls in the compliance control list that are indexed higher than this value are not returned in the final results set. Defaults to >100, which returns all compliance controls to the end of the list.
100{
"request_data": {
"filters": [
{
"field": "name",
"operator": "contains",
"value": "Access Enforcement"
}
]
}
}{
"request_data": {
"filters": [
{
"field": "is_custom",
"operator": "in",
"value": [
"yes"
]
}
]
}
}{
"request_data": {
"filters": [
{
"field": "creation_time",
"operator": "gte",
"value": 1640995200000
},
{
"field": "creation_time",
"operator": "lte",
"value": 1672531200000
}
]
}
}