Kubernetes secrets from OpenBao and Vault with the Secrets Store CSI Driver

Mounting OpenBao or Vault secrets into pods with the Secrets Store CSI Driver keeps secret values out of Git and the etcd default path when set up correctly. This page covers provider choice, sync to Kubernetes Secrets, rotation and Kubernetes auth.

On this page

How Kubernetes secrets from OpenBao and Vault with the Secrets Store CSI Driver work

A platform team that wants pods to read secrets from a store it operates has a specific problem to solve. By default, Kubernetes stores Secrets unencrypted in etcd, so every secret written as a native Secret inherits the protection of the etcd cluster and its backups. The Secrets Store CSI Driver avoids that pattern by mounting secrets into a pod's filesystem at start time, fetching them on demand from an external store through a provider plugin. In this design, the source of truth is OpenBao or HashiCorp Vault, and Kubernetes holds only a reference to it. The Kubernetes documentation on secrets good practices describes this approach as one of the options for keeping secret material out of cluster storage.

The driver itself does not know how to talk to a secrets server. Each server needs a provider, and the provider path must be confirmed for the specific server you choose. OpenBao is an MPL-2.0 fork of Vault, and its migration guide was tested only against Vault 1.14.1 community edition, so do not assume that a Vault provider and its configuration carry over unchanged. Ask the provider maintainers which server versions and auth methods they test against, and confirm that your chosen version and any Enterprise features you rely on are covered. A SecretProviderClass object names the provider, the secret paths and the Vault or OpenBao role the pod will use.

Pod identity is the part that most often goes wrong. Kubernetes auth in the secrets store ties a pod's service account token to a role in OpenBao or Vault, so access is granted to the workload rather than to a shared credential. Decide which namespaces and service accounts map to which roles, and keep those roles narrow enough that a compromised pod cannot read secrets belonging to other applications. Confirm how the server validates service account tokens, including how it reaches the cluster's token review endpoint, before you rely on the mapping in production. Plan rotation as part of the same design: the mounted files change when the secret changes, but applications may need a restart or a reload hook to pick up new values.

What you need before connecting OpenBao or Vault to Kubernetes

Five decisions and checks come before any secret reaches a pod: the Kubernetes version, the secrets store backend, TLS trust, network paths and the OpenBao or Vault licensing choice. Each one shapes how the Secrets Store CSI Driver is configured and who can operate it later.

A supported Kubernetes version

Start from the minor versions the project still maintains, listed on the Kubernetes releases page, and plan the cluster on one of them. The Secrets Store CSI Driver and its provider must be tested against the version you run, so confirm compatibility with the driver and provider releases you intend to install before choosing a cluster version. Record the end-of-life date for the chosen minor version, because the CSI integration will need an upgrade along with the cluster.

Latest maintained minor
1.37
Kubernetes releases

A highly available secrets store backend

A single OpenBao or Vault node turns every pod start into a dependency on one process. For OpenBao, the supported HA backends are integrated storage (Raft) and PostgreSQL, and the docs describe PostgreSQL as easier to operate safely than Raft. For Vault, plan integrated storage or Consul, since external backends such as PostgreSQL have limited support. Decide this before the first deployment because changing the storage backend later is a migration project.

OpenBao HA docs

TLS certificates that pods trust

The CSI provider calls the secrets store API over HTTPS, so the CA that signed the server certificate must be available to the provider pods and the node components that talk to it. Plan the certificate chain, its renewal process and who owns the CA bundle. Certificate names must match the address the provider uses, including any internal DNS names, or every mount will fail with a trust error that looks like a network fault.

Network paths from nodes to the store

The CSI driver runs on every node, so the firewall rules must allow each worker node, not only the control plane, to reach the secrets store API port. Check egress from the node network, any load balancer in front of the store and the Kubernetes API server path used for token review. Confirm these paths in a non-production cluster with the same network policies you will enforce in production.

OpenBao or Vault licensing decision

OpenBao is an open source fork under MPL-2.0, managed by the Linux Foundation's OpenSSF, and its migration guide was tested only against Vault 1.14.1 Community Edition. Vault moved to the Business Source License 1.1 for releases from 1.15.0 onward, and HashiCorp Vault Enterprise features need a license applied to the cluster. Have legal review the license terms against your hosting model before you choose a product, because the license decides whether you can offer the store as a service to others.

