Update
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",
"scope": "batch"
},
"defaults": {
"severityLevel": "INFORMATIONAL",
"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"
}Replace a custom check
Replace an existing custom check in full. The updated check is returned with an incremented version.
PUT
/
v1
/
tenant
/
custom-checks
/
{customCheckId}
Update
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",
"scope": "batch"
},
"defaults": {
"severityLevel": "INFORMATIONAL",
"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
Headers
Body
application/json
Fields for creating or replacing a custom check.
Response
The updated custom check
A stored custom check.
Was this page helpful?