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).
Turn it on and set the rules
Section titled “Turn it on and set the rules”-
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
201the first time and200after. Until then, every other call to the store answers409. -
Read the settings, and note the
revin the answer:Terminal window curl https://foobar.cvyuh.com/api/v0/am/objects/v1/vaultSettings/vaultSettings \-H "Cookie: x-cvyuh-token=$CVYUH_SESSION" -
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:
| Setting | Default |
|---|---|
managed.maxVersions | 10, from 1 to 100 |
managed.casRequired | false |
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.enabled | true |
Check it worked
Section titled “Check it worked”Anyone signed in reads what vaults take:
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.
Good to know
Section titled “Good to know”- A secret’s own settings win. A path’s
max_versionsanddelete_version_afteroverride the realm’s. A path can require check-and-set, but can’t lift the realm’smanaged.casRequired. - A nomination’s
delayand a share’sttlwin over the defaults, and a share’s never goes pastshareMaxTtl. managed.tokenReusesets how long a sign-in keeps its access to its own keys open between requests:sessionkeeps it forttlseconds (10 to 3600),requestreopens 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.
Related
Section titled “Related”- Realm settings: every setting, with its range.
- Sealed vault settings: the
sealedsection.