Go to Modules, then select Application Security > Policy Management > AppSec Policies.
Required license:
Cortex XSIAM Premium. In Cortex XSIAM Enterprise and Cortex NG SIEM, requires the Cortex Cloud Posture Management add-on. Not supported in Cortex XSIAM Enterprise Plus.
Path parameters
policyId String required
Example:
policyId_example
Request headers
Authorization
String
required
{api_key}
{api_key}
Example:
UCoWpG4rkNzgCp2dsh8m02iVpZsskwKHz7N1tErPcUV3Wmf59Gc9kytmgOv0pDWoem3PBlORyRIPiir4OcYdWUOWAM3JyTgoCxQf4nQoTlKmFRKz9Bj5vIjluw66p9WP
x-xdr-auth-id
String
required
{api_key_id}
{api_key_id}
Example:
241
CLIENT REQUEST
curl -X 'PUT'
-H
'Content-Type: application/json'
-H
'Authorization: UCoWpG4rkNzgCp2dsh8m02iVpZsskwKHz7N1tErPcUV3Wmf59Gc9kytmgOv0pDWoem3PBlORyRIPiir4OcYdWUOWAM3JyTgoCxQf4nQoTlKmFRKz9Bj5vIjluw66p9WP '
-H
'x-xdr-auth-id: 241'
'https://api-yourfqdn/public_api/appsec/v1/policies/{policyId}'
-d
'{
"scope" : {
"OR" : [ {
"OR" : [ null, null ],
"SEARCH_FIELD" : "SEARCH_FIELD",
"AND" : [ null, null ],
"SEARCH_VALUE" : true
}, {
"OR" : [ null, null ],
"SEARCH_FIELD" : "SEARCH_FIELD",
"AND" : [ null, null ],
"SEARCH_VALUE" : true
} ],
"SEARCH_FIELD" : "SEARCH_FIELD",
"AND" : [ {
"OR" : [ null, null ],
"SEARCH_FIELD" : "SEARCH_FIELD",
"AND" : [ null, null ],
"SEARCH_VALUE" : true
}, {
"OR" : [ null, null ],
"SEARCH_FIELD" : "SEARCH_FIELD",
"AND" : [ null, null ],
"SEARCH_VALUE" : true
} ]
},
"name" : "name",
"description" : "description",
"assetGroupIds" : [ 0.8008281904610115, 0.8008281904610115 ],
"conditions" : {
"OR" : [ {
"OR" : [ null, null ],
"SEARCH_FIELD" : "SEARCH_FIELD",
"AND" : [ null, null ],
"SEARCH_VALUE" : true
}, {
"OR" : [ null, null ],
"SEARCH_FIELD" : "SEARCH_FIELD",
"AND" : [ null, null ],
"SEARCH_VALUE" : true
} ],
"SEARCH_FIELD" : "SEARCH_FIELD",
"AND" : [ {
"OR" : [ null, null ],
"SEARCH_FIELD" : "SEARCH_FIELD",
"AND" : [ null, null ],
"SEARCH_VALUE" : true
}, {
"OR" : [ null, null ],
"SEARCH_FIELD" : "SEARCH_FIELD",
"AND" : [ null, null ],
"SEARCH_VALUE" : true
} ],
"SEARCH_VALUE" : true
},
"triggers" : {
"pr" : {
"isEnabled" : true,
"actions" : {
"reportIssue" : true,
"blockPr" : true,
"reportPrComment" : true
},
"overrideIssueSeverity" : "Critical"
},
"periodic" : {
"isEnabled" : true,
"actions" : {
"reportIssue" : true
},
"overrideIssueSeverity" : "Critical"
},
"cicd" : {
"isEnabled" : true,
"actions" : {
"reportIssue" : true,
"blockCicd" : true,
"reportCicd" : true
},
"overrideIssueSeverity" : "Critical"
}
}
}'
import http.client
conn = http.client.HTTPSConnection("api-yourfqdn")
payload = "{\"name\":\"string\",\"description\":\"string\",\"conditions\":{\"SEARCH_FIELD\":\"string\",\"SEARCH_TYPE\":\"EQ\",\"SEARCH_VALUE\":true,\"AND\":[{\"SEARCH_FIELD\":\"string\",\"SEARCH_TYPE\":\"ARRAY_CONTAINS\",\"SEARCH_VALUE\":true,\"AND\":[{\"SEARCH_FIELD\":\"string\",\"SEARCH_TYPE\":\"ARRAY_CONTAINS\",\"SEARCH_VALUE\":true,\"AND\":[null],\"OR\":[null]}],\"OR\":[{\"SEARCH_FIELD\":\"string\",\"SEARCH_TYPE\":\"ARRAY_CONTAINS\",\"SEARCH_VALUE\":true,\"AND\":[null],\"OR\":[null]}]}],\"OR\":[{\"SEARCH_FIELD\":\"string\",\"SEARCH_TYPE\":\"ARRAY_CONTAINS\",\"SEARCH_VALUE\":true,\"AND\":[{\"SEARCH_FIELD\":\"string\",\"SEARCH_TYPE\":\"ARRAY_CONTAINS\",\"SEARCH_VALUE\":true,\"AND\":[null],\"OR\":[null]}],\"OR\":[{\"SEARCH_FIELD\":\"string\",\"SEARCH_TYPE\":\"ARRAY_CONTAINS\",\"SEARCH_VALUE\":true,\"AND\":[null],\"OR\":[null]}]}]},\"scope\":{\"SEARCH_FIELD\":\"string\",\"SEARCH_TYPE\":\"EQ\",\"SEARCH_VALUE\":true,\"AND\":[{\"SEARCH_FIELD\":\"string\",\"SEARCH_TYPE\":\"ARRAY_CONTAINS\",\"SEARCH_VALUE\":true,\"AND\":[{\"SEARCH_FIELD\":\"string\",\"SEARCH_TYPE\":\"ARRAY_CONTAINS\",\"SEARCH_VALUE\":true,\"AND\":[null],\"OR\":[null]}],\"OR\":[{\"SEARCH_FIELD\":\"string\",\"SEARCH_TYPE\":\"ARRAY_CONTAINS\",\"SEARCH_VALUE\":true,\"AND\":[null],\"OR\":[null]}]}],\"OR\":[{\"SEARCH_FIELD\":\"string\",\"SEARCH_TYPE\":\"ARRAY_CONTAINS\",\"SEARCH_VALUE\":true,\"AND\":[{\"SEARCH_FIELD\":\"string\",\"SEARCH_TYPE\":\"ARRAY_CONTAINS\",\"SEARCH_VALUE\":true,\"AND\":[null],\"OR\":[null]}],\"OR\":[{\"SEARCH_FIELD\":\"string\",\"SEARCH_TYPE\":\"ARRAY_CONTAINS\",\"SEARCH_VALUE\":true,\"AND\":[null],\"OR\":[null]}]}]},\"assetGroupIds\":[0.1],\"triggers\":{\"periodic\":{\"isEnabled\":true,\"actions\":{\"reportIssue\":true},\"overrideIssueSeverity\":\"Critical\"},\"pr\":{\"isEnabled\":true,\"actions\":{\"reportIssue\":true,\"blockPr\":true,\"reportPrComment\":true},\"overrideIssueSeverity\":\"Critical\"},\"cicd\":{\"isEnabled\":true,\"actions\":{\"reportIssue\":true,\"blockCicd\":true,\"reportCicd\":true},\"overrideIssueSeverity\":\"Critical\"}}}"
headers = {
'Authorization': "UCoWpG4rkNzgCp2dsh8m02iVpZsskwKHz7N1tErPcUV3Wmf59Gc9kytmgOv0pDWoem3PBlORyRIPiir4OcYdWUOWAM3JyTgoCxQf4nQoTlKmFRKz9Bj5vIjluw66p9WP ",
'x-xdr-auth-id': "241",
'content-type': "application/json"
}
conn.request("PUT", "/public_api/appsec/v1/policies/%7BpolicyId%7D", 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/policies/%7BpolicyId%7D")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'UCoWpG4rkNzgCp2dsh8m02iVpZsskwKHz7N1tErPcUV3Wmf59Gc9kytmgOv0pDWoem3PBlORyRIPiir4OcYdWUOWAM3JyTgoCxQf4nQoTlKmFRKz9Bj5vIjluw66p9WP '
request["x-xdr-auth-id"] = '241'
request["content-type"] = 'application/json'
request.body = "{\"name\":\"string\",\"description\":\"string\",\"conditions\":{\"SEARCH_FIELD\":\"string\",\"SEARCH_TYPE\":\"EQ\",\"SEARCH_VALUE\":true,\"AND\":[{\"SEARCH_FIELD\":\"string\",\"SEARCH_TYPE\":\"ARRAY_CONTAINS\",\"SEARCH_VALUE\":true,\"AND\":[{\"SEARCH_FIELD\":\"string\",\"SEARCH_TYPE\":\"ARRAY_CONTAINS\",\"SEARCH_VALUE\":true,\"AND\":[null],\"OR\":[null]}],\"OR\":[{\"SEARCH_FIELD\":\"string\",\"SEARCH_TYPE\":\"ARRAY_CONTAINS\",\"SEARCH_VALUE\":true,\"AND\":[null],\"OR\":[null]}]}],\"OR\":[{\"SEARCH_FIELD\":\"string\",\"SEARCH_TYPE\":\"ARRAY_CONTAINS\",\"SEARCH_VALUE\":true,\"AND\":[{\"SEARCH_FIELD\":\"string\",\"SEARCH_TYPE\":\"ARRAY_CONTAINS\",\"SEARCH_VALUE\":true,\"AND\":[null],\"OR\":[null]}],\"OR\":[{\"SEARCH_FIELD\":\"string\",\"SEARCH_TYPE\":\"ARRAY_CONTAINS\",\"SEARCH_VALUE\":true,\"AND\":[null],\"OR\":[null]}]}]},\"scope\":{\"SEARCH_FIELD\":\"string\",\"SEARCH_TYPE\":\"EQ\",\"SEARCH_VALUE\":true,\"AND\":[{\"SEARCH_FIELD\":\"string\",\"SEARCH_TYPE\":\"ARRAY_CONTAINS\",\"SEARCH_VALUE\":true,\"AND\":[{\"SEARCH_FIELD\":\"string\",\"SEARCH_TYPE\":\"ARRAY_CONTAINS\",\"SEARCH_VALUE\":true,\"AND\":[null],\"OR\":[null]}],\"OR\":[{\"SEARCH_FIELD\":\"string\",\"SEARCH_TYPE\":\"ARRAY_CONTAINS\",\"SEARCH_VALUE\":true,\"AND\":[null],\"OR\":[null]}]}],\"OR\":[{\"SEARCH_FIELD\":\"string\",\"SEARCH_TYPE\":\"ARRAY_CONTAINS\",\"SEARCH_VALUE\":true,\"AND\":[{\"SEARCH_FIELD\":\"string\",\"SEARCH_TYPE\":\"ARRAY_CONTAINS\",\"SEARCH_VALUE\":true,\"AND\":[null],\"OR\":[null]}],\"OR\":[{\"SEARCH_FIELD\":\"string\",\"SEARCH_TYPE\":\"ARRAY_CONTAINS\",\"SEARCH_VALUE\":true,\"AND\":[null],\"OR\":[null]}]}]},\"assetGroupIds\":[0.1],\"triggers\":{\"periodic\":{\"isEnabled\":true,\"actions\":{\"reportIssue\":true},\"overrideIssueSeverity\":\"Critical\"},\"pr\":{\"isEnabled\":true,\"actions\":{\"reportIssue\":true,\"blockPr\":true,\"reportPrComment\":true},\"overrideIssueSeverity\":\"Critical\"},\"cicd\":{\"isEnabled\":true,\"actions\":{\"reportIssue\":true,\"blockCicd\":true,\"reportCicd\":true},\"overrideIssueSeverity\":\"Critical\"}}}"
response = http.request(request)
puts response.read_bodyconst data = JSON.stringify({
"name": "string",
"description": "string",
"conditions": {
"SEARCH_FIELD": "string",
"SEARCH_TYPE": "EQ",
"SEARCH_VALUE": true,
"AND": [
{
"SEARCH_FIELD": "string",
"SEARCH_TYPE": "ARRAY_CONTAINS",
"SEARCH_VALUE": true,
"AND": [
{
"SEARCH_FIELD": "string",
"SEARCH_TYPE": "ARRAY_CONTAINS",
"SEARCH_VALUE": true,
"AND": [
null
],
"OR": [
null
]
}
],
"OR": [
{
"SEARCH_FIELD": "string",
"SEARCH_TYPE": "ARRAY_CONTAINS",
"SEARCH_VALUE": true,
"AND": [
null
],
"OR": [
null
]
}
]
}
],
"OR": [
{
"SEARCH_FIELD": "string",
"SEARCH_TYPE": "ARRAY_CONTAINS",
"SEARCH_VALUE": true,
"AND": [
{
"SEARCH_FIELD": "string",
"SEARCH_TYPE": "ARRAY_CONTAINS",
"SEARCH_VALUE": true,
"AND": [
null
],
"OR": [
null
]
}
],
"OR": [
{
"SEARCH_FIELD": "string",
"SEARCH_TYPE": "ARRAY_CONTAINS",
"SEARCH_VALUE": true,
"AND": [
null
],
"OR": [
null
]
}
]
}
]
},
"scope": {
"SEARCH_FIELD": "string",
"SEARCH_TYPE": "EQ",
"SEARCH_VALUE": true,
"AND": [
{
"SEARCH_FIELD": "string",
"SEARCH_TYPE": "ARRAY_CONTAINS",
"SEARCH_VALUE": true,
"AND": [
{
"SEARCH_FIELD": "string",
"SEARCH_TYPE": "ARRAY_CONTAINS",
"SEARCH_VALUE": true,
"AND": [
null
],
"OR": [
null
]
}
],
"OR": [
{
"SEARCH_FIELD": "string",
"SEARCH_TYPE": "ARRAY_CONTAINS",
"SEARCH_VALUE": true,
"AND": [
null
],
"OR": [
null
]
}
]
}
],
"OR": [
{
"SEARCH_FIELD": "string",
"SEARCH_TYPE": "ARRAY_CONTAINS",
"SEARCH_VALUE": true,
"AND": [
{
"SEARCH_FIELD": "string",
"SEARCH_TYPE": "ARRAY_CONTAINS",
"SEARCH_VALUE": true,
"AND": [
null
],
"OR": [
null
]
}
],
"OR": [
{
"SEARCH_FIELD": "string",
"SEARCH_TYPE": "ARRAY_CONTAINS",
"SEARCH_VALUE": true,
"AND": [
null
],
"OR": [
null
]
}
]
}
]
},
"assetGroupIds": [
0.1
],
"triggers": {
"periodic": {
"isEnabled": true,
"actions": {
"reportIssue": true
},
"overrideIssueSeverity": "Critical"
},
"pr": {
"isEnabled": true,
"actions": {
"reportIssue": true,
"blockPr": true,
"reportPrComment": true
},
"overrideIssueSeverity": "Critical"
},
"cicd": {
"isEnabled": true,
"actions": {
"reportIssue": true,
"blockCicd": true,
"reportCicd": true
},
"overrideIssueSeverity": "Critical"
}
}
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("PUT", "https://api-yourfqdn/public_api/appsec/v1/policies/%7BpolicyId%7D");
xhr.setRequestHeader("Authorization", "UCoWpG4rkNzgCp2dsh8m02iVpZsskwKHz7N1tErPcUV3Wmf59Gc9kytmgOv0pDWoem3PBlORyRIPiir4OcYdWUOWAM3JyTgoCxQf4nQoTlKmFRKz9Bj5vIjluw66p9WP ");
xhr.setRequestHeader("x-xdr-auth-id", "241");
xhr.setRequestHeader("content-type", "application/json");
xhr.send(data);HttpResponse<String> response = Unirest.put("https://api-yourfqdn/public_api/appsec/v1/policies/%7BpolicyId%7D")
.header("Authorization", "UCoWpG4rkNzgCp2dsh8m02iVpZsskwKHz7N1tErPcUV3Wmf59Gc9kytmgOv0pDWoem3PBlORyRIPiir4OcYdWUOWAM3JyTgoCxQf4nQoTlKmFRKz9Bj5vIjluw66p9WP ")
.header("x-xdr-auth-id", "241")
.header("content-type", "application/json")
.body("{\"name\":\"string\",\"description\":\"string\",\"conditions\":{\"SEARCH_FIELD\":\"string\",\"SEARCH_TYPE\":\"EQ\",\"SEARCH_VALUE\":true,\"AND\":[{\"SEARCH_FIELD\":\"string\",\"SEARCH_TYPE\":\"ARRAY_CONTAINS\",\"SEARCH_VALUE\":true,\"AND\":[{\"SEARCH_FIELD\":\"string\",\"SEARCH_TYPE\":\"ARRAY_CONTAINS\",\"SEARCH_VALUE\":true,\"AND\":[null],\"OR\":[null]}],\"OR\":[{\"SEARCH_FIELD\":\"string\",\"SEARCH_TYPE\":\"ARRAY_CONTAINS\",\"SEARCH_VALUE\":true,\"AND\":[null],\"OR\":[null]}]}],\"OR\":[{\"SEARCH_FIELD\":\"string\",\"SEARCH_TYPE\":\"ARRAY_CONTAINS\",\"SEARCH_VALUE\":true,\"AND\":[{\"SEARCH_FIELD\":\"string\",\"SEARCH_TYPE\":\"ARRAY_CONTAINS\",\"SEARCH_VALUE\":true,\"AND\":[null],\"OR\":[null]}],\"OR\":[{\"SEARCH_FIELD\":\"string\",\"SEARCH_TYPE\":\"ARRAY_CONTAINS\",\"SEARCH_VALUE\":true,\"AND\":[null],\"OR\":[null]}]}]},\"scope\":{\"SEARCH_FIELD\":\"string\",\"SEARCH_TYPE\":\"EQ\",\"SEARCH_VALUE\":true,\"AND\":[{\"SEARCH_FIELD\":\"string\",\"SEARCH_TYPE\":\"ARRAY_CONTAINS\",\"SEARCH_VALUE\":true,\"AND\":[{\"SEARCH_FIELD\":\"string\",\"SEARCH_TYPE\":\"ARRAY_CONTAINS\",\"SEARCH_VALUE\":true,\"AND\":[null],\"OR\":[null]}],\"OR\":[{\"SEARCH_FIELD\":\"string\",\"SEARCH_TYPE\":\"ARRAY_CONTAINS\",\"SEARCH_VALUE\":true,\"AND\":[null],\"OR\":[null]}]}],\"OR\":[{\"SEARCH_FIELD\":\"string\",\"SEARCH_TYPE\":\"ARRAY_CONTAINS\",\"SEARCH_VALUE\":true,\"AND\":[{\"SEARCH_FIELD\":\"string\",\"SEARCH_TYPE\":\"ARRAY_CONTAINS\",\"SEARCH_VALUE\":true,\"AND\":[null],\"OR\":[null]}],\"OR\":[{\"SEARCH_FIELD\":\"string\",\"SEARCH_TYPE\":\"ARRAY_CONTAINS\",\"SEARCH_VALUE\":true,\"AND\":[null],\"OR\":[null]}]}]},\"assetGroupIds\":[0.1],\"triggers\":{\"periodic\":{\"isEnabled\":true,\"actions\":{\"reportIssue\":true},\"overrideIssueSeverity\":\"Critical\"},\"pr\":{\"isEnabled\":true,\"actions\":{\"reportIssue\":true,\"blockPr\":true,\"reportPrComment\":true},\"overrideIssueSeverity\":\"Critical\"},\"cicd\":{\"isEnabled\":true,\"actions\":{\"reportIssue\":true,\"blockCicd\":true,\"reportCicd\":true},\"overrideIssueSeverity\":\"Critical\"}}}")
.asString();import Foundation
let headers = [
"Authorization": "UCoWpG4rkNzgCp2dsh8m02iVpZsskwKHz7N1tErPcUV3Wmf59Gc9kytmgOv0pDWoem3PBlORyRIPiir4OcYdWUOWAM3JyTgoCxQf4nQoTlKmFRKz9Bj5vIjluw66p9WP ",
"x-xdr-auth-id": "241",
"content-type": "application/json"
]
let parameters = [
"name": "string",
"description": "string",
"conditions": [
"SEARCH_FIELD": "string",
"SEARCH_TYPE": "EQ",
"SEARCH_VALUE": true,
"AND": [
[
"SEARCH_FIELD": "string",
"SEARCH_TYPE": "ARRAY_CONTAINS",
"SEARCH_VALUE": true,
"AND": [
[
"SEARCH_FIELD": "string",
"SEARCH_TYPE": "ARRAY_CONTAINS",
"SEARCH_VALUE": true,
"AND": [],
"OR": []
]
],
"OR": [
[
"SEARCH_FIELD": "string",
"SEARCH_TYPE": "ARRAY_CONTAINS",
"SEARCH_VALUE": true,
"AND": [],
"OR": []
]
]
]
],
"OR": [
[
"SEARCH_FIELD": "string",
"SEARCH_TYPE": "ARRAY_CONTAINS",
"SEARCH_VALUE": true,
"AND": [
[
"SEARCH_FIELD": "string",
"SEARCH_TYPE": "ARRAY_CONTAINS",
"SEARCH_VALUE": true,
"AND": [],
"OR": []
]
],
"OR": [
[
"SEARCH_FIELD": "string",
"SEARCH_TYPE": "ARRAY_CONTAINS",
"SEARCH_VALUE": true,
"AND": [],
"OR": []
]
]
]
]
],
"scope": [
"SEARCH_FIELD": "string",
"SEARCH_TYPE": "EQ",
"SEARCH_VALUE": true,
"AND": [
[
"SEARCH_FIELD": "string",
"SEARCH_TYPE": "ARRAY_CONTAINS",
"SEARCH_VALUE": true,
"AND": [
[
"SEARCH_FIELD": "string",
"SEARCH_TYPE": "ARRAY_CONTAINS",
"SEARCH_VALUE": true,
"AND": [],
"OR": []
]
],
"OR": [
[
"SEARCH_FIELD": "string",
"SEARCH_TYPE": "ARRAY_CONTAINS",
"SEARCH_VALUE": true,
"AND": [],
"OR": []
]
]
]
],
"OR": [
[
"SEARCH_FIELD": "string",
"SEARCH_TYPE": "ARRAY_CONTAINS",
"SEARCH_VALUE": true,
"AND": [
[
"SEARCH_FIELD": "string",
"SEARCH_TYPE": "ARRAY_CONTAINS",
"SEARCH_VALUE": true,
"AND": [],
"OR": []
]
],
"OR": [
[
"SEARCH_FIELD": "string",
"SEARCH_TYPE": "ARRAY_CONTAINS",
"SEARCH_VALUE": true,
"AND": [],
"OR": []
]
]
]
]
],
"assetGroupIds": [0.1],
"triggers": [
"periodic": [
"isEnabled": true,
"actions": ["reportIssue": true],
"overrideIssueSeverity": "Critical"
],
"pr": [
"isEnabled": true,
"actions": [
"reportIssue": true,
"blockPr": true,
"reportPrComment": true
],
"overrideIssueSeverity": "Critical"
],
"cicd": [
"isEnabled": true,
"actions": [
"reportIssue": true,
"blockCicd": true,
"reportCicd": true
],
"overrideIssueSeverity": "Critical"
]
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "https://api-yourfqdn/public_api/appsec/v1/policies/%7BpolicyId%7D")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PUT"
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/policies/%7BpolicyId%7D",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => "{\"name\":\"string\",\"description\":\"string\",\"conditions\":{\"SEARCH_FIELD\":\"string\",\"SEARCH_TYPE\":\"EQ\",\"SEARCH_VALUE\":true,\"AND\":[{\"SEARCH_FIELD\":\"string\",\"SEARCH_TYPE\":\"ARRAY_CONTAINS\",\"SEARCH_VALUE\":true,\"AND\":[{\"SEARCH_FIELD\":\"string\",\"SEARCH_TYPE\":\"ARRAY_CONTAINS\",\"SEARCH_VALUE\":true,\"AND\":[null],\"OR\":[null]}],\"OR\":[{\"SEARCH_FIELD\":\"string\",\"SEARCH_TYPE\":\"ARRAY_CONTAINS\",\"SEARCH_VALUE\":true,\"AND\":[null],\"OR\":[null]}]}],\"OR\":[{\"SEARCH_FIELD\":\"string\",\"SEARCH_TYPE\":\"ARRAY_CONTAINS\",\"SEARCH_VALUE\":true,\"AND\":[{\"SEARCH_FIELD\":\"string\",\"SEARCH_TYPE\":\"ARRAY_CONTAINS\",\"SEARCH_VALUE\":true,\"AND\":[null],\"OR\":[null]}],\"OR\":[{\"SEARCH_FIELD\":\"string\",\"SEARCH_TYPE\":\"ARRAY_CONTAINS\",\"SEARCH_VALUE\":true,\"AND\":[null],\"OR\":[null]}]}]},\"scope\":{\"SEARCH_FIELD\":\"string\",\"SEARCH_TYPE\":\"EQ\",\"SEARCH_VALUE\":true,\"AND\":[{\"SEARCH_FIELD\":\"string\",\"SEARCH_TYPE\":\"ARRAY_CONTAINS\",\"SEARCH_VALUE\":true,\"AND\":[{\"SEARCH_FIELD\":\"string\",\"SEARCH_TYPE\":\"ARRAY_CONTAINS\",\"SEARCH_VALUE\":true,\"AND\":[null],\"OR\":[null]}],\"OR\":[{\"SEARCH_FIELD\":\"string\",\"SEARCH_TYPE\":\"ARRAY_CONTAINS\",\"SEARCH_VALUE\":true,\"AND\":[null],\"OR\":[null]}]}],\"OR\":[{\"SEARCH_FIELD\":\"string\",\"SEARCH_TYPE\":\"ARRAY_CONTAINS\",\"SEARCH_VALUE\":true,\"AND\":[{\"SEARCH_FIELD\":\"string\",\"SEARCH_TYPE\":\"ARRAY_CONTAINS\",\"SEARCH_VALUE\":true,\"AND\":[null],\"OR\":[null]}],\"OR\":[{\"SEARCH_FIELD\":\"string\",\"SEARCH_TYPE\":\"ARRAY_CONTAINS\",\"SEARCH_VALUE\":true,\"AND\":[null],\"OR\":[null]}]}]},\"assetGroupIds\":[0.1],\"triggers\":{\"periodic\":{\"isEnabled\":true,\"actions\":{\"reportIssue\":true},\"overrideIssueSeverity\":\"Critical\"},\"pr\":{\"isEnabled\":true,\"actions\":{\"reportIssue\":true,\"blockPr\":true,\"reportPrComment\":true},\"overrideIssueSeverity\":\"Critical\"},\"cicd\":{\"isEnabled\":true,\"actions\":{\"reportIssue\":true,\"blockCicd\":true,\"reportCicd\":true},\"overrideIssueSeverity\":\"Critical\"}}}",
CURLOPT_HTTPHEADER => [
"Authorization: UCoWpG4rkNzgCp2dsh8m02iVpZsskwKHz7N1tErPcUV3Wmf59Gc9kytmgOv0pDWoem3PBlORyRIPiir4OcYdWUOWAM3JyTgoCxQf4nQoTlKmFRKz9Bj5vIjluw66p9WP ",
"content-type: application/json",
"x-xdr-auth-id: 241"
],
]);
$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, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "https://api-yourfqdn/public_api/appsec/v1/policies/%7BpolicyId%7D");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "Authorization: UCoWpG4rkNzgCp2dsh8m02iVpZsskwKHz7N1tErPcUV3Wmf59Gc9kytmgOv0pDWoem3PBlORyRIPiir4OcYdWUOWAM3JyTgoCxQf4nQoTlKmFRKz9Bj5vIjluw66p9WP ");
headers = curl_slist_append(headers, "x-xdr-auth-id: 241");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\"name\":\"string\",\"description\":\"string\",\"conditions\":{\"SEARCH_FIELD\":\"string\",\"SEARCH_TYPE\":\"EQ\",\"SEARCH_VALUE\":true,\"AND\":[{\"SEARCH_FIELD\":\"string\",\"SEARCH_TYPE\":\"ARRAY_CONTAINS\",\"SEARCH_VALUE\":true,\"AND\":[{\"SEARCH_FIELD\":\"string\",\"SEARCH_TYPE\":\"ARRAY_CONTAINS\",\"SEARCH_VALUE\":true,\"AND\":[null],\"OR\":[null]}],\"OR\":[{\"SEARCH_FIELD\":\"string\",\"SEARCH_TYPE\":\"ARRAY_CONTAINS\",\"SEARCH_VALUE\":true,\"AND\":[null],\"OR\":[null]}]}],\"OR\":[{\"SEARCH_FIELD\":\"string\",\"SEARCH_TYPE\":\"ARRAY_CONTAINS\",\"SEARCH_VALUE\":true,\"AND\":[{\"SEARCH_FIELD\":\"string\",\"SEARCH_TYPE\":\"ARRAY_CONTAINS\",\"SEARCH_VALUE\":true,\"AND\":[null],\"OR\":[null]}],\"OR\":[{\"SEARCH_FIELD\":\"string\",\"SEARCH_TYPE\":\"ARRAY_CONTAINS\",\"SEARCH_VALUE\":true,\"AND\":[null],\"OR\":[null]}]}]},\"scope\":{\"SEARCH_FIELD\":\"string\",\"SEARCH_TYPE\":\"EQ\",\"SEARCH_VALUE\":true,\"AND\":[{\"SEARCH_FIELD\":\"string\",\"SEARCH_TYPE\":\"ARRAY_CONTAINS\",\"SEARCH_VALUE\":true,\"AND\":[{\"SEARCH_FIELD\":\"string\",\"SEARCH_TYPE\":\"ARRAY_CONTAINS\",\"SEARCH_VALUE\":true,\"AND\":[null],\"OR\":[null]}],\"OR\":[{\"SEARCH_FIELD\":\"string\",\"SEARCH_TYPE\":\"ARRAY_CONTAINS\",\"SEARCH_VALUE\":true,\"AND\":[null],\"OR\":[null]}]}],\"OR\":[{\"SEARCH_FIELD\":\"string\",\"SEARCH_TYPE\":\"ARRAY_CONTAINS\",\"SEARCH_VALUE\":true,\"AND\":[{\"SEARCH_FIELD\":\"string\",\"SEARCH_TYPE\":\"ARRAY_CONTAINS\",\"SEARCH_VALUE\":true,\"AND\":[null],\"OR\":[null]}],\"OR\":[{\"SEARCH_FIELD\":\"string\",\"SEARCH_TYPE\":\"ARRAY_CONTAINS\",\"SEARCH_VALUE\":true,\"AND\":[null],\"OR\":[null]}]}]},\"assetGroupIds\":[0.1],\"triggers\":{\"periodic\":{\"isEnabled\":true,\"actions\":{\"reportIssue\":true},\"overrideIssueSeverity\":\"Critical\"},\"pr\":{\"isEnabled\":true,\"actions\":{\"reportIssue\":true,\"blockPr\":true,\"reportPrComment\":true},\"overrideIssueSeverity\":\"Critical\"},\"cicd\":{\"isEnabled\":true,\"actions\":{\"reportIssue\":true,\"blockCicd\":true,\"reportCicd\":true},\"overrideIssueSeverity\":\"Critical\"}}}");
CURLcode ret = curl_easy_perform(hnd);var client = new RestClient("https://api-yourfqdn/public_api/appsec/v1/policies/%7BpolicyId%7D");
var request = new RestRequest(Method.PUT);
request.AddHeader("Authorization", "UCoWpG4rkNzgCp2dsh8m02iVpZsskwKHz7N1tErPcUV3Wmf59Gc9kytmgOv0pDWoem3PBlORyRIPiir4OcYdWUOWAM3JyTgoCxQf4nQoTlKmFRKz9Bj5vIjluw66p9WP ");
request.AddHeader("x-xdr-auth-id", "241");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\"name\":\"string\",\"description\":\"string\",\"conditions\":{\"SEARCH_FIELD\":\"string\",\"SEARCH_TYPE\":\"EQ\",\"SEARCH_VALUE\":true,\"AND\":[{\"SEARCH_FIELD\":\"string\",\"SEARCH_TYPE\":\"ARRAY_CONTAINS\",\"SEARCH_VALUE\":true,\"AND\":[{\"SEARCH_FIELD\":\"string\",\"SEARCH_TYPE\":\"ARRAY_CONTAINS\",\"SEARCH_VALUE\":true,\"AND\":[null],\"OR\":[null]}],\"OR\":[{\"SEARCH_FIELD\":\"string\",\"SEARCH_TYPE\":\"ARRAY_CONTAINS\",\"SEARCH_VALUE\":true,\"AND\":[null],\"OR\":[null]}]}],\"OR\":[{\"SEARCH_FIELD\":\"string\",\"SEARCH_TYPE\":\"ARRAY_CONTAINS\",\"SEARCH_VALUE\":true,\"AND\":[{\"SEARCH_FIELD\":\"string\",\"SEARCH_TYPE\":\"ARRAY_CONTAINS\",\"SEARCH_VALUE\":true,\"AND\":[null],\"OR\":[null]}],\"OR\":[{\"SEARCH_FIELD\":\"string\",\"SEARCH_TYPE\":\"ARRAY_CONTAINS\",\"SEARCH_VALUE\":true,\"AND\":[null],\"OR\":[null]}]}]},\"scope\":{\"SEARCH_FIELD\":\"string\",\"SEARCH_TYPE\":\"EQ\",\"SEARCH_VALUE\":true,\"AND\":[{\"SEARCH_FIELD\":\"string\",\"SEARCH_TYPE\":\"ARRAY_CONTAINS\",\"SEARCH_VALUE\":true,\"AND\":[{\"SEARCH_FIELD\":\"string\",\"SEARCH_TYPE\":\"ARRAY_CONTAINS\",\"SEARCH_VALUE\":true,\"AND\":[null],\"OR\":[null]}],\"OR\":[{\"SEARCH_FIELD\":\"string\",\"SEARCH_TYPE\":\"ARRAY_CONTAINS\",\"SEARCH_VALUE\":true,\"AND\":[null],\"OR\":[null]}]}],\"OR\":[{\"SEARCH_FIELD\":\"string\",\"SEARCH_TYPE\":\"ARRAY_CONTAINS\",\"SEARCH_VALUE\":true,\"AND\":[{\"SEARCH_FIELD\":\"string\",\"SEARCH_TYPE\":\"ARRAY_CONTAINS\",\"SEARCH_VALUE\":true,\"AND\":[null],\"OR\":[null]}],\"OR\":[{\"SEARCH_FIELD\":\"string\",\"SEARCH_TYPE\":\"ARRAY_CONTAINS\",\"SEARCH_VALUE\":true,\"AND\":[null],\"OR\":[null]}]}]},\"assetGroupIds\":[0.1],\"triggers\":{\"periodic\":{\"isEnabled\":true,\"actions\":{\"reportIssue\":true},\"overrideIssueSeverity\":\"Critical\"},\"pr\":{\"isEnabled\":true,\"actions\":{\"reportIssue\":true,\"blockPr\":true,\"reportPrComment\":true},\"overrideIssueSeverity\":\"Critical\"},\"cicd\":{\"isEnabled\":true,\"actions\":{\"reportIssue\":true,\"blockCicd\":true,\"reportCicd\":true},\"overrideIssueSeverity\":\"Critical\"}}}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);Body parameters
Partial_BasePolicyRequest
required
application/json
Make all properties in T optional
namestringA unique name for the AppSec policy.
A unique name for the AppSec policy.
descriptionstringA brief description of the AppSec policy's purpose.
A brief description of the AppSec policy's purpose.
conditionsobjectrequiredDefines the specific criteria (conditions) that will trigger the policy. You can combine multiple conditions to create complex rules for when the policy should be applied. If you combine multiple Finding Type values using OR, only the common fields across those types will be valid.
Note:
- When used in
AND, all conditions within this array must be met.
- When used in
OR, at least one condition within this array must be met.
- Selecting
Finding Type determines which condition fields you can configure. Each Finding Type supports a specific set of condition fields. To see which fields are allowed for each type, see the Supported Condition Fields table.
Defines the specific criteria (conditions) that will trigger the policy. You can combine multiple conditions to create complex rules for when the policy should be applied. If you combine multiple Finding Type values using OR, only the common fields across those types will be valid.
Note:
- When used in
AND, all conditions within this array must be met. - When used in
OR, at least one condition within this array must be met. - Selecting
Finding Typedetermines which condition fields you can configure. EachFinding Typesupports a specific set of condition fields. To see which fields are allowed for each type, see the Supported Condition Fields table.