Skip to main content
Version: 0.6.0

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 bind entry 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, in the service form/var/lib/yoke/secrets/<secret>
mode0600, owned by the account, in a 0700 directory
who reads itthe unit, at a path the Core derives
who prints itnothing — not a report, not a listing, not an error
It is never in
the instance recordwhich holds parameters, in clear, and is printed. A secret is not a parameter
the descriptorwhich 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 show says 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.

Copied​

A copy restored intoSecrets
the same instancekept
another instancestripped