Secrets and cloud identity
Secrets
secrets: grants secrets by name, on a job (for every step) or on a step. Each grant is a name, or {name, env} to also put the value in a variable.
- Each granted secret is a file in
$HOD_SECRETS, readable only during the step, and withenvalso a variable, for that step only. - Values are replaced by
***in the logs, also when they are base64-, URL- or JSON-encoded. Values must be 8 bytes or more. - There is no
secretsin CEL: a value can't reachenv:,if:or outputs. - A step with secrets is never served from the step cache, and
cache:on it is an error. - On a server, a granted secret that isn't set, whose rule doesn't allow the run, or any secret on a fork's run, fails the job with reason
secretbefore it starts. Storing secrets is in Secrets.
Steps of a job share a container, so the job, not the step, is the boundary: put a step that uses a valuable secret in a job of its own.
Cloud identity
identity: gives a job's steps, or one step, short-lived OIDC tokens signed by the Hod server, which AWS, GCP, Azure and Vault can trust instead of a stored key. identity: {audience: sts.amazonaws.com} makes one token, named token; a list of {name, audience} makes several.
- Each token is a file in
/run/hod/identity/<name>, refreshed while the step runs and masked in the logs.$HOD_IDENTITY_TOKEN_FILEis the first one's path. - A step with a token is never cached. Runs from forks get none.
- What the token's claims are, and how to set up the cloud side, is in OIDC identity.
On your machine
hod local run asks where each secret comes from: --secret NPM_TOKEN=env:NPM_TOKEN, =file:PATH or =cmd:"op read op://ci/npm/token", or a prompt on a terminal. It signs no tokens: say where each one comes from with --identity token=cmd:"vault print token" or =file:PATH.