Kubernetes auth in OpenBao with short-lived service account tokens

OpenBao's Kubernetes auth method lets pods log in with their service account token. Short-lived tokens change which settings are safe to use, so this page covers the TokenReview flow, the configuration choices, setup checks, and what the 2.7.1 and 2.6.4 renewal fix changes.

On this page

How OpenBao Kubernetes auth works with short-lived service account tokens

A platform team usually wants its pods to read OpenBao secrets without a static credential stored in the image, a ConfigMap or a Secret. Kubernetes auth lets a pod present its projected service account token to OpenBao, which validates it with the Kubernetes TokenReview API before issuing an OpenBao token. The kubelet mounts that token into the pod as a file that expires and is refreshed, so the credential the pod holds is not a long-lived password. OpenBao has to reach the API server to run the review, which means it needs its own reviewer identity with permission to create TokenReview objects. Plan where that identity lives, how its token is rotated, and which API server address and CA OpenBao trusts, because a wrong CA is an easy mistake to make on the first attempt.

Short-lived, audience-bound tokens change what the OpenBao role must check. A projected token carries an audience and an expiry, so the role should name the audience it accepts, the service account names and the namespaces allowed to log in, instead of accepting any token the cluster issues. Confirm the token lifetime your cluster sets for projected tokens and the audience your workloads request, then size the OpenBao token TTL and maximum TTL against each workload's restart and renewal pattern. The login token is itself a lease, so a pod that stops renewing loses access when the lease expires. OpenBao 2.7.1 and 2.6.4, both released on October 1, 2026, include a fix to renewal behavior for this method, so teams on earlier patch levels should read the OpenBao releases notes and upgrade before they depend on long-running pods.

Choose Kubernetes auth when the workloads run in one cluster that OpenBao can reach and your team wants pod identity to map directly to OpenBao roles. The OpenBao auth methods documentation lists Kubernetes alongside JWT/OIDC, AppRole, TLS certificates and other methods, so the choice depends on where your workloads run. Use JWT/OIDC when one OpenBao must serve several clusters or an external token issuer, since that changes the dependency from a live TokenReview call to issuer trust. Use AppRole for servers and workloads outside the cluster, which the project recommends for servers. Before you commit, ask the platform team to confirm three things: the API server endpoint OpenBao will call, whether the reviewer identity can be scoped and rotated, and whether each team's service accounts are named and namespaced in a way the role can match.

Following a pod's token from login to OpenBao

The flow starts when a pod presents its projected service account token and a role name to OpenBao's Kubernetes auth login path. OpenBao then calls the Kubernetes API TokenReview endpoint using its own reviewer credential, which sits inside OpenBao's trust boundary. The API server confirms the subject and audience, and only after that does OpenBao issue a leased token bound to the policies attached to the role. Check that the reviewer identity is separate from the workload, that the audience matches what the role expects, and that the lease TTL fits the token lifetime the cluster issues.

Trust boundaries between the pod, OpenBao and the Kubernetes API during a login.

Why short-lived pod tokens change the Kubernetes auth setup

Short-lived pod tokens change the Kubernetes auth setup because the token a workload presents to OpenBao is a bound, expiring credential that is valid only for a limited audience and period. The Kubernetes authentication documentation covers how the cluster authenticates bearer tokens, and that model means OpenBao cannot treat the JWT as lasting proof of identity. Each login must be validated against the cluster at the moment it happens. The common mistake is treating the pod token as a durable credential, for example by mounting a copy into a long-running process or storing it so the workload can log in again later after the token has expired.

The reviewer credential that OpenBao uses to call the TokenReview API becomes the critical trust anchor. Every login decision depends on the cluster answering that call, so whoever holds the reviewer token can ask the cluster to validate tokens on OpenBao's behalf. A long-lived reviewer token stored in the auth configuration with no rotation plan is the failure to avoid. Decide which service account holds the review permission, keep that permission narrow, define how the reviewer credential is rotated and who can read the auth configuration, and confirm with the current OpenBao auth documentation which reviewer options your version supports.

Cached and renewed sessions need checking, because a login that succeeded earlier can outlive the pod that justified it. Confirm whether renewing an OpenBao token repeats any identity check, how long a deleted pod's token keeps working, and whether the lease and token lifetimes you configure line up with the lifetime of the workload. Run a test: delete a pod, wait past the expected lease window, and confirm the access ends. Check the release notes for your OpenBao version before you rely on renewal behavior, since renewal handling has changed in recent releases.

Which Kubernetes auth configuration options fit short-lived tokens

