curl --request PUT \
--url https://{region}.api.plerion.com/v1/tenant/custom-checks/{customCheckId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"slug": "<string>",
"title": "<string>",
"target": {
"assetType": "AWS::S3::Bucket"
},
"defaults": {
"message": "<string>",
"informational": true,
"remediation": "<string>",
"meta": {}
},
"type": "rego",
"body": "<string>",
"description": "<string>",
"additionalAssets": [
{
"assetType": "<string>"
}
]
}
'import requests
url = "https://{region}.api.plerion.com/v1/tenant/custom-checks/{customCheckId}"
payload = {
"slug": "<string>",
"title": "<string>",
"target": { "assetType": "AWS::S3::Bucket" },
"defaults": {
"message": "<string>",
"informational": True,
"remediation": "<string>",
"meta": {}
},
"type": "rego",
"body": "<string>",
"description": "<string>",
"additionalAssets": [{ "assetType": "<string>" }]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
slug: '<string>',
title: '<string>',
target: {assetType: 'AWS::S3::Bucket'},
defaults: {message: '<string>', informational: true, remediation: '<string>', meta: {}},
type: 'rego',
body: JSON.stringify('<string>'),
description: '<string>',
additionalAssets: [{assetType: '<string>'}]
})
};
fetch('https://{region}.api.plerion.com/v1/tenant/custom-checks/{customCheckId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{region}.api.plerion.com/v1/tenant/custom-checks/{customCheckId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'slug' => '<string>',
'title' => '<string>',
'target' => [
'assetType' => 'AWS::S3::Bucket'
],
'defaults' => [
'message' => '<string>',
'informational' => true,
'remediation' => '<string>',
'meta' => [
]
],
'type' => 'rego',
'body' => '<string>',
'description' => '<string>',
'additionalAssets' => [
[
'assetType' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{region}.api.plerion.com/v1/tenant/custom-checks/{customCheckId}"
payload := strings.NewReader("{\n \"slug\": \"<string>\",\n \"title\": \"<string>\",\n \"target\": {\n \"assetType\": \"AWS::S3::Bucket\"\n },\n \"defaults\": {\n \"message\": \"<string>\",\n \"informational\": true,\n \"remediation\": \"<string>\",\n \"meta\": {}\n },\n \"type\": \"rego\",\n \"body\": \"<string>\",\n \"description\": \"<string>\",\n \"additionalAssets\": [\n {\n \"assetType\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://{region}.api.plerion.com/v1/tenant/custom-checks/{customCheckId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"slug\": \"<string>\",\n \"title\": \"<string>\",\n \"target\": {\n \"assetType\": \"AWS::S3::Bucket\"\n },\n \"defaults\": {\n \"message\": \"<string>\",\n \"informational\": true,\n \"remediation\": \"<string>\",\n \"meta\": {}\n },\n \"type\": \"rego\",\n \"body\": \"<string>\",\n \"description\": \"<string>\",\n \"additionalAssets\": [\n {\n \"assetType\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{region}.api.plerion.com/v1/tenant/custom-checks/{customCheckId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"slug\": \"<string>\",\n \"title\": \"<string>\",\n \"target\": {\n \"assetType\": \"AWS::S3::Bucket\"\n },\n \"defaults\": {\n \"message\": \"<string>\",\n \"informational\": true,\n \"remediation\": \"<string>\",\n \"meta\": {}\n },\n \"type\": \"rego\",\n \"body\": \"<string>\",\n \"description\": \"<string>\",\n \"additionalAssets\": [\n {\n \"assetType\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"customCheckId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"slug": "<string>",
"organizationId": "<string>",
"tenantId": "<string>",
"title": "<string>",
"target": {
"assetType": "AWS::S3::Bucket"
},
"defaults": {
"message": "<string>",
"informational": true,
"remediation": "<string>",
"meta": {}
},
"type": "rego",
"body": "<string>",
"version": 2,
"createdBy": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedBy": "<string>",
"updatedAt": "2023-11-07T05:31:56Z",
"description": "<string>",
"additionalAssets": [
{
"assetType": "<string>"
}
]
}{
"errors": [
{
"field": "<string>",
"code": "<string>",
"message": "<string>"
}
]
}{
"errors": [
{
"code": "<string>",
"message": "<string>"
}
]
}{
"message": "Internal server error"
}Update a custom check
Replace an existing custom check in full. The updated check is returned with an incremented version.
curl --request PUT \
--url https://{region}.api.plerion.com/v1/tenant/custom-checks/{customCheckId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"slug": "<string>",
"title": "<string>",
"target": {
"assetType": "AWS::S3::Bucket"
},
"defaults": {
"message": "<string>",
"informational": true,
"remediation": "<string>",
"meta": {}
},
"type": "rego",
"body": "<string>",
"description": "<string>",
"additionalAssets": [
{
"assetType": "<string>"
}
]
}
'import requests
url = "https://{region}.api.plerion.com/v1/tenant/custom-checks/{customCheckId}"
payload = {
"slug": "<string>",
"title": "<string>",
"target": { "assetType": "AWS::S3::Bucket" },
"defaults": {
"message": "<string>",
"informational": True,
"remediation": "<string>",
"meta": {}
},
"type": "rego",
"body": "<string>",
"description": "<string>",
"additionalAssets": [{ "assetType": "<string>" }]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
slug: '<string>',
title: '<string>',
target: {assetType: 'AWS::S3::Bucket'},
defaults: {message: '<string>', informational: true, remediation: '<string>', meta: {}},
type: 'rego',
body: JSON.stringify('<string>'),
description: '<string>',
additionalAssets: [{assetType: '<string>'}]
})
};
fetch('https://{region}.api.plerion.com/v1/tenant/custom-checks/{customCheckId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{region}.api.plerion.com/v1/tenant/custom-checks/{customCheckId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'slug' => '<string>',
'title' => '<string>',
'target' => [
'assetType' => 'AWS::S3::Bucket'
],
'defaults' => [
'message' => '<string>',
'informational' => true,
'remediation' => '<string>',
'meta' => [
]
],
'type' => 'rego',
'body' => '<string>',
'description' => '<string>',
'additionalAssets' => [
[
'assetType' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{region}.api.plerion.com/v1/tenant/custom-checks/{customCheckId}"
payload := strings.NewReader("{\n \"slug\": \"<string>\",\n \"title\": \"<string>\",\n \"target\": {\n \"assetType\": \"AWS::S3::Bucket\"\n },\n \"defaults\": {\n \"message\": \"<string>\",\n \"informational\": true,\n \"remediation\": \"<string>\",\n \"meta\": {}\n },\n \"type\": \"rego\",\n \"body\": \"<string>\",\n \"description\": \"<string>\",\n \"additionalAssets\": [\n {\n \"assetType\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://{region}.api.plerion.com/v1/tenant/custom-checks/{customCheckId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"slug\": \"<string>\",\n \"title\": \"<string>\",\n \"target\": {\n \"assetType\": \"AWS::S3::Bucket\"\n },\n \"defaults\": {\n \"message\": \"<string>\",\n \"informational\": true,\n \"remediation\": \"<string>\",\n \"meta\": {}\n },\n \"type\": \"rego\",\n \"body\": \"<string>\",\n \"description\": \"<string>\",\n \"additionalAssets\": [\n {\n \"assetType\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{region}.api.plerion.com/v1/tenant/custom-checks/{customCheckId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"slug\": \"<string>\",\n \"title\": \"<string>\",\n \"target\": {\n \"assetType\": \"AWS::S3::Bucket\"\n },\n \"defaults\": {\n \"message\": \"<string>\",\n \"informational\": true,\n \"remediation\": \"<string>\",\n \"meta\": {}\n },\n \"type\": \"rego\",\n \"body\": \"<string>\",\n \"description\": \"<string>\",\n \"additionalAssets\": [\n {\n \"assetType\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"customCheckId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"slug": "<string>",
"organizationId": "<string>",
"tenantId": "<string>",
"title": "<string>",
"target": {
"assetType": "AWS::S3::Bucket"
},
"defaults": {
"message": "<string>",
"informational": true,
"remediation": "<string>",
"meta": {}
},
"type": "rego",
"body": "<string>",
"version": 2,
"createdBy": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedBy": "<string>",
"updatedAt": "2023-11-07T05:31:56Z",
"description": "<string>",
"additionalAssets": [
{
"assetType": "<string>"
}
]
}{
"errors": [
{
"field": "<string>",
"code": "<string>",
"message": "<string>"
}
]
}{
"errors": [
{
"code": "<string>",
"message": "<string>"
}
]
}{
"message": "Internal server error"
}Authorizations
Bearer API Key. For example, "Bearer {Tenant API Key}"
Headers
Bearer API Key. For example, "Bearer {Tenant API Key}"
application/json
Path Parameters
The ID of the custom check
Body
Fields for creating or replacing a custom check.
1 - 128^[a-z0-9-]+$1 - 256The primary asset type a check evaluates and how it is batched.
Show child attributes
Show child attributes
Default verdict values applied to findings the check produces.
Show child attributes
Show child attributes
rego 14096Show child attributes
Show child attributes
Response
The updated custom check
A stored custom check.
URL-safe identifier, unique within the tenant.
1 - 128^[a-z0-9-]+$1 - 256The primary asset type a check evaluates and how it is batched.
Show child attributes
Show child attributes
Default verdict values applied to findings the check produces.
Show child attributes
Show child attributes
rego The rego policy source.
1x >= 14096Additional asset types loaded in full and made available to the policy.
Show child attributes
Show child attributes
Was this page helpful?