Secrets
Weik.io 2026.2Secret values are sealed with AES-256-GCM under the installation's master key. Weik.io can also get them from Azure Key Vault or HashiCorp Vault through a Dapr sidecar. Video
Watch: Where the values live, 4:37
The video moves a value into a variable and an API key into a secret, and shows what reaches the running integration.
This part of the video couldn't be loaded.
On this page
Store a value as a secret when an integration needs it but nobody should read it, such as an ERP’s API key or a database password. Weik.io seals every secret with AES-256-GCM under the installation’s master key, a file on each backend host. The master key is never in the message server’s storage or in a backup.
Secret values never go into Git. An exported configuration has a secret’s name and description but not its value.
Set a secret#
$ weikio secret set finance/erp-api-key --env productionType the value at the hidden prompt. You can also pipe the value in, or give a file with --from-file. The command never echoes the value or prints it masked.
Without --env, the secret is the project’s default, which every environment uses unless it has a value of its own. --integration erp-invoice-export sets a value that only that integration receives.
An integration uses a secret through a plain Camel property placeholder, such as {{erp-api-key}}, as it uses a variable. Variables and secrets shows which value each environment gets.
A running integration keeps the old value until its next start. weikio secret set lists the deployments that use the secret and a weikio restart line for each. Add --restart to have it restart them.
How an integration gets secrets#
At each start the agent writes the deployment’s values into a properties file that only the agent’s user can read. The integration loads them from that file. A secret is never on a command line, so it doesn’t show in a process list. On the agent’s host, disk encryption protects the file, as Encryption at rest describes.
Reveal a value#
Revealing a secret needs a role with the verb reveal and an environment that allows reveals. weikio env set turns reveals off in an environment:
$ weikio secret reveal finance/erp-api-key --env devtest
$ weikio env set production --allow-secret-reveal=falseIn an environment that doesn’t allow reveals, nobody can reveal a secret, platform administrators included. In one that allows them, each caller can reveal ten values a minute.
The audit trail records who revealed each value and from which address. To list the reveals, query the action SecretRevealed:
$ weikio audit query --since 7d --action SecretRevealedYou can’t reveal a value that comes from an external secret store.
The master key#
You create the master key before the first start, as a file of 32 random bytes that only the user the images run as can read. Keep a copy off the server and apart from the backup archives, because a restore needs a key that no archive contains.
Change the master key#
-
Create a new key file:
Terminal$ head -c 32 /dev/urandom > /opt/weikio/master.key.new && chown 1654:1654 /opt/weikio/master.key.new && chmod 0400 /opt/weikio/master.key.new -
Re-seal everything with the new key:
Terminal$ docker compose run --rm infra weikio-backend secrets rotate --new-key-file /opt/weikio/master.key.new -
Put the new key where
WEIKIO_MASTER_KEY_FILEpoints on every backend server. -
Restart the backends one at a time.
The secrets rotate command re-seals everything the master key protects:
- Every secret
- Every local user’s password hash and second factor
- Every signing key
The backup service seals its next archive with the new key.
Keep the old key for as long as you keep the archives taken before the change, because they open only with it.
External secret stores#
Weik.io gets secret values through Dapr. It can use the secret stores Dapr supports, such as Azure Key Vault or HashiCorp Vault.
You run the Dapr sidecar yourself in the backend’s network namespace, for example as a service with network_mode: "service:backend" in docker-compose.override.yaml. Give the backend the Dapr settings in the same file:
services:
backend:
environment:
Weikio__Secrets__Dapr__Enabled: "true"
Weikio__Secrets__Dapr__BaseUrl: http://localhost:3500
Weikio__Secrets__Dapr__Store: <the name of the secret store component>
Weikio__Secrets__Dapr__ApiTokenFile: /run/secrets/dapr-api-token
volumes:
- /path/to/dapr-api-token:/run/secrets/dapr-api-token:roThen run docker compose up -d to load the override file along with the stack file.
Weik.io looks up a name in the store only when it has no value of that name itself.
Some stores, such as Azure Key Vault, answer with an error when they don’t have a name. A deployment that uses a name that neither Weik.io nor such a store has then stays blocked. Its status shows what the store answered.
When every placeholder of that name has a default, such as {{name:default}}, or is marked optional, such as {{?name}}, Weik.io logs a warning and starts the deployment without the value. Each placeholder then uses its default, or is empty when it’s optional.
Platform secrets#
Store the credentials Weik.io itself uses as platform secrets, such as the token of a telemetry forwarding destination or of a DNS connection:
$ weikio platform secret set siem-tokenOnly platform administrators manage platform secrets, which can’t be revealed and never reach a deployment.
You can’t delete a platform secret while something refers to it:
- A forwarding document
- A DNS connection
- A certificate authority