This table compares the configuration decisions in OpenBao's Kubernetes auth method when pod tokens are short-lived. Read each row as a choice between two ways of setting up the same step, and check the exact key names and defaults against the OpenBao auth methods documentation and the release notes for your version before you commit to one.

DecisionOptionTrade-offWhen to choose it
TokenReview credentialOpenBao uses a dedicated reviewer service account with TokenReview permissionRequires creating and rotating a long-lived or managed credential for OpenBao, and its RBAC must be reviewed like any other cluster accessChoose it when OpenBao runs outside the cluster or when you want reviews to run under an identity you audit separately
TokenReview credentialOpenBao uses its own pod service account to call TokenReviewFewer credentials to manage, but the permission is tied to where OpenBao is deployed and changes when the workload movesChoose it when OpenBao runs inside the cluster it authenticates against and the deployment is stable
Token validation sourceCluster CA and JWT issuer discovered from the clusterLess configuration and fewer copied secrets, but depends on the cluster's issuer and API endpoint being reachable from OpenBaoChoose it for a single cluster where OpenBao can reach the Kubernetes API directly
Token validation sourceSupplied CA certificate and reviewer token set explicitlyMore values to keep in sync when the cluster CA or endpoint changes, but the trust path is explicit and easier to reviewChoose it when OpenBao cannot use in-cluster discovery or when auditors ask for explicit trust anchors
Role binding to identityBind roles to specific service account names and namespacesNarrow bindings reduce blast radius but multiply roles as workloads growChoose it for production workloads where each application should only read its own secrets
Role binding to identityBind to a namespace with a wildcard or broad set of service accountsSimpler to maintain, but any service account created in that namespace can obtain the policyChoose it only for namespaces that are fully owned by one team and tightly controlled by admission rules
Token TTL on loginShort TTL with renewal while the workload runsLimits exposure of issued tokens, but depends on renewal working correctly in the client or agentChoose it for long-running pods, and test renewal before rollout, since the renewal fix shipped in OpenBao 2.7.1 and 2.6.4 is relevant here
Max TTL on loginExplicit max TTL that caps total token lifetimeForces periodic re-authentication, which adds load on the auth path and requires the pod's service account token to still be validChoose it when policy requires a hard ceiling on how long any login-issued token can live
Lifetime of pod service account tokenProjected token with short expiry used at loginReduces the value of a stolen token, but the pod must re-read the file and a login can fail near expiryChoose it for current cluster defaults, and confirm how your workloads refresh the projected token

Security risks in Kubernetes auth that short-lived tokens do not remove

Short-lived service account tokens shorten the window for a stolen credential, but they leave the trust configuration intact. The cards below cover the places where Kubernetes auth in OpenBao can still grant too much access, leak secrets or go unrecorded, and the control that addresses each one.

Over-privileged reviewer identity

OpenBao validates pod tokens by calling the Kubernetes TokenReview API with a service account token of its own. If that reviewer identity can read far more than TokenReview, a compromise of OpenBao exposes the wider cluster. Check that its RBAC grants only the create permission on tokenreviews, and nothing that lists or reads Secrets, pods or other namespaces. Follow the least-privilege guidance in the Kubernetes good practices page for Secrets.

Secrets good practices

Wildcard service account bindings

A role bound to a wildcard service account or namespace lets any pod matching the pattern log in and receive that role's policies. Each new namespace or service account created later then inherits access without a review. Bind roles to explicit service account names and namespaces, and review each role's bindings whenever a namespace is added. Confirm the exact binding syntax for your OpenBao version in the auth methods documentation before relying on it.

OpenBao auth methods

Pods sharing a service account

When several workloads run under the default or a shared service account, a login for one of them yields the same identity as the others. OpenBao cannot tell them apart, so a policy meant for one application reaches all of them. Give each workload its own service account, disable automatic token mounting where a pod does not need the Kubernetes API, and bind OpenBao roles to those dedicated accounts. Pod Security Standards help limit what a compromised pod can reach.

Pod Security Standards

Secrets copied into Kubernetes Secrets

Teams often copy OpenBao credentials, such as role IDs, secret IDs or the reviewer token, into Kubernetes Secrets. Kubernetes stores Secrets unencrypted in etcd by default, so anyone who can read etcd backups or the datastore gets those credentials. Enable encryption at rest for etcd, restrict list and watch access on Secrets, and keep the reviewer identity out of Secrets where the auth method does not need it. Check your cluster's encryption configuration rather than assuming it is on.

Secrets good practices

Logins not recorded in OpenBao

