curl --request POST \
--url https://app.trustivan.com/api/v1/registry-credentials/{id}/verify \
--header 'Authorization: Bearer <token>'import requests
url = "https://app.trustivan.com/api/v1/registry-credentials/{id}/verify"
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/registry-credentials/{id}/verify', 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/registry-credentials/{id}/verify"
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))
}{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"kind": "registry",
"registry": "ghcr.io",
"scheme": "basic",
"status": "unverified",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"username": "<string>",
"external_id": "<string>",
"status_reason": "<string>",
"last_verified_at": "2023-11-07T05:31:56Z",
"last_used_at": "2023-11-07T05:31:56Z",
"rotated_at": "2023-11-07T05:31:56Z",
"created_by": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}Re-test a stored credential against its registry
Requires credentials:manage rather than credentials:read, because
it causes an outbound authentication attempt against a third party: a
read permission that makes network requests on the customer’s account
is a read permission that can lock the account out.
Only a registry that actively REJECTED the credential marks it invalid. A timeout or an unreachable host leaves the status untouched: marking a working credential invalid on a network blip is how a customer’s scanning stops for a reason nobody can find.
curl --request POST \
--url https://app.trustivan.com/api/v1/registry-credentials/{id}/verify \
--header 'Authorization: Bearer <token>'import requests
url = "https://app.trustivan.com/api/v1/registry-credentials/{id}/verify"
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/registry-credentials/{id}/verify', 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/registry-credentials/{id}/verify"
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))
}{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"kind": "registry",
"registry": "ghcr.io",
"scheme": "basic",
"status": "unverified",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"username": "<string>",
"external_id": "<string>",
"status_reason": "<string>",
"last_verified_at": "2023-11-07T05:31:56Z",
"last_used_at": "2023-11-07T05:31:56Z",
"rotated_at": "2023-11-07T05:31:56Z",
"created_by": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}Authorizations
Response
The credential, with its refreshed status.
A stored registry credential, without its secret. There is no read path for the plaintext at any permission, so no response anywhere carries one. A customer who has lost their token rotates it.
registry for a credential served by /registry-credentials,
git for one served by /git-credentials. The listings return
only their own kind, but the routes that take an {id} reach any
credential the organization holds, so rotating the credential
behind a cloud account or a cluster answers with cloud or
kubernetes. The two surfaces share
this schema and are separate stores: github.com serves both a
registry and a repository host, the tokens differ, and they are
rotated on different schedules.
registry, git, cloud, kubernetes The canonicalised host this credential authenticates to, such as
ghcr.io or registry.example.com:5000, or github.com or
bitbucket.example.com:8443 for a git credential. Also the
matching key: a credential is selected for a scan by the host of
the image or repository being scanned, never named by the caller.
"ghcr.io"
unverified has never authenticated, active last did so
successfully, invalid was rejected by the registry, disabled
was switched off by an administrator. A timeout or an unreachable
host leaves the status untouched rather than marking it invalid.
unverified, active, invalid, disabled Stored in plaintext deliberately: it is not a secret, and it is
what makes "which account is this" answerable. What it holds
depends on the scheme: a username for basic, the role ARN for
assume_role, the access key id for aws_access_key,
<tenant-id>/<client-id> for azure_service_principal. Absent for
token, bearer and gcp_service_account.