Secrets
A secret is a declared need, supplied per instance by a verb that never displays it, and delivered to the unit as a file at a path the Core derives and never opens.
Declared
needs: [ "secret:token" ]
- A Plugin declares it in its Manifest; a unit with no Manifest declares it in the composing document.
- It transfers no authority: a declared need opens nothing until a value is present.
- A document does not bind it. The name already says which secret is meant, and a
bindentry naming a secret is refused.
Supplied
yoke instance set-secret <instance> <secret>
yoke service set-secret <secret>
The verb reads the value without echoing it, writes it, and reports only that the secret is present.
| where, for an instance | <instance state>/secrets/<secret> |
| where, for a secret its unit rewrites | <instance state>/secrets/<secret>/value, in a 0700 directory of its own (below) |
| where, in the service form | /var/lib/yoke/secrets/<secret> |
| mode | 0600, owned by the account, in a 0700 directory |
| who reads it | the unit, at a path the Core derives |
| who prints it | nothing — not a report, not a listing, not an error |
| It is never in | |
|---|---|
| the instance record | which holds parameters, in clear, and is printed. A secret is not a parameter |
| the descriptor | which is signed and identical on every host |
| any report | |
| a process's environment |
- Which secrets are present is read from the directory, against what the deployment declares;
yoke instance showsays which are present and which are missing. Nothing writes a list of names.
Delivered
As a file, named by the argument the unit already declared — ${bind.<name>}, the substitution a
bound device uses, so the argument vector does not say which of the two it carries.
- For a containerised unit the file is mounted at the same absolute path inside the container.
- Never as an environment variable: an environment is readable from diagnostics, copied into core dumps, recorded by container engines and reprinted by error handlers. The one credential that travels in the environment is the bootstrap token, which is spent once within the startup window.
Refused, and restarted
- A missing secret is refused before anything runs:
secret.missing, naming it, at the gate. - A value is read at launch and held for the incarnation. Setting a new value on a running instance restarts the units that need it, and says which; where nothing runs, the verb says there is nothing to restart.
Rewritten by its unit
A Plugin that names a secret in rewrites replaces its value itself, and is not restarted for it — a
refresh token its provider rotates at every renewal.
| A secret its unit rewrites | Any other secret | |
|---|---|---|
| path | <state>/secrets/<name>/value | <state>/secrets/<name> |
${bind.<name>} | the path of value | the path of the file |
| how it is replaced | value.new written in the same directory, then renamed over value | by the verb alone |
| in a container | the directory, mounted read-write at the same path | the file, read-only, at the same path |
| a replacement by the unit | restarts nothing | — |
| a replacement by the verb | restarts the unit, as for any secret | restarts the unit |
- The unit reaches that secret and no other: what is mounted for it is its own directory.
- The Core still never opens it: it computes the path, mounts the directory, and reads nothing.
- A copy into another instance still carries none.
Copied
| A copy restored into | Secrets |
|---|---|
| the same instance | kept |
| another instance | stripped |