Short-lived tokens expire on their own, but a successful Kubernetes login still needs a record. If OpenBao audit devices are not enabled, the server cannot show which service account authenticated, from which role, and when. Kubernetes audit logs show API calls such as TokenReview but not which OpenBao role a token was issued for. Enable an OpenBao audit device, send its logs to a store you control, and correlate them with Kubernetes audit events during incident review.

Setting up Kubernetes auth in OpenBao, step by step

This sequence connects one OpenBao cluster to one Kubernetes cluster, lets named workloads log in with their own service account tokens, and sets token lifetimes that match short-lived pod credentials. Each step closes with a check you can run before moving on.

  1. Confirm OpenBao and Kubernetes versions

    The platform team records which OpenBao release runs the cluster and which Kubernetes minor version the API server reports. OpenBao v2.7.1 and v2.6.4 both include the renewal fix covered in this topic, so clusters on earlier builds of those lines should be upgraded before you depend on renewal behavior. Run bao version on a server node and kubectl version against the target cluster, then write down the pairing. The step is done when that pairing is recorded and the rest of the setup references it.

  2. Create a dedicated reviewer service account

    Create a service account in a dedicated namespace that only OpenBao uses to call the Kubernetes TokenReview API when a pod presents its token. Bind it to the system:auth-delegator ClusterRole, and confirm that binding against the current Kubernetes RBAC reference before applying it. The account should not hold cluster-admin or secret read rights. Verify with kubectl auth can-i create tokenreviews as this account, expecting yes, and kubectl auth can-i get secrets as the same account, expecting no.

  3. Enable the auth method and write cluster settings

    Enable the Kubernetes auth method at its mount path, then write the connection details: the API server address, the cluster CA certificate, and the reviewer credential. Confirm the configuration keys for your OpenBao build in the auth methods documentation before scripting them. Check whether the reviewer credential is a long-lived secret or a projected token that Kubernetes rotates, and configure it to match your policy. Verify by reading the configuration back, then logging in with a test service account token from a throwaway pod and confirming that OpenBao returns a client token.

  4. Create one role per workload

    For each workload, create a role that binds exactly one service account name and one namespace, then attach a policy that grants only the paths that workload reads. Avoid wildcard bindings across namespaces, because any service account matching a broad binding can log in. Keep policies to read paths the workload needs, and omit list or write capabilities unless the design requires them. Verify by reading each role back and comparing the bound names, namespaces and policies against the design sheet your team approved.

  5. Test allowed and denied logins

    Run three login tests from pods. A pod running the bound service account should log in and receive a token that carries only the role's policies. A pod in the same namespace running an unbound service account should be denied, and so should a pod in a different namespace that uses the bound account name. Record each denial and check that the audit log shows the attempt. The step is complete when the allowed login succeeds, both denials are logged, and the denied identities cannot read any secret path.

  6. Set token TTLs and check expiry

    Set token_ttl and token_max_ttl on each role based on how long the workload needs a token and how often it should authenticate again. Keep the maximum lifetime short enough that a leaked token has limited use, and confirm that the workload's client library logs in again before expiry. Verify by logging in, inspecting the token with token lookup, and comparing the reported TTL and expiry time with the role settings. After the TTL passes, confirm that the token is rejected. Check the renewal behavior in the release notes for your build.

What the renewal fix in OpenBao 2.7.1 and 2.6.4 changes for running clusters

Teams running OpenBao with the Kubernetes auth method should first confirm whether their workloads renew tokens through it, because the renewal fix shipped in v2.7.1 and v2.6.4, both released on October 1, 2026. The v2.7.0 release came out on September 23, 2026, and v2.6.4 covers the previous minor line. Read the OpenBao releases page and the release notes for each candidate version to see how renewal behavior changed. The notes are the authoritative description of the change, so this plan does not restate the mechanics. Your version is in scope if it is on the 2.7 line before 2.7.1 or on the 2.6 line before 2.6.4.

Start with an inventory. List every OpenBao cluster, the exact server version each one runs (taken from the image tag or the binary, not from memory), and every Kubernetes auth role in use. For each role, record whether the consuming pods only log in once or keep their token alive for longer than its initial lifetime. Pods that renew are the ones to test first. Next, schedule the upgrade into a maintenance window that covers all nodes, because the fix must reach every node of an HA cluster. Confirm the upgrade procedure and any version-specific steps in the OpenBao upgrade documentation before the window, and agree a rollback plan with the platform team.

Test renewal on a non-production role before and after the upgrade. Create a test role bound to a dedicated test service account with a short token lifetime, run a test workload that logs in and renews on that schedule, and record the renewal results and lease durations. Repeat the test after upgrading the test cluster, then restart one standby node and repeat it again. If the results differ from the release notes or from your baseline, hold the production upgrade and raise it with the vendor or the project. This check is illustrative: adapt the role names, lifetimes and test steps to your own environment and confirm the expected results in the release notes.

