Credentials¶
A credential is a named secret you enter once and reuse: an SSH private key, a cloud API token, a Git deploy token. Liftway writes the value to Vault KV v2 and stores only a reference in PostgreSQL. After saving, values are never shown again — not in the console, not in the API, not in run snapshots.
you ──(value, once)──► controller ──(write role)──► Vault secret/runway/credentials/<id>/<revision>
│
└── PostgreSQL stores: name, type, field names, Vault location
runner ──(read role, at step start)──► Vault ──► extra var · environment variable · SSH key file
Your administrator sets up Vault once — see Vault integration. Until then, saving a credential fails with Could not store secret in Vault.
Credential types¶
A credential type declares a credential's fields and, for each field, where its value goes at run time.
Built-in types¶
| Type | Fields | Used by |
|---|---|---|
| Machine SSH | SSH private key; optional key passphrase; SSH username; known hosts | Ansible SSH connections, the SSH executor |
| Git HTTPS token | Username (default oauth2), token |
Projects over HTTPS |
| GitLab Deploy Token | The exact issued username (e.g. gitlab+deploy-token-123), token |
Projects over HTTPS |
| Git SSH key | Private key, verified known_hosts |
Projects over SSH |
Git types can only be attached to projects; runtime types (Machine SSH and your own) only to templates and workflows.
Custom types¶
Credential types → Add opens a field builder. Each field has:
| Setting | Options |
|---|---|
| ID | Stable identifier, e.g. token (letters, digits, _; not starting with a digit) |
| Label and help text | Shown in the credential form |
| Input type | String, Bool, Text, Big text, Integer, Choice |
| Target | Extra variable, Environment variable, SSH key, SSH key passphrase |
| Variable name | The extra variable or environment variable to set, e.g. HCLOUD_TOKEN |
| Required | Must be supplied when the credential is created |
| Mask input | Hide characters while typing (every value is stored write-only either way) |
A type can have up to 20 fields and needs at least one. SSH key and passphrase fields must be text and secret. Booleans and integers reach Ansible as native types; environment variables are always strings.
Example — a Hetzner Cloud token for Terraform:
| ID | Label | Type | Target | Variable |
|---|---|---|---|---|
token |
API token | String | Environment variable | HCLOUD_TOKEN |
Once any credential uses a type, the type's kind and fields are frozen. To change the schema, create a new type and new credentials.
Create a credential¶
Credentials → Add, choose the type, fill in the name and values, save.
- Leaving a field empty when editing keeps the stored value.
- You cannot change the type of an existing credential.
- Each save writes new values to a new Vault path (
<prefix>/<credential-id>/<random-revision>). Runs that already launched keep reading the old path, so editing a credential never changes a running job. - Deleting a credential is blocked while a project, template, workflow or execution environment refers to it. Old Vault revisions are not purged; your Vault administrator can remove them after checking retained runs.
Machine SSH¶
- Paste the private key (OpenSSH or PEM). Encrypted keys are supported: put the passphrase in Key passphrase. Keys are unlocked only in the worker's memory and written to temporary files readable by the runner user only; passphrases never appear in process arguments or environments.
- Set SSH username. It becomes
ansible_userunless the template's extra variables setansible_userexplicitly. The SSH executor also uses it unless the execution environment sets its own user. - Paste known hosts lines for your targets (
hostname key-type public-key), collected through a trusted channel such asssh-keyscanfrom a machine you trust and verified fingerprints. Liftway refuses lines that look like a private key. - Host key verification is on by default. Turning it off accepts any server key — only do this in throwaway labs.
Git credentials¶
For GitLab, prefer a project or group deploy token with only read_repository:
- In GitLab, create the deploy token and copy both the username and the token.
- In Liftway, choose GitLab Deploy Token, enter the exact username (it contains
+) and the token. - Use an
https://repository URL in the project and select the credential under Authentication.
A personal or project access token works with Git HTTPS token and username oauth2. For SSH, use Git SSH key with a read-only deploy key and the Git server's verified known_hosts.
Git credentials are for repository access only. Container registries need a Kubernetes image pull secret instead — see Execution environments.
Attach credentials to templates and workflows¶
A template can carry up to 20 runtime credentials. A workflow can add more at the workflow level or per step; at launch Liftway combines template, workflow and step credentials.
Rules checked at save and at launch:
- Bash and Terraform accept only credentials whose fields target environment variables.
- Two credentials may not write the same extra variable, the same environment variable, or a second SSH key into one step.
- SSH key credentials also bring their known hosts and host key setting into the step.
How values reach a job¶
At the start of each step the runner signs in to Vault with its own short-lived Kubernetes identity, reads only the paths in its snapshot, revokes its Vault token when it finishes and then:
| Target | Delivered as |
|---|---|
| Extra variable | An Ansible extra variable (or, for Bash, a key in the JSON file at $RUNWAY_EXTRA_VARS_FILE) |
| Environment variable | An environment variable of the Ansible, Bash or Terraform process |
| SSH key / passphrase | A temporary key file used for SSH connections |
The exact secret strings are replaced by [REDACTED] in job output. Transformed values are not: a base64-encoded token, a substring or a value printed by a debug task will appear in logs. Mark tasks that handle secrets with no_log: true — Liftway hides both the structured result and the raw output of such tasks.
Storage location¶
Administration → Settings → Vault configuration sets the KV v2 mount (default secret) and base prefix (default runway/credentials). These settings contain no secrets. Changing them affects only new writes; existing credentials keep their old location. Set them before the first credential is created and make sure the Vault policies match — see Vault integration.
Legacy references¶
Older templates could reference a Vault path directly (mount, path, key, target, name). Those templates still run; the next time you save one, Liftway converts each reference into a reusable credential named Imported …. A value rotated in Vault at the same path affects queued jobs that use such references, unlike managed credentials.