Skip to content
Secrets StoreMarkdown

Keep the organization's secrets

Keep shared infrastructure credentials in the realm's own vault, which outlives any one user's account.

API

Some secrets belong to the organization, not to any one user: infrastructure credentials, signing material for partners. Kept in the realm’s vault, they outlive any account. Every realm administrator can reach them, and no one else can unless an administrator grants it.

Before you start: you are a realm administrator (a member of a group holding RealmOwner, or a privilege of your own that allows MODIFY on secrets), the store is on, and you are signed in with your session in $CVYUH_SESSION (Call the API shows how). The engineering group has had a member open its vault once, so a grant can be sealed to it.

  1. Write it into the realm’s vault:

    Terminal window
    curl https://foobar.cvyuh.com/api/v0/vault/managed/v1/realm/data/infra/db-root \
    -H "Cookie: x-cvyuh-token=$CVYUH_SESSION" \
    -H "Content-Type: application/json" \
    -d '{ "data": { "user": "root", "password": "<password>" } }'
  2. List the vault:

    Terminal window
    curl "https://foobar.cvyuh.com/api/v0/vault/managed/v1/realm/metadata?list=true" \
    -H "Cookie: x-cvyuh-token=$CVYUH_SESSION"
  3. Let the engineering team use it, without seeing anything else:

    Terminal window
    curl https://foobar.cvyuh.com/api/v0/vault/managed/v1/realm/grants/infra/db-root \
    -H "Cookie: x-cvyuh-token=$CVYUH_SESSION" \
    -H "Content-Type: application/json" \
    -d '{ "group": "engineering", "access": "use" }'

    A member of the group reads it at https://foobar.cvyuh.com/api/v0/vault/managed/v1/realm/data/infra/db-root.

Anyone who isn’t a realm administrator and holds no grant is refused (403). A GET on https://foobar.cvyuh.com/api/v0/vault/managed/v1/realm/grants/infra/db-root lists the grants on it.

If the grant answers 404, no member of engineering has opened the group’s vault yet: one of them lists it once, then grant again.

Take a grant back:

Terminal window
curl -X DELETE https://foobar.cvyuh.com/api/v0/vault/managed/v1/realm/grants/infra/db-root/<edgeId> \
-H "Cookie: x-cvyuh-token=$CVYUH_SESSION"

The grant’s copy opens from the key of whoever last wrote the secret. If that administrator is later deleted, the group’s reads stop until another administrator writes the secret again.