Choosing a configuration by cluster layout and workload pattern

When OpenBao runs inside the cluster whose workloads it serves, the Kubernetes API is a local dependency reached over the cluster network. The reviewer is usually a dedicated OpenBao service account with permission to submit TokenReview requests, so the reviewing identity lives in the same trust domain as the pods it checks. Failure handling is simple to reason about but tightly coupled.

  • Reviewer identity: create a dedicated service account for OpenBao and grant it only the review permission it needs, instead of reusing an application account.
  • Network path: OpenBao calls the API server's in-cluster address, so confirm that any NetworkPolicy allows that traffic and that DNS resolves it.
  • Failure handling: if the API server or the OpenBao pods are unavailable, new logins fail, but tokens already issued keep working until their leases end.
  • Shared fate: a cluster-wide outage also takes down secrets delivery, so plan a recovery path that does not depend on the failed cluster.

Confirm the reviewer's permissions and the login path again after a node drain and after an API server upgrade.

Limits to confirm in your environment before you rely on this setup

The Kubernetes auth method depends on the cluster's API, the OpenBao release and the way your distribution issues service account tokens. Each card below is a limit to confirm against the documentation and your own cluster configuration, not to assume from general guidance.

Kubernetes version support

Confirm that every cluster OpenBao will authenticate against runs a Kubernetes minor version listed as supported on the Kubernetes releases page. Older clusters may fall outside the support window, and a cluster that has drifted from the version you tested can change how TokenReview and projected tokens behave. Record the exact server version of each cluster, not only the version in your build pipeline.

Kubernetes releases

OpenBao release and renewal fix

Check whether your OpenBao servers run 2.7.1 or later, or 2.6.4 or later on the previous minor line, since those releases carry the renewal fix for this flow. Confirm the running version on every node, because a rolling upgrade can leave a mixed cluster. Read the release notes for any version-specific change to the Kubernetes auth method before you schedule the upgrade.

OpenBao releases

Token TTLs against restart patterns

Compare the TTL you set on the auth role with how often your workloads restart, scale or reschedule. A short TTL forces frequent re-login and adds load on the API server, while a long TTL extends the window in which a stolen token is useful. Confirm the behavior with the OpenBao documentation for role token settings and test it with a deployment that restarts during a rolling update.

Network path from OpenBao to the API server

OpenBao must reach the Kubernetes API server to submit TokenReview requests, so confirm the route, DNS name and TLS trust chain from every OpenBao pod or host. Check that network policies, egress rules and load balancers do not block the call, and that the CA certificate you configure matches the API server's serving certificate. Test with the same node pool and namespace that OpenBao runs in.

Service account issuer and token options

Verify with your distribution's documentation that the cluster exposes the service account issuer, projected token audience and expiration settings your design depends on. Managed and hardened distributions sometimes change these defaults or restrict API access for the reviewer account. Inspect the cluster's API server flags and a sample projected token before you write the role configuration, because the claims in the token define what OpenBao can match.

Kubernetes authentication

Questions teams ask before configuring Kubernetes auth in OpenBao

How much effort does Kubernetes auth in OpenBao take to set up?

Effort depends mostly on how many clusters, namespaces and workloads need OpenBao access, and on how much of the surrounding setup is already in place. One cluster with one OpenBao instance and a few service accounts is a bounded task: you enable the auth method, give OpenBao a way to call the Kubernetes TokenReview API, create roles that bind service accounts and namespaces to policies, and test each role. The drivers that add work are the number of roles, whether OpenBao runs inside or outside the cluster, how tightly TokenReview access is scoped, how closely policies follow least privilege, and how many environments must match. Each added cluster or workload class repeats the role and policy design, so ask for a written breakdown by these drivers in any quote.

Can our team configure Kubernetes auth in OpenBao without outside help?

A team with working knowledge of Kubernetes service accounts, RBAC and OpenBao policies can usually configure a single cluster on its own, provided it reads the documented configurations for short-lived tokens and tests each change. Outside help becomes more useful when several clusters share one OpenBao, when OpenBao runs in a regulated environment that needs evidence of access control, or when no one on the team owns both the Kubernetes and the OpenBao sides. The main risk in self-service work is a configuration that appears to work in a test namespace but grants broader access than intended in production. Whether you build in-house or with a partner, the deciding factors are internal skills, who signs off on policies, and how much review you need before go-live.

