curl --request POST \
--url https://app.trustivan.com/api/v1/cloud/accounts \
--header 'Authorization: Bearer <token>'import requests
url = "https://app.trustivan.com/api/v1/cloud/accounts"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://app.trustivan.com/api/v1/cloud/accounts', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://app.trustivan.com/api/v1/cloud/accounts"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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"
}Connect a cloud account
Creates a credential through the credential service (encrypted, with a key version beside the ciphertext) and stores a reference to it. There is no second secret store.
scheme decides the credential’s shape.
assume_role stores no secret at all, and is the recommended option on
a deployment that has an AWS identity of its own to assume the role
with (role_assumption on GET /cloud/providers). On one that has
none it is refused with 400, because the role could never be assumed.
identifier is the role ARN, and secret must be OMITTED. A request
carrying one is refused with 400. TRUSTIVAN issues the external ID
itself, derived from the connected account, and returns it as
external_id. Every tenant’s collection assumes roles as the same
deployment identity, so the external ID is the only thing a trust
policy can use to tell tenants apart; one a tenant chose would be the
value an attacker chose. A role connection is therefore stored
pending WITHOUT validation: its external ID did not exist until
now, so no trust policy can name it yet. Add an sts:ExternalId
condition with that value to the role’s trust policy, then call
POST /cloud/accounts/{id}/collect, which validates first.
basic is a static access key (identifier the key ID, secret the
secret key). It is VALIDATED before the connection is recorded, and the
validation proves two things: that it works, and that it belongs to the
account being connected. The second catches an account identifier
paired with another account’s key, which otherwise surfaces much later
as an account collecting somebody else’s estate.
Azure (provider: azure, account_id the subscription ID) takes
scheme: basic with tenant_id the directory (tenant) ID,
identifier the application (client) ID and secret a client secret.
GCP (provider: gcp, account_id the project ID) takes
scheme: token with secret the whole service-account JSON key and
no identifier. Both are validated before the connection is recorded,
including that the credential reaches that subscription or project; a
missing or misplaced field is a 400 naming it.
Behind credentials:manage, which is ungrantable to a machine: a
credential that could connect a cloud account could decide what a
tenant’s collection authenticates to.
curl --request POST \
--url https://app.trustivan.com/api/v1/cloud/accounts \
--header 'Authorization: Bearer <token>'import requests
url = "https://app.trustivan.com/api/v1/cloud/accounts"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://app.trustivan.com/api/v1/cloud/accounts', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://app.trustivan.com/api/v1/cloud/accounts"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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"
}Authorizations
Response
The connected account, with the external_id its role's trust policy must require.