Start dry-run
curl --request POST \
--url https://{region}.api.plerion.com/v1/tenant/custom-check-dry-runs \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"integrationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"check": {
"customCheckId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"target": {
"assetType": "AWS::S3::Bucket"
},
"body": "<string>",
"slug": "<string>",
"title": "<string>",
"description": "<string>",
"additionalAssets": [
{
"assetType": "<string>"
}
],
"type": "rego"
}
}
'import requests
url = "https://{region}.api.plerion.com/v1/tenant/custom-check-dry-runs"
payload = {
"integrationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"check": {
"customCheckId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"target": { "assetType": "AWS::S3::Bucket" },
"body": "<string>",
"slug": "<string>",
"title": "<string>",
"description": "<string>",
"additionalAssets": [{ "assetType": "<string>" }],
"type": "rego"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
integrationId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
check: {
customCheckId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
target: {assetType: 'AWS::S3::Bucket'},
body: JSON.stringify('<string>'),
slug: '<string>',
title: '<string>',
description: '<string>',
additionalAssets: [{assetType: '<string>'}],
type: 'rego'
}
})
};
fetch('https://{region}.api.plerion.com/v1/tenant/custom-check-dry-runs', 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-check-dry-runs",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'integrationId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'check' => [
'customCheckId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'target' => [
'assetType' => 'AWS::S3::Bucket'
],
'body' => '<string>',
'slug' => '<string>',
'title' => '<string>',
'description' => '<string>',
'additionalAssets' => [
[
'assetType' => '<string>'
]
],
'type' => 'rego'
]
]),
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-check-dry-runs"
payload := strings.NewReader("{\n \"integrationId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"check\": {\n \"customCheckId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"target\": {\n \"assetType\": \"AWS::S3::Bucket\"\n },\n \"body\": \"<string>\",\n \"slug\": \"<string>\",\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"additionalAssets\": [\n {\n \"assetType\": \"<string>\"\n }\n ],\n \"type\": \"rego\"\n }\n}")
req, _ := http.NewRequest("POST", 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.post("https://{region}.api.plerion.com/v1/tenant/custom-check-dry-runs")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"integrationId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"check\": {\n \"customCheckId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"target\": {\n \"assetType\": \"AWS::S3::Bucket\"\n },\n \"body\": \"<string>\",\n \"slug\": \"<string>\",\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"additionalAssets\": [\n {\n \"assetType\": \"<string>\"\n }\n ],\n \"type\": \"rego\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{region}.api.plerion.com/v1/tenant/custom-check-dry-runs")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"integrationId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"check\": {\n \"customCheckId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"target\": {\n \"assetType\": \"AWS::S3::Bucket\"\n },\n \"body\": \"<string>\",\n \"slug\": \"<string>\",\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"additionalAssets\": [\n {\n \"assetType\": \"<string>\"\n }\n ],\n \"type\": \"rego\"\n }\n}"
response = http.request(request)
puts response.read_body{
"dryRunId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "RUNNING",
"pollUrl": "/v1/tenant/custom-check-dry-runs/2ea262bd-aa14-48c2-81ce-fa783cca7227"
}{
"errors": [
{
"field": "<string>",
"code": "<string>",
"message": "<string>"
}
]
}{
"message": "Internal server error"
}Dry-run a custom check
Execute a custom check against live assets in preview mode, without persisting findings or moving compliance state. Returns a dryRunId; poll the dry-run status endpoint for results. The check is supplied inline so an unsaved edit can be tested before it is created.
POST
/
v1
/
tenant
/
custom-check-dry-runs
Start dry-run
curl --request POST \
--url https://{region}.api.plerion.com/v1/tenant/custom-check-dry-runs \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"integrationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"check": {
"customCheckId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"target": {
"assetType": "AWS::S3::Bucket"
},
"body": "<string>",
"slug": "<string>",
"title": "<string>",
"description": "<string>",
"additionalAssets": [
{
"assetType": "<string>"
}
],
"type": "rego"
}
}
'import requests
url = "https://{region}.api.plerion.com/v1/tenant/custom-check-dry-runs"
payload = {
"integrationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"check": {
"customCheckId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"target": { "assetType": "AWS::S3::Bucket" },
"body": "<string>",
"slug": "<string>",
"title": "<string>",
"description": "<string>",
"additionalAssets": [{ "assetType": "<string>" }],
"type": "rego"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
integrationId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
check: {
customCheckId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
target: {assetType: 'AWS::S3::Bucket'},
body: JSON.stringify('<string>'),
slug: '<string>',
title: '<string>',
description: '<string>',
additionalAssets: [{assetType: '<string>'}],
type: 'rego'
}
})
};
fetch('https://{region}.api.plerion.com/v1/tenant/custom-check-dry-runs', 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-check-dry-runs",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'integrationId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'check' => [
'customCheckId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'target' => [
'assetType' => 'AWS::S3::Bucket'
],
'body' => '<string>',
'slug' => '<string>',
'title' => '<string>',
'description' => '<string>',
'additionalAssets' => [
[
'assetType' => '<string>'
]
],
'type' => 'rego'
]
]),
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-check-dry-runs"
payload := strings.NewReader("{\n \"integrationId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"check\": {\n \"customCheckId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"target\": {\n \"assetType\": \"AWS::S3::Bucket\"\n },\n \"body\": \"<string>\",\n \"slug\": \"<string>\",\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"additionalAssets\": [\n {\n \"assetType\": \"<string>\"\n }\n ],\n \"type\": \"rego\"\n }\n}")
req, _ := http.NewRequest("POST", 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.post("https://{region}.api.plerion.com/v1/tenant/custom-check-dry-runs")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"integrationId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"check\": {\n \"customCheckId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"target\": {\n \"assetType\": \"AWS::S3::Bucket\"\n },\n \"body\": \"<string>\",\n \"slug\": \"<string>\",\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"additionalAssets\": [\n {\n \"assetType\": \"<string>\"\n }\n ],\n \"type\": \"rego\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{region}.api.plerion.com/v1/tenant/custom-check-dry-runs")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"integrationId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"check\": {\n \"customCheckId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"target\": {\n \"assetType\": \"AWS::S3::Bucket\"\n },\n \"body\": \"<string>\",\n \"slug\": \"<string>\",\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"additionalAssets\": [\n {\n \"assetType\": \"<string>\"\n }\n ],\n \"type\": \"rego\"\n }\n}"
response = http.request(request)
puts response.read_body{
"dryRunId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "RUNNING",
"pollUrl": "/v1/tenant/custom-check-dry-runs/2ea262bd-aa14-48c2-81ce-fa783cca7227"
}{
"errors": [
{
"field": "<string>",
"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
Body
application/json
Was this page helpful?
⌘I