# Construction plan: user-engine OpenBao runtime custody
## 1. Demand
The live portal edge marker and identity-provisioner service token are
bootstrap Kubernetes Secrets without an authoritative rotation source.
`user-engine` and `identity-provisioner` need the same runtime behavior with
OpenBao as authority and External Secrets Operator as delivery mechanism.
## 2. Existing-structure survey
-`Secret/user-engine-runtime` in namespace `user-engine` contains only
`proxy-secret`.
-`Secret/identity-provisioner-client` in namespace `user-engine` and
`Secret/identity-provisioner-token` in namespace `sso` carry the two copies
of the provisioner service token.
- The applications already consume only Secret references; no code or
Deployment interface change is required.
- The established `rapp-qonto` bridge proves that railiance01 External Secrets
must currently use AppRole against the OpenBao instance on CoulombCore;
railiance01 service-account tokens cannot use that instance's Kubernetes
auth mount.
- Existing activity-core stores and policies are unrelated and must not be
widened or reused across this identity boundary.
## 3. Proposed changes
| # | Action | Object | Rationale |
|---|---|---|---|
| 1 | create | KV path `platform/workloads/user-engine/runtime` | One authoritative workload path with fields `PROXY_SECRET` and `PROVISIONER_TOKEN` |
| 2 | create | policy `workload-kv-read-user-engine-runtime` | Read and metadata access only to the exact KV v2 path |
| 3 | create | AppRoles `external-secrets-user-engine` and `external-secrets-sso-user-engine` | Separate revocable bootstrap identities for the two consuming namespaces |
| 5 | create | namespace-restricted ClusterSecretStores for `user-engine` and `sso` | Prevent either identity from becoming a general cross-namespace store |
| 6 | create | three ExternalSecrets targeting the existing Secret names | Preserve application interfaces while changing authority |
| 7 | migrate | existing values into the KV path through a wrapped platform-admin process | Read source and write destination in one process; never return either value |
| 8 | verify | metadata, rollout, positive/negative authentication, and rotation rehearsal | Record field names, readiness, denial, and rollout only |
| 9 | retire | manual Secret-copy/bootstrap procedure | ExternalSecret becomes the sole writer and rotation path |
The migration does not mint a new application capability. It moves two
existing values into governed custody. Same-cluster Kubernetes auth remains
the target after OpenBao moves to reef-railiance.
## 4. Review and optimization
- Separate AppRoles avoid widening one namespace identity across `sso` and
`user-engine`.
- Both policies resolve to one exact path, avoiding duplicate values and