Vault LICENSE file

Kubernetes auth configured in the store

Pods should authenticate with their service account tokens rather than static credentials stored in the cluster. Before rollout, decide which auth method the store will use for Kubernetes workloads, which service accounts may log in and which policies they receive. Ask the platform team to name the owner of each role, because an overly broad role lets any pod in a namespace read every secret that role grants.

Choosing between OpenBao and HashiCorp Vault as the secrets source

OpenBao is an open source, community-driven secrets manager and fork of Vault. Its repository is licensed under MPL-2.0, and the project is a Sandbox project of the Open Source Security Foundation (OpenSSF) under Linux Foundation stewardship. For teams that want an open governance model and a license that does not change under them, this is the option that fits the stated requirements. The project currently ships v2.7.x releases, so confirm which minor line your provider integration is tested against before you pin a version.

  • License: MPL-2.0, with open governance run by a community rather than a single vendor.
  • Governance: a Sandbox project under OpenSSF and Linux Foundation stewardship, which means the project's maturity level and roadmap should be reviewed against your own risk criteria.
  • Features: key/value storage encrypted before it reaches storage, dynamic secrets, leasing with automatic revocation, and the auth methods listed in its documentation, including Kubernetes auth.
  • Migration path: the OpenBao migration guide was tested only against Vault 1.14.1 Community Edition, not Vault Enterprise.

Before you commit, confirm with the OpenBao project and with the provider you intend to use that the provider release supports your OpenBao server version.

Configuring the Secrets Store CSI Driver with OpenBao or Vault step by step

This sequence connects a cluster to OpenBao or Vault so that workloads receive secrets as mounted files, with optional sync to Kubernetes Secrets, each step confirmed before the next begins.

  1. Install the CSI driver and provider

    The platform team installs the Secrets Store CSI Driver into the cluster, then installs the provider for your secrets store, which is the OpenBao or Vault provider that matches your chosen backend. Confirm the exact provider and driver versions against each project's compatibility notes for your Kubernetes minor version before installing, and record them in your change record. The step is complete when the driver DaemonSet and provider pods run on every node that will host secret-consuming workloads, and the CSI driver registration appears in the cluster. Check that the provider pods are healthy on each node, because a missing provider on one node causes mounts to fail only for pods scheduled there.

  2. Confirm the cluster API and token reviewer settings

    Before enabling Kubernetes auth in the secrets store, the platform team collects the cluster API endpoint, the cluster CA certificate and a service account that the secrets store will use to call the TokenReview API. That reviewer account needs permission to create token reviews and nothing broader. Confirm the API endpoint is reachable from the OpenBao or Vault servers, not only from workers, because the secrets store validates pod tokens by calling back into the cluster. The step is complete when a test call from the secrets store host to the API server returns an authenticated response using the reviewer token.

  3. Enable and configure Kubernetes auth

    An operator with administrative rights on the secrets store enables the Kubernetes auth method and writes the cluster API address, the CA certificate and the reviewer token into its configuration. Use a dedicated mount path per cluster if you run more than one, so that role names stay unambiguous. Record who can change this configuration, since it controls which cluster identities are trusted. The step is complete when a login attempt with a test service account token returns a client token with the expected policies attached, and a login with a token from an unrelated namespace is rejected.

  4. Create policies and roles for each workload

    The security or platform team writes one policy per workload or application team, granting read capability only on the secret paths that workload needs. Each Kubernetes auth role then binds a service account name and namespace to that policy and sets a short token lifetime. Avoid shared roles that bind many service accounts, because a single compromised pod would then read every secret in the group. Confirm the scoping by running the login as the workload's service account and reading its own path successfully, then reading a neighboring team's path and receiving a permission denied response.

  5. Define SecretProviderClass objects

    The application team creates a SecretProviderClass in the workload's namespace. It names the provider, the role from the previous step, the vault address and the secret objects to fetch, including the file name each object gets inside the pod. Keep the object list minimal, and store only the fields the application reads. The step is complete when the object applies without validation errors and the provider reports it as ready. Review the file names and paths against the application's configuration, since a mismatch is the most common cause of missing secrets at runtime.

  6. Set optional sync to Kubernetes Secrets

    If an application needs values as environment variables or depends on a Kubernetes Secret object, the team enables secretObjects in the SecretProviderClass to sync selected values into a named Kubernetes Secret. Understand the trade-off before enabling it: a synced Secret is stored in etcd, so it is only as protected as your encryption at rest and RBAC on Secrets allow, and sync keeps it alive only while a pod mounts the volume. Restrict get, list and watch on that Secret to the workload's service account. The step is complete when the synced Secret exists in the namespace with the expected keys, and a test identity without access receives a forbidden response.

  7. Deploy a test pod and verify the mount

    The team deploys a minimal test pod in a test namespace that mounts the SecretProviderClass as a CSI volume, using the same service account the production workload will use. Check that the pod reaches Running, then exec into it and confirm the mounted file exists at the expected path with the expected content. Review the pod events and the provider logs for warnings about token review, role binding or permission denied responses. The step is complete when the file reads correctly from inside the pod and the auth login recorded in the secrets store audit log matches the test service account, which is the evidence you need before rolling the pattern to production workloads.

