OpenBao Secrets Management¶
Overview¶
OpenBao is an open-source secrets management platform, forked from HashiCorp Vault after it moved to a non-open-source license. OpenBao provides a secure, centralized way to manage sensitive data such as:
- API keys and tokens
- Database credentials
- TLS certificates
- Encryption keys
- Any sensitive configuration
Key Features¶
- Centralized Secrets Storage: Single source of truth for all secrets
- Dynamic Secrets: Generate credentials on-demand with automatic expiration
- Encryption as a Service: Encrypt/decrypt data without exposing keys
- Access Control: Fine-grained policies based on identity
- Audit Logging: Complete audit trail of all secret access
- Kubernetes Integration: Native support for injecting secrets into pods
Architecture¶
┌─────────────────────────────────────────────────────────────────┐
│ OpenBao Server │
│ https://openbao.prod.skatzi.com │
├─────────────────────────────────────────────────────────────────┤
│ │
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────────────────┐ │
│ │ OIDC Auth │ │ AppRole Auth│ │ KV v2 Secrets │ │
│ │ (Keycloak) │ │ (ESO) │ │ Engine │ │
│ └─────────────┘ └─────────────┘ └─────────────────────────┘ │
│ │
└─────────────────────────────────────────────────────────────────┘
│ │
│ │
┌────▼────┐ ┌────▼────┐
│ Users │ │ ESO │
│ (CLI) │ │Operator │
└─────────┘ └────┬────┘
│
┌────▼────┐
│ K8s │
│ Secrets │
└─────────┘
One replica on one volume¶
OpenBao runs as a single replica, openbao-0, in standalone mode with Raft storage on one Hetzner volume (PV openbao-data-pv, volume 104432273, Retain); see components/openbao/base/. There is no standby. When that volume's device stops completing I/O, the secrets store is down until it answers again: ExternalSecrets stop refreshing (the Secrets they made earlier stay), and the openbao ClusterSecretStore is not Ready. external-secrets-config health-checks that store (cluster/hetzner-mgmt/external-secrets/kustomization.yaml), so it and every Kustomization that depends on it, directly or through its own dependencies, are frozen. On 2026-11-03 that was 26 Kustomizations (#2362's report, pull request #1128; the storm report has the recovery). What to do is in the ops runbook: Pod stuck on a volume that stopped completing I/O.
Authentication Methods¶
| Method | Use Case | How it Works |
|---|---|---|
| OIDC | Human users via CLI | Authenticates through Keycloak, browser-based login |
| AppRole | External Secrets Operator, agent-runner Codex login sync | Service-to-service auth, syncs to K8s Secrets |
Secrets Structure¶
Secrets are organized hierarchically under the clusters/ path:
clusters/
└── hetzner-mgmt/ # Management Cluster
├── info # Cluster metadata
├── test # Test secret
├── apps/ # Application secrets
│ ├── frontend/
│ └── backend/
├── agent-runners/ # One set per agent-runner pod (components/agent-runner)
│ ├── <runner> # password, gitea_token
│ ├── <runner>-codex-auth # auth_json, written back by the pod's sidecar
│ └── <runner>-codex-auth-approle # role-id, secret-id of the sidecar's AppRole
├── databases/ # Database credentials
└── external-services/ # Third-party API keys
Current Projects & Access¶
Cluster: hetzner-mgmt¶
| Path | Description | Access |
|---|---|---|
clusters/hetzner-mgmt/* |
Management cluster secrets | mgmt-k8s-admins group |
Policies¶
| Policy | Description | Capabilities |
|---|---|---|
admin |
Full administrative access | All operations on all paths |
mgmt-cluster-admin |
Hetzner mgmt cluster admin | Full CRUD on clusters/hetzner-mgmt/* |
external-secrets |
External Secrets Operator | Read-only on clusters/hetzner-mgmt/* |
agent-runner-<runner>-codex-auth |
Codex login sync of one agent-runner pod | create, update, read on clusters/data/<cluster>/agent-runners/<runner>-codex-auth only |
Keycloak Group Mappings¶
| Keycloak Group | OpenBao Policy | Access Level |
|---|---|---|
mgmt-k8s-admins |
mgmt-cluster-admin |
Full access to mgmt cluster secrets |
administrators |
admin |
Full administrative access |
AppRole for External Secrets Operator¶
| Role | Policy | Purpose |
|---|---|---|
external-secrets |
external-secrets |
ESO reads secrets and syncs to K8s |
AppRoles for agent-runner Codex login sync¶
Each agent-runner pod has a codex-auth-sync sidecar that writes the runner's
rotated Codex login back to OpenBao. It is the only in-cluster writer, so each
runner gets its own AppRole limited to its own login path.
| Role | Policy | Purpose |
|---|---|---|
agent-runner-<runner>-codex-auth |
agent-runner-<runner>-codex-auth |
Sidecar writes <runner>-codex-auth; credentials stored at clusters/<cluster>/agent-runners/<runner>-codex-auth-approle and synced by ESO |
The policy, role and commands are in components/agent-runner/README.md.
Kubernetes Secret Sync (External Secrets Operator)¶
Secrets from OpenBao are synced to Kubernetes using External Secrets Operator (ESO).
How it works¶
- Secrets are stored in OpenBao at
clusters/hetzner-mgmt/<component>/<secret-name> - An
ExternalSecretresource is created in the component's namespace - ESO reads from OpenBao and creates a native Kubernetes Secret
- Applications use the Kubernetes Secret normally (via
existingSecret, env vars, etc.)
Example ExternalSecret¶
apiVersion: external-secrets.io/v1
kind: ExternalSecret
metadata:
name: gitea-admin
namespace: gitea
spec:
refreshInterval: 1h
secretStoreRef:
name: openbao
kind: ClusterSecretStore
target:
name: gitea-admin-secret
creationPolicy: Owner
data:
- secretKey: username
remoteRef:
key: hetzner-mgmt/gitea/admin
property: username
- secretKey: password
remoteRef:
key: hetzner-mgmt/gitea/admin
property: password
Quick Links¶
- Setup Guide - Install CLI and authenticate
- CRUD Operations - Create, read, update, delete secrets
- Create New Project - Set up secrets for a new project
- Backups, Snapshot Check and Restore Drill - Nightly Raft snapshots, the monthly drill and the manual restore
- Rolling Out a Pod-Template Change - The restart window after a change to the StatefulSet's pod, and the expected
KubeStatefulSetUpdateNotRolledOut
URLs¶
| Service | URL |
|---|---|
| OpenBao API | https://openbao.prod.skatzi.com |
| Keycloak (Auth) | https://keycloak.prod.skatzi.com/realms/skatzi |
Security Notes¶
Unseal Keys
OpenBao requires unsealing after every restart. The unseal keys and root token are stored securely in Terraform tfvars and should never be committed to version control. A backup snapshot cannot be restored without them; see Where the unseal keys come from.
External Secrets Operator
ESO syncs secrets from OpenBao to Kubernetes Secrets. The AppRole credentials are stored in Terraform and deployed via the openbao-approle secret in the external-secrets namespace.
Least Privilege
Always request the minimum permissions needed. Use project-specific policies rather than broad admin access.