curl --request PUT \
--url https://app.trustivan.com/api/v1/security-graph/nhi-identities \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"identities": [
{
"id": "<string>",
"name": "<string>",
"type": "<string>",
"provider": "<string>",
"principal": "<string>",
"used_by": [
"<string>"
],
"can_assume": [
"<string>"
],
"admin_of": [
"<string>"
],
"leaks": [
{
"locator": "<string>"
}
]
}
]
}
'import requests
url = "https://app.trustivan.com/api/v1/security-graph/nhi-identities"
payload = { "identities": [
{
"id": "<string>",
"name": "<string>",
"type": "<string>",
"provider": "<string>",
"principal": "<string>",
"used_by": ["<string>"],
"can_assume": ["<string>"],
"admin_of": ["<string>"],
"leaks": [{ "locator": "<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({
identities: [
{
id: '<string>',
name: '<string>',
type: '<string>',
provider: '<string>',
principal: '<string>',
used_by: ['<string>'],
can_assume: ['<string>'],
admin_of: ['<string>'],
leaks: [{locator: '<string>'}]
}
]
})
};
fetch('https://app.trustivan.com/api/v1/security-graph/nhi-identities', 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/security-graph/nhi-identities"
payload := strings.NewReader("{\n \"identities\": [\n {\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"type\": \"<string>\",\n \"provider\": \"<string>\",\n \"principal\": \"<string>\",\n \"used_by\": [\n \"<string>\"\n ],\n \"can_assume\": [\n \"<string>\"\n ],\n \"admin_of\": [\n \"<string>\"\n ],\n \"leaks\": [\n {\n \"locator\": \"<string>\"\n }\n ]\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))
}{
"identities": 123
}{
"error": "<string>",
"code": "validation_failed",
"required_scope": "<string>",
"principal": "user"
}{
"error": "<string>",
"code": "validation_failed",
"required_scope": "<string>",
"principal": "user"
}{
"error": "<string>",
"code": "validation_failed",
"required_scope": "<string>",
"principal": "user"
}Publish NHI identities into the security graph
NHI Security, which runs on its own database, publishes the
organization’s non-human identities here. The publication replaces
the previous one whole (an empty identities array removes them all)
and marks the graph stale; the worker rebuilds it within a minute or
two. Each identity becomes an nhi_identity node with edges to the
principal it is and the principals it can assume (assumes), from the
workloads that authenticate as it (uses_identity), to the cloud
administrator of each account where it holds a wildcard permission
(grants), and from the internet when its credential leaked
(exposes), so an attack path can pass through it.
The organization is the credential’s, as on POST /events; nothing in
the body names one. Requires scans:create. At most 20,000 identities
and 8 MiB; each list at most 100 entries. A leak records where
material was found, never the material.
curl --request PUT \
--url https://app.trustivan.com/api/v1/security-graph/nhi-identities \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"identities": [
{
"id": "<string>",
"name": "<string>",
"type": "<string>",
"provider": "<string>",
"principal": "<string>",
"used_by": [
"<string>"
],
"can_assume": [
"<string>"
],
"admin_of": [
"<string>"
],
"leaks": [
{
"locator": "<string>"
}
]
}
]
}
'import requests
url = "https://app.trustivan.com/api/v1/security-graph/nhi-identities"
payload = { "identities": [
{
"id": "<string>",
"name": "<string>",
"type": "<string>",
"provider": "<string>",
"principal": "<string>",
"used_by": ["<string>"],
"can_assume": ["<string>"],
"admin_of": ["<string>"],
"leaks": [{ "locator": "<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({
identities: [
{
id: '<string>',
name: '<string>',
type: '<string>',
provider: '<string>',
principal: '<string>',
used_by: ['<string>'],
can_assume: ['<string>'],
admin_of: ['<string>'],
leaks: [{locator: '<string>'}]
}
]
})
};
fetch('https://app.trustivan.com/api/v1/security-graph/nhi-identities', 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/security-graph/nhi-identities"
payload := strings.NewReader("{\n \"identities\": [\n {\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"type\": \"<string>\",\n \"provider\": \"<string>\",\n \"principal\": \"<string>\",\n \"used_by\": [\n \"<string>\"\n ],\n \"can_assume\": [\n \"<string>\"\n ],\n \"admin_of\": [\n \"<string>\"\n ],\n \"leaks\": [\n {\n \"locator\": \"<string>\"\n }\n ]\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))
}{
"identities": 123
}{
"error": "<string>",
"code": "validation_failed",
"required_scope": "<string>",
"principal": "user"
}{
"error": "<string>",
"code": "validation_failed",
"required_scope": "<string>",
"principal": "user"
}{
"error": "<string>",
"code": "validation_failed",
"required_scope": "<string>",
"principal": "user"
}