Skip to content
Secrets StoreMarkdown

Set the realm's defaults

Turn the secrets store on for your realm, and set the history, check-and-set, share and emergency rules every vault follows.

API

Every vault in the realm follows the realm’s rules unless a secret sets its own: how much history is kept, whether writes must name the version they replace, and how long one-time shares and emergency delays last. As a realm administrator, you turn the store on once, then change the rules whenever your policy changes.

Before you start: you are a realm administrator holding RealmOwner, signed in with your session in $CVYUH_SESSION (Call the API shows how).

  1. Turn the store on:

    Terminal window
    curl -X POST https://foobar.cvyuh.com/api/v0/vault/managed/v1/enable \
    -H "Cookie: x-cvyuh-token=$CVYUH_SESSION"

    The realm writes its settings at their defaults, and answers 201 the first time and 200 after. Until then, every other call to the store answers 409.

  2. Read the settings, and note the rev in the answer:

    Terminal window
    curl https://foobar.cvyuh.com/api/v0/am/objects/v1/vaultSettings/vaultSettings \
    -H "Cookie: x-cvyuh-token=$CVYUH_SESSION"
  3. Change what you need, each field in its section:

    Terminal window
    curl -X PATCH https://foobar.cvyuh.com/api/v0/am/objects/v1/vaultSettings/vaultSettings \
    -H "Cookie: x-cvyuh-token=$CVYUH_SESSION" \
    -H "Content-Type: application/json" \
    -H 'If-Match: "<rev>"' \
    -d '{ "managed": { "maxVersions": 5, "casRequired": true }, "shareMaxTtl": 86400 }'

    A field the settings don’t name answers 400. A change made since your read makes yours fail (412) rather than overwrite it: read again and retry.

The settings you can change:

SettingDefault
managed.maxVersions10, from 1 to 100
managed.casRequiredfalse
managed.deleteVersionAfter (seconds; 0 keeps versions)0
managed.emergencyDelayDefault (seconds)604800, a week
managed.tokenReuse{ "mode": "session", "ttl": 600 }
shareDefaultTtl (seconds)600
shareMaxTtl (seconds, at most 30 days)604800, a week
sealed.enabledtrue

Anyone signed in reads what vaults take:

Terminal window
curl https://foobar.cvyuh.com/api/v0/vault/managed/v1/config \
-H "Cookie: x-cvyuh-token=$CVYUH_SESSION"

The answer shows max_versions, cas_required and delete_version_after.

  • A secret’s own settings win. A path’s max_versions and delete_version_after override the realm’s. A path can require check-and-set, but can’t lift the realm’s managed.casRequired.
  • A nomination’s delay and a share’s ttl win over the defaults, and a share’s never goes past shareMaxTtl.
  • managed.tokenReuse sets how long a sign-in keeps its access to its own keys open between requests: session keeps it for ttl seconds (10 to 3600), request reopens it on every request, stricter and slower.
  • Sharing has no other rules yet. Anyone who may view a secret can grant or share it to anyone in the realm. See What’s next for sharing.