Create a runtime response policy
curl --request POST \
--url https://app.trustivan.com/api/v1/runtime/response/policies \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"cluster_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"categories": [],
"rule_ids": [
"<string>"
],
"min_severity": "high",
"exclude_namespaces": [
"<string>"
],
"dry_run": true,
"enabled": true
}
'import requests
url = "https://app.trustivan.com/api/v1/runtime/response/policies"
payload = {
"name": "<string>",
"cluster_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"categories": [],
"rule_ids": ["<string>"],
"min_severity": "high",
"exclude_namespaces": ["<string>"],
"dry_run": True,
"enabled": True
}
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({
name: '<string>',
cluster_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
categories: [],
rule_ids: ['<string>'],
min_severity: 'high',
exclude_namespaces: ['<string>'],
dry_run: true,
enabled: true
})
};
fetch('https://app.trustivan.com/api/v1/runtime/response/policies', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.trustivan.com/api/v1/runtime/response/policies"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"cluster_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"categories\": [],\n \"rule_ids\": [\n \"<string>\"\n ],\n \"min_severity\": \"high\",\n \"exclude_namespaces\": [\n \"<string>\"\n ],\n \"dry_run\": true,\n \"enabled\": true\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))
}{
"error": "<string>",
"code": "validation_failed",
"required_scope": "<string>",
"principal": "user"
}{
"error": "<string>",
"code": "validation_failed",
"required_scope": "<string>",
"principal": "user"
}Create a runtime response policy
dry_run defaults to true and enabled to true; min_severity to
high. A policy must name at least one category or rule. Behind
credentials:manage, for a person (not an API key): it decides what
happens to running workloads.
POST
/
runtime
/
response
/
policies
Create a runtime response policy
curl --request POST \
--url https://app.trustivan.com/api/v1/runtime/response/policies \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"cluster_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"categories": [],
"rule_ids": [
"<string>"
],
"min_severity": "high",
"exclude_namespaces": [
"<string>"
],
"dry_run": true,
"enabled": true
}
'import requests
url = "https://app.trustivan.com/api/v1/runtime/response/policies"
payload = {
"name": "<string>",
"cluster_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"categories": [],
"rule_ids": ["<string>"],
"min_severity": "high",
"exclude_namespaces": ["<string>"],
"dry_run": True,
"enabled": True
}
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({
name: '<string>',
cluster_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
categories: [],
rule_ids: ['<string>'],
min_severity: 'high',
exclude_namespaces: ['<string>'],
dry_run: true,
enabled: true
})
};
fetch('https://app.trustivan.com/api/v1/runtime/response/policies', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.trustivan.com/api/v1/runtime/response/policies"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"cluster_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"categories\": [],\n \"rule_ids\": [\n \"<string>\"\n ],\n \"min_severity\": \"high\",\n \"exclude_namespaces\": [\n \"<string>\"\n ],\n \"dry_run\": true,\n \"enabled\": true\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))
}{
"error": "<string>",
"code": "validation_failed",
"required_scope": "<string>",
"principal": "user"
}{
"error": "<string>",
"code": "validation_failed",
"required_scope": "<string>",
"principal": "user"
}Authorizations
Body
application/json
Response
The stored policy.