OpenBao bootstrap (non-dev, persistent)
OpenBao uses file storage in the openbao_data volume and HTTPS on 8200. The operator owns initialization, unseal shares and the initial root token. They are never stored in Git, .env, images or application configuration.
First initialization (PowerShell)
-
Generate local TLS files with
scripts/bootstrap-certs.ps1. -
Start only OpenBao:
docker compose up -d openbao. -
Initialize once and save the output securely offline:
docker compose exec openbao bao operator init -key-shares=3 -key-threshold=2 -
Unseal using two distinct shares:
docker compose exec openbao bao operator unsealRepeat with the second share. Never put shares in scripts or source control.
-
Run
scripts/bootstrap-openbao.ps1. It prompts for the root token without echoing it, creates KV v2, policies and AppRole roles, then writes short-lived SecretIDs and RoleIDs to ignored local files undersecrets/bao/. -
Start API/worker after bootstrap. Each service authenticates with its own AppRole and reads only its own KV path. The application never receives the root token or unseal material.
Restart
The storage volume persists. After an ordinary restart, check bao status. If sealed, an operator must unseal with two shares. Do not automate unseal by placing shares beside the container.
KV v2 secrets are static for this lab-3 baseline. Rotate AppRole SecretIDs by generating new IDs, updating the local files and restarting the affected service. Dynamic credentials and zero-downtime rotation are outside the selected grade.