How a pod gets its secret from the secrets store

The flow starts when kubelet sees a pod that mounts a CSI volume backed by the Secrets Store CSI Driver. The driver calls the provider, which authenticates to OpenBao or Vault using the pod's service account token through the Kubernetes auth method, then reads the secret from the store. The trust boundary sits between the cluster and the secrets store: confirm that the Kubernetes auth role is bound to a specific service account and namespace, and that the provider's own identity has only read access to the paths it needs.

Secret flow from pod mount to the secrets store, with the cluster trust boundary marked.

How Kubernetes service accounts map to secrets store policies

The secrets store does not see a pod as a pod. It sees the identity that the pod presents when it logs in, and in Kubernetes that identity is built from the service account and namespace the pod runs under. When the Secrets Store CSI Driver mounts a secret, the provider authenticates with the pod's service account token, and the secrets store checks that token against the cluster's API server using the Kubernetes auth method. The store then matches the namespace and service account name against a role you defined. Anything that is not named in that role is refused, so the mapping you write for these two values is the first access control decision in the design.

Kubernetes itself gives you several ways to authenticate identities, and the Kubernetes authentication documentation lists X.509 client certificates, bearer tokens including OpenID Connect and JWT, webhook token authentication and authenticating proxies. Pods are a different case. Their service account tokens are what the store trusts for in-cluster login, which is why the OpenBao or Vault Kubernetes auth method asks the API server to review the token rather than accepting the claim at face value. Confirm which token review method your store version expects and which API audience your provider configuration uses before you write roles, because a mismatch there fails closed and often looks like a generic permission error.

Bind each role to one named service account in one namespace, and give each workload its own service account instead of letting pods share default. A broad role that accepts any service account in a set of namespaces lets any workload added to those namespaces read the same secrets, and that exposure grows silently over time. A policy attached to the role should then list only the paths that service account needs, for example one key/value path per application, and should grant read capability without list or write unless a documented need exists. Test the result by deploying a second pod with a different service account and confirming it is refused.

Mapping secret paths, roles and Kubernetes objects

This table traces one secret from the store to the workload that reads it, naming the field or object that connects each step. Read it top to bottom when designing the integration, and use it to check that every path, role and policy has a single owner before you deploy.