What does the work need from our side?

Plan to provide four things before work starts. First, cluster access with enough rights to create service accounts, read TokenReview configuration and inspect RBAC, ideally through a staging cluster first. Second, a named reviewer on your side who can approve roles, policies and token settings, because those decisions carry your security risk. Third, a test workload in a non-production namespace that uses a dedicated service account so you can confirm the login path end to end. Fourth, an upgrade window if OpenBao or the cluster must be updated to a fixed release, since restarts and version changes affect every workload that authenticates. Confirm the exact access your Kubernetes version needs against the version skew policy and the OpenBao release notes.

How long does a first working login take to confirm?

The first login can be confirmed quickly once the auth method, the reviewer credentials and one role exist, because a single test pod can request a token, log in and read a secret it is allowed to see. The longer part is proving the negative cases: a pod in another namespace, a service account without a role, and an expired token should all be refused. Timing depends on whether your Kubernetes version, the OpenBao version and the token settings are already known, on how quickly the reviewer approves changes, and on whether the test runs in a staging cluster first. No duration is set by the project, so ask any partner for a timeline tied to a written scope and a named test plan.

Do we need to upgrade to OpenBao 2.7.1 or 2.6.4 for the renewal fix?

If your deployment uses Kubernetes auth with short-lived service account tokens and runs a release before the fix, plan to move to a patched release on the line you run: 2.7.1 for the 2.7 line or 2.6.4 for the 2.6 line. Both were released on October 1, 2026, and the fix addresses token renewal in this configuration. Check the release notes on the OpenBao releases page to confirm the affected versions and any required configuration change. Upgrade cost comes from testing the patched release in staging, scheduling a restart window for each OpenBao node and confirming that workloads renew their tokens afterward. If you run a version older than the 2.6 line, the upgrade path may involve more than a patch, so confirm that with the project's upgrade guidance first.

When should we choose JWT auth or the Kubernetes secrets engine instead?

Choose the Kubernetes auth method when workloads in one cluster need to log in to OpenBao using their own service account tokens. Choose JWT auth with service account issuer discovery or chained public keys when one OpenBao must serve several Kubernetes clusters, because it validates tokens from each issuer without calling each cluster's API. Choose the Kubernetes secrets engine when the goal is to issue short-lived Kubernetes API credentials on demand for people or tools, not to authenticate pods. The trade-offs are operational: Kubernetes auth gives direct revocation through the cluster, JWT auth depends on trust in each issuer's keys, and the secrets engine adds lease cleanup duties. Decide per workload class and document the choice before rollout.

Which Kubernetes versions should we target for short-lived tokens?

Target a Kubernetes minor version that is still maintained, because the documented configurations for short-lived tokens depend on the behavior of the API server. As of September 2026, the Kubernetes project maintained 1.37, 1.36 and 1.35, with end-of-life dates of October 28, 2027, June 28, 2027 and February 28, 2027 respectively. Run the same configuration in a staging cluster at the version you plan to use in production, and check the version skew policy before upgrading the control plane, because the API server must move one minor version at a time. Plan for a Kubernetes upgrade to change how tokens are issued, and retest Kubernetes auth after each cluster upgrade.

How DeployOpen scopes and delivers OpenBao Kubernetes auth

DeployOpen plans, builds, tests and documents OpenBao's Kubernetes auth method inside your own clusters and OpenBao environment. We start from how your service accounts, token lifetimes and TokenReview permissions actually work, then deliver a configuration your platform and security teams can review and operate.

How we scope

  • We inventory clusters, namespaces, workloads and the service accounts that will authenticate to OpenBao.
  • We document which token lifetime model each cluster uses and which OpenBao version and renewal behavior applies.
  • Engagements are fixed-scope, with scope, deliverables and timelines agreed in writing before work starts.

How we build

  • We configure the Kubernetes auth mount, reviewer identity, roles, bound service accounts and token policies in your environment.
  • We test login, token renewal and expiry on pods whose projected tokens rotate, with the OpenBao version you run.
  • We review issued policies so each role grants only the paths its workload needs.

How we hand over

  • You receive the configuration, role inventory, network and RBAC requirements, and test results as written documentation.
  • We document the upgrade checks to run when moving between OpenBao patch and minor releases.
  • We walk your platform and security teams through the setup so they can review and operate it.

How we support

  • Ongoing support, upgrades and continuous testing are available as retainers for clusters that change over time.
  • Retainers can cover re-testing after Kubernetes version upgrades and after OpenBao releases that touch auth behavior.
  • Ask any quote to name the environments, versions and test cases it covers before you commit.

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.