Secrets
What a secret is here
A secret is a file. Whoever runs the control plane — Docker Compose, Kubernetes, or whatever else starts the container — puts it inside the container at /run/secrets/<name>, read-only. The control plane reads it at startup and keeps the value in memory. It never writes a secret, never generates one, and never puts one in the database, in a log line, or in anything you can download from the user interface.
That is the whole mechanism, and it is why the control plane can be scaled, restarted, moved to another machine or replaced without ceremony: nothing it needs to remember lives on its own disk.
The secrets
File at /run/secrets/ | What it protects | Set by |
|---|---|---|
session_key | The signature on browser session cookies | SESSION_SECRET_FILE |
config_encryption_key | The stored license key, the stored copies of API gateway key secrets, every env file version, the single sign-on client secret entered on the Configuration page, the alert notification secrets, and the private keys of the control plane's root certificate and of the certificates it presents, encrypted at rest | CONFIG_ENCRYPTION_KEY_FILE |
object_storage_access_key | Access to the object storage that holds error report packages | OBJECT_STORAGE_ACCESS_KEY_FILE |
object_storage_secret_key | The same | OBJECT_STORAGE_SECRET_KEY_FILE |
api_gateway_database_password | The API gateway's own database account, which can only read what the API gateway reads | API_GATEWAY_DATABASE_PASSWORD_FILE |
The variables in the last column exist so a deployment can put the files somewhere else. Leave them unset and the paths above are used. To set one, write the variable into /etc/onprem-ai/control-plane/config.env and run sudo onprem-ai-ctl apply.
The first four belong to the control plane. The last one is read by two parts only: the control plane's first start step (the init service), which creates the API gateway's database account, onprem_ai_api_gateway, with this password on every start and allows it to read exactly what the API gateway reads; and the API gateway, which signs in to the database with it. The API gateway answers the inference API, often from the internet, so it never receives the database's own administrator password: with that account, nobody who took over the API gateway can create join tokens, take back a revocation, or switch a removed inference node back on. The API gateway is given the database address without any password (API_GATEWAY_DATABASE_URL, for example postgresql://postgres:5432/onprem_ai) and adds the account and this password itself.
The configuration encryption key is also read by the edge-certificate-writer service, which decrypts the private keys of the certificates the control plane presents on its two ports and to inference nodes, and writes them, readable only by itself, the edge proxy and the inference node transport endpoint, into the edge-certificates volume that only those services mount. It reads no other secret.
One more secret file belongs to single sign-on: a deployment that sets single sign-on in its environment gives the client secret as a file too, named by OIDC_CLIENT_SECRET_FILE. It is the one secret the installer never generates, because the value comes from your identity provider: the installer creates secrets/oidc_client_secret empty, and it stays empty until you write the client secret into it. See Single sign-on.
One more may stay empty: a deployment that is provisioned and operated with nobody signing in can give the control plane a control plane API key, as the key's digest in a file named by PROVISIONED_CONTROL_PLANE_API_KEY_DIGEST_FILE. The key itself stays with the provisioning system; the control plane holds only its digest, the lowercase hexadecimal SHA-256 of the key (printf %s "$KEY" | sha256sum). Three more settings go with it: PROVISIONED_CONTROL_PLANE_API_KEY_USERNAME, the account the key acts as; PROVISIONED_CONTROL_PLANE_API_KEY_NAME, its name under Settings → MCP access; and PROVISIONED_CONTROL_PLANE_API_KEY_CREATE_ADMINISTRATOR=true to create that account as an administrator without a password when it does not exist. At every start the key is added when it is not there yet, and the audit log records it once. Removing the settings later does not remove the key: revoke it under Settings → MCP access. A new key needs a new name. The installer creates secrets/control_plane_api_key_digest empty; to use it, write the digest into it and set PROVISIONED_CONTROL_PLANE_API_KEY_DIGEST_FILE=/run/secrets/control_plane_api_key_digest with the other three in /etc/onprem-ai/control-plane/config.env, then run sudo onprem-ai-ctl apply. Without the settings it is never read. To make a key on the machine instead, run sudo onprem-ai-ctl api-key create --bypass-sign-in --username NAME --name KEY_NAME: it prints the key once.
Every instance of the control plane must receive the same four values, and every API gateway and the init service the same api_gateway_database_password. Two instances with different session keys will log each other's users out on every second request; two with different configuration encryption keys will disagree about whether the stored license key can be read at all.
Providing them with the one-line installer
A control plane installed with install.sh control-plane needs nothing from you here: the installer is its orchestrator. On the first install it generates every secret into secrets/ in the control plane's data folder (/var/lib/onprem-ai/control-plane/ on Linux), each file readable only by the one part of the control plane that uses it, together with the database password and the key the object storage's nodes authenticate each other with, and every later run and every update keeps them exactly as they are. The rest of this page is what those files are, and what changing one costs. See Installing and updating the control plane.
Providing them with Docker Compose
The compose file that ships with the platform declares them like this:
services:
backend:
environment:
SESSION_SECRET_FILE: /run/secrets/session_key
CONFIG_ENCRYPTION_KEY_FILE: /run/secrets/config_encryption_key
secrets:
- session_key
- config_encryption_key
- object_storage_access_key
- object_storage_secret_key
api-gateway:
environment:
API_GATEWAY_DATABASE_URL: postgresql://postgres:5432/onprem_ai
API_GATEWAY_DATABASE_PASSWORD_FILE: /run/secrets/api_gateway_database_password
secrets:
- api_gateway_database_password
secrets:
session_key:
file: ./.secrets/session_key
config_encryption_key:
file: ./.secrets/config_encryption_key
object_storage_access_key:
file: ./.secrets/object_storage_access_key
object_storage_secret_key:
file: ./.secrets/object_storage_secret_key
api_gateway_database_password:
file: ./.secrets/api_gateway_database_password
The init service lists api_gateway_database_password too, because it is what creates the API gateway's database account. The API gateway has no env_file with the database's administrator password: it gets its own environment block instead.
Listing a secret by name is all that is needed: Docker mounts it at /run/secrets/<name>, which is where the control plane looks. The two object storage variables are absent from the snippet on purpose — nothing overrides them, so the defaults in the table above apply. Set one only when a file has to live somewhere else.
Point the file: entries wherever your machine keeps them. Docker copies the contents in; the directory itself is never visible to the container.
Providing them on a development machine
There is no orchestrator on a laptop, so a script plays that role: dev/run-dev.sh runs planes/control/dev/create-dev-secrets.sh for you before bringing the stack up. You can also run that script by hand, any time, from the repository root:
planes/control/dev/create-dev-secrets.sh
It creates the five files under planes/control/.secrets/ (git-ignored, mode 600) and never replaces a value that is already there, so running it again after a secret was added is safe: it creates the new one and changes nothing else.
Providing them with Kubernetes
One Secret with the control plane's four keys, mounted as a volume, gives the same four paths; the API gateway's password is a Secret of its own, mounted into the API gateway and the init job only:
apiVersion: v1
kind: Secret
metadata:
name: control-plane-secrets
type: Opaque
stringData:
session_key: "<value>"
config_encryption_key: "<value>"
object_storage_access_key: "<value>"
object_storage_secret_key: "<value>"
---
# in the pod spec
volumeMounts:
- name: control-plane-secrets
mountPath: /run/secrets
readOnly: true
volumes:
- name: control-plane-secrets
secret:
secretName: control-plane-secrets
defaultMode: 0400
Nothing in the container changes: the same paths, provided by a different orchestrator.
Creating the values
Any high-entropy random value works for the first two. On any Linux or macOS machine:
openssl rand -base64 48 > session_key
openssl rand -base64 32 > config_encryption_key
The two object storage values are the access key pair for the object storage location named by OBJECT_STORAGE_BUCKET, which holds the control plane's stored files: error report packages, deployment plans and catalog files. Nothing creates them for you: like the other two, they are values you choose and hand to the platform. If you run the object storage that ships with the platform, it starts with the pair you provide and creates that location when the stack first starts. Use hexadecimal values, so no character needs quoting:
openssl rand -hex 12 > object_storage_access_key
openssl rand -hex 32 > object_storage_secret_key
The API gateway's database password is any high-entropy value without spaces:
openssl rand -hex 24 > api_gateway_database_password
If you point the control plane at your own S3-compatible object storage instead, use the access key pair that storage gave you, and give that key read and write access to the bucket named by OBJECT_STORAGE_BUCKET and nothing else.
What changing one costs
session_key— everyone signed in is signed out and signs in again. Nothing else is affected, and nothing is lost. Change it whenever you have reason to.config_encryption_key— the stored license key becomes unreadable, and so does the stored copy of every API gateway key secret and every env file version. It is the key all of them are encrypted with, and there is no way back from a lost value. The API gateway keys themselves keep working: the API gateway checks a digest of each secret, not the stored copy, so only the copy is lost. If you must change it, enter the license key again on the Configuration page immediately afterwards, and regenerate any key whose stored copy you still want, with "Store API secret value" on, and save a new version of every env file under Configuration → Env files, then restart the replicas that use them; the control plane will tell you plainly that a stored copy cannot be decrypted until you do. Never change this value as part of a routine rotation without planning those steps.api_gateway_database_password: nothing is lost. Replace the file and rundocker compose up -din the control plane's folder: theinitservice sets the new password on the API gateway's database account before the API gateway starts again with it. Until both happen, the API gateway cannot read the database and refuses requests.object_storage_access_key/object_storage_secret_key— the control plane cannot read or write its stored files (error report packages, deployment plans, catalog files) until the new pair is valid forOBJECT_STORAGE_BUCKET. Existing packages are untouched; change the pair in the object storage first, then in the secret, then restart.
What the control plane makes itself: certificates and join tokens
The secrets above are the only values you provide. The control plane's certificates are made by the control plane: the first step of every start (the init service) makes the root certificate if there is none, and stores its private key in the database encrypted under config_encryption_key. A database backup alone therefore signs nothing. The certificates the control plane presents are made from that root and renewed on their own; none is a secret you manage. Join tokens are made by Servers, Add Inference Node, each valid once and for 15 minutes.
When one is missing
The control plane refuses to start, and says which: the variable, the path it looked at, and the reason the operating system gave. A container that exits immediately after starting, with a message naming one of the files above, is this and nothing else. An update of a control plane installed before api_gateway_database_password existed creates that file on its own, the way the installer does.
Why there is no page for this in the user interface
Everything else about running this platform is reachable from the control plane. Secrets are not, deliberately: a process that could write its own secret would be able to replace the value that protects your license key, and would give a second instance a different one. Providing a secret is an act of whoever runs the orchestrator, performed once, alongside choosing the database and the network. It has no user interface and will not get one.