Integration elementWhere it is configuredWhat it controlsWhat changes on rotation
Secrets store pathKV mount and secret path in OpenBao or VaultThe exact location the provider reads, such as a versioned KV secret under a mount nameA new version is written at the same path; pods see it only after the provider re-fetches
SecretProviderClass parameterVault provider parameters in the SecretProviderClass manifestMaps the store path and keys to files mounted into the pod, and names the Kubernetes auth roleChanging the path or key list needs a manifest update and a pod restart to apply
Kubernetes auth roleKubernetes auth method role in the secrets storeBinds one service account name and namespace to a set of policies and a token lifetimeRotating the role's bound values or policies takes effect on the next token issued
Service account and namespaceServiceAccount and Namespace objects in the clusterThe identity the store checks through the pod's token, so only the bound pair can log inA recreated service account gets a new token; the role must still name the same pair
Policy allowed pathsPolicy document attached to the auth role in the secrets storeLists which paths and capabilities the role's token may read, and blocks everything else by defaultNarrowing a policy can cut off a running workload at its next read, so test before changing it
Synced Kubernetes Secret namesecretObjects block in the SecretProviderClassCreates a Kubernetes Secret from store values, needed for environment variables or image pull useSync updates the Secret when the provider rotates, but only while a pod mounts the volume
Consuming workloadVolume and env references in the Deployment or pod specWhich pods mount the CSI volume or read the synced Secret, and under which service accountEnv variables keep old values until restart, while mounted files update on the next refresh
Rotation interval and renewalDriver rotation settings and store lease or TTL settingsHow often the driver re-reads values and how long leases last before renewalConfirm the refresh period and lease behavior in your driver and store versions before promising rotation timing

Hardening the secrets path between the store and pods

Once OpenBao or Vault holds the secrets, the risk moves to the path between the store and the pods: who can request secrets, who can define how they are mounted, and where copies end up. The cards below cover the controls that close those gaps and the checks to run against each one.

Least-privilege policies per workload

Give each workload its own OpenBao or Vault policy and its own Kubernetes auth role, bound to one service account in one namespace. Grant read on only the paths that workload needs, and avoid wildcard paths shared across applications. Review policies when a workload is retired, since orphaned roles keep working until someone removes them. Confirm the bound service account names and namespaces match what the manifests actually use.

OpenBao auth methods

Restricting SecretProviderClass creation

A SecretProviderClass tells the driver which secret paths to fetch and whether to create a Kubernetes Secret, so whoever can write one controls what a pod can read. Limit create, update and patch on these objects to the platform team through RBAC, and review them in Git before they reach the cluster. Check that application teams cannot point an existing class at a path they were never granted.

Limiting synced Kubernetes Secrets

When the driver syncs a secret into a Kubernetes Secret, the value is stored in etcd, where Secrets are unencrypted by default. Sync only where a consumer requires an environment variable or an image pull credential, and prefer file mounts otherwise. Enable encryption at rest for etcd, restrict get, list and watch on Secrets with RBAC, and confirm that the synced object is removed when the pod or class is deleted.

Kubernetes Secrets good practices

TLS on the secrets store endpoint

The provider connects from the node to OpenBao or Vault over the network, so the connection must be encrypted and the server identity verified. Use TLS with a certificate issued by your internal authority, pin that CA in the provider configuration, and restrict which networks can reach the API port. Confirm the provider rejects plaintext connections and that certificate rotation is covered by a runbook.

Audit logging on the secrets store

Enable the audit device in OpenBao or Vault so every read, token issuance and denied request produces a record. Ship those logs to a system your security team reviews, and set alerts for unexpected reads from namespaces that should not consume a path. Confirm that sensitive values are hashed in the audit log and that log storage and retention meet your own policy.

Pod Security and benchmark alignment

Enforce the Restricted Pod Security Standard on consuming namespaces where workloads allow it, so pods cannot escalate privileges that would expose mounted secrets. Use the CIS Kubernetes Benchmark as a reference checklist for API server, etcd and RBAC settings, and record which recommendations you accept or waive. Ask your auditor which benchmark version they expect before mapping controls to it.

CIS Kubernetes Benchmark

Rotating secrets and testing the integration end to end

Rotation works on two layers, and each refreshes on its own schedule. Mounted files are rewritten by the Secrets Store CSI Driver when it polls the provider and the rotation setting is enabled, so a file on disk can change while a pod keeps running. Synced Kubernetes Secrets change only when the sync is configured and either the pod is restarted or the rotation setting is enabled. Environment variables built from a synced Secret never refresh in a running container. Confirm the exact Helm value names, the poll interval and the sync behavior in the driver release you deploy, and check that each application reads files again after a change or restarts on a planned schedule.

Dynamic secrets add a second clock. Each read from a dynamic engine returns a lease with a time to live, and the credential stops working when that lease expires or is revoked. Rotation for these secrets means the driver requests a new lease, which the application must then pick up. Set the poll interval shorter than the lease time to live configured on the OpenBao role, so the workload never holds an expired credential. Revocation is the exception: a revoked lease stops working before its time to live ends, so the poll interval sets how long a workload can keep failing after a bulk revocation. The What is OpenBao overview describes leasing and revocation, and your team should confirm the exact behavior for each secrets engine it uses.

Test four cases in a non-production namespace with a disposable secret. For rotation, change the secret at the provider and expect the mounted file to change after the poll interval, the synced Secret to change only when the configured sync or restart applies, and environment variables to stay unchanged until restart. For a revoked lease, revoke it and expect the application to fail on its next use, then recover after the driver fetches a new lease. For an unavailable store, stop OpenBao and expect running pods to keep their last mounted values, while new pods that need the volume stay unstarted with mount errors in the pod events. For policy denial, remove the read capability from the Kubernetes auth role's policy and expect the same mount errors, with the driver logs naming the denied path. Record each result so the security team can review the evidence.

Common failures when mounting Vault or OpenBao secrets

This table lists the failures teams most often hit when the Secrets Store CSI Driver pulls secrets from OpenBao or Vault, with the likely cause and the first check to run. Work down the list in order, since an auth or TLS failure usually blocks everything after it. Confirm exact error text and provider configuration in your own cluster before changing anything.

FailureLikely causeFirst fix to try
Auth role deniedThe Kubernetes auth role in OpenBao or Vault does not bind the pod's service account name or namespace, or the policy lacks read access to the secret pathCompare the role's bound service account and namespace with the SecretProviderClass pod's service account, then read the policy attached to that role
Wrong service account audienceThe projected token audience sent to the auth method does not match the audience the auth backend expects, so the login is rejectedCheck the audience configured on the auth method and in the provider settings, then confirm both match before restarting the pod
TLS trust errorsThe provider's CA bundle is missing or does not match the certificate presented by the OpenBao or Vault address used by the driverSupply the correct CA certificate to the provider configuration and confirm the address matches the certificate's names
CSI volume stuck in mountThe provider pod is not running on the node, the SecretProviderClass name is wrong, or an earlier auth or TLS error is blocking the mountDescribe the pod and read the CSI driver and provider logs on that node before changing any other setting
Synced Kubernetes Secret not createdSecret syncing is not enabled in the SecretProviderClass, or the pod that triggers the mount has not started successfullyConfirm the sync block exists in the SecretProviderClass and that a pod referencing the volume has mounted it at least once
Stale values after rotationThe pod keeps the value read at mount time, or the synced Secret is not refreshed because rotation polling is off or the consumer caches itCheck the driver's rotation setting, then restart the workload if it reads environment variables from the Secret
Provider version mismatchThe OpenBao or Vault provider build does not match the installed Secrets Store CSI Driver version or the server release in useRecord the driver, provider and server versions, then align them to versions documented as compatible by each project

Questions buyers ask before connecting OpenBao or Vault to Kubernetes

Should we choose OpenBao or HashiCorp Vault for Kubernetes secrets?

Choose OpenBao if you want an MPL-2.0 licensed, community-governed secrets manager, and Vault if you already run it, need its Enterprise features, or accept its Business Source License terms. OpenBao is a fork of Vault and is managed under the Linux Foundation's OpenSSF, and its migration guide was tested only against Vault 1.14.1 community edition. Decide on license fit, the auth methods and storage backend your team will operate, and whether the provider you pick has a supported Secrets Store CSI Driver path for your workloads. Confirm each point against the current documentation before you commit.

What drives the cost of a secrets store integration with Kubernetes?

The cost splits across four parties: your cloud or data center team for the store hosting, your platform team for cluster changes, your security team for policy design, and any partner you hire for the build. Recurring costs include hosting, licenses if you use Vault Enterprise, on-call effort and policy changes. One-time costs include the initial build and the migration of existing secrets. Costs rise with the number of stores, the number of namespaces and workloads, the auth methods in use, and the number of compliance evidence requests. Ask any quote to list each of these items separately.

How long does setup take for OpenBao or Vault with the Secrets Store CSI Driver?

Duration depends mainly on how many secrets stores you connect, how many clusters and namespaces consume them, and how many workloads need rotation and auth changes. A single store with a few workloads is a much smaller job than several stores serving many teams with separate policies. The work usually runs in stages: store deployment and high availability, Kubernetes auth configuration, CSI Driver installation, workload pilots, then rotation and sync testing. Timelines are set in the written scope, so ask for a stage-by-stage plan with the assumptions behind it.

What must our team provide before a secrets store integration starts?

Your team should provide cluster admin access for installing the CSI Driver and configuring the Kubernetes auth method, administrator access to the secrets store for policy and auth setup, and a certificate authority that issues TLS certificates for the store and its clients. You also need named owners for each secret path, a list of workloads and namespaces that will read secrets, and a decision on storage backend and unseal method. Without these inputs, the design and testing stages cannot be completed in the agreed scope.

Can our internal platform team set up OpenBao or Vault with Kubernetes alone?

Yes, a platform team with Kubernetes, PKI and secrets management experience can build this without outside help. The harder parts are usually not the install but the design: least-privilege policies, Kubernetes auth role bindings per namespace, rotation behavior in running pods, audit logging, and the evidence your compliance team will ask for. Check whether your team has run a highly available store, practiced restores, and tested secret reads under failure. If those skills are thin, a fixed-scope engagement can cover the build while your team takes over operations.

What happens to our license if we need Vault Enterprise features?

Vault Enterprise features such as performance replication, HSM support, namespaces, and Sentinel policy as code need an Enterprise license applied to the cluster. HashiCorp moved future releases to the Business Source License 1.1, and the Vault LICENSE names IBM as licensor, so review those terms with your legal team before you plan a deployment. Enterprise pricing is not published, so request a quote through HashiCorp sales. If you need features that only Enterprise provides, factor the license into your cost model. OpenBao is not a drop-in replacement for those features, so confirm each one you depend on.

How does Kubernetes auth work with the secrets store for pods?

Pods present their Kubernetes service account token to the secrets store, which validates it against the cluster API and returns secrets only if a bound role allows that service account and namespace. Kubernetes itself authenticates users with certificates, bearer tokens or an authenticating proxy, and secrets stored in etcd are unencrypted by default, so encryption at rest and tight RBAC on Secret objects still matter when you sync secrets into Kubernetes. Confirm how your chosen store version binds roles, how token lifetimes are set, and how rotation reaches running pods before you rely on the design.

Should we use the Secrets Store CSI Driver or External Secrets Operator?

The Secrets Store CSI Driver mounts secrets into pods as files through a volume, which suits workloads that should not hold secrets in Kubernetes Secret objects. External Secrets Operator syncs secrets into Kubernetes Secrets, which suits applications that read environment variables or need Secret objects for tooling. Many teams use both, so decide per workload based on how the application reads secrets, how rotation must reach it, and how much etcd exposure you accept. Your platform team should document that choice so auditors can trace where each secret lives.

How DeployOpen scopes and delivers this integration

DeployOpen plans, implements, hardens and documents the connection between a self-hosted OpenBao or HashiCorp Vault server and your Kubernetes clusters, inside your own cloud accounts, data centers or air-gapped networks. The work covers the secrets store itself (storage backend, high availability, seal and unseal approach, audit devices and policies), the Kubernetes auth method and its roles, the Secrets Store CSI Driver and its provider, the SecretProviderClass objects that teams consume, and the rotation and sync behavior your applications depend on. Most engagements are fixed-scope. The provider choice, the list of clusters and namespaces in scope, the secret paths and consuming workloads, the acceptance tests and the handover documents are agreed in writing before work starts, so you can compare the quote against your own estimate line by line.

Scope is where most of the cost and risk sit, so expect the written scope to name the decisions explicitly: whether the store is OpenBao or Vault Community Edition or Enterprise, which features need a license on the cluster, who holds unseal material, and which team owns policy changes after handover. Ask for the list of deliverables to include configuration files, a runbook for token and lease behavior, a tested rotation procedure and a retest after fixes. Ongoing support, version upgrades and continuous testing are available as retainers, which suits teams that change secret paths or move to a new Kubernetes minor version on the schedule set out in the version skew policy. Where you need evidence for a compliance review, DeployOpen prepares the configuration, access settings and logs your assessors will ask for. It does not issue audit reports, attestations or certifications. Independent auditors and certification bodies do that work.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.