When AppRole is the right OpenBao login for servers and pipelines
A server, batch job or CI pipeline needs to read secrets from OpenBao, but it has no cloud instance identity and no Kubernetes service account to present. In that situation AppRole is the login method the OpenBao documentation points to for servers, while Userpass is the method it recommends for developer machines. AppRole works with two values: a role ID, which is a stable identifier for the kind of workload (similar to a username that can be stored in configuration), and a secret ID, which is a credential that must be delivered to the workload and proves it is allowed to use that role. Neither value alone grants access, which is why the way the secret ID reaches the machine matters as much as the role definition.
This page covers the decisions and settings that make that pair safe to run: how long a secret ID stays valid and how many times it can be used, how to hand the secret ID to the workload with response wrapping so it is not exposed in transit or logs, and which token settings govern the child tokens a workload receives after login. Before any of this is built, confirm that AppRole is the right fit for each workload. If a platform identity such as Kubernetes or a cloud IAM role is available, that method may remove the secret-zero problem entirely. This page is one part of the authentication hub for OpenBao, and the work should start with a written scope that names the workloads, the environments and the owners who approve each role.
Which AppRole settings fit each workload type
Virtual machines and hosts that run a service for months are the common AppRole case, since the OpenBao documentation recommends AppRole for servers. These hosts have a stable network location and a configuration management tool that can place the first secret ID on them. The main decision is how long a secret ID stays valid and how many logins it allows, because the host authenticates again each time its secret ID is used.
- Secret ID lifetime: Set a TTL that matches how often your configuration management or deployment tool re-issues secret IDs, so an exposed ID expires on its own.
- Use limits: Cap the number of logins per secret ID to what the service needs, and treat re-issuance as a planned event.
- Child token settings: Give the service renewable child tokens so the host renews them during normal operation instead of holding one long-lived token.
- CIDR binding: Bind the role to the subnets where the hosts sit, so a secret ID presented from anywhere else fails.
- Policy scope: Grant each role only the paths its service reads and writes.
Test what happens when a host is decommissioned: confirm its tokens expire within the window you planned, and confirm each option's exact behavior in the AppRole documentation for your OpenBao version.
CI and CD jobs start, fetch secrets and stop, so their AppRole setup should assume each job is short-lived. The biggest risk is a long-lived secret ID stored in pipeline variables, where anyone with project access can read it and reuse it. The usual pattern is to issue a fresh secret ID per job and deliver it to the runner in a way that limits exposure.
- Single use or low use limits: Allow a secret ID one login, or as few as the job needs, so a copied ID stops working after the job runs.
- Response wrapping: Have the pipeline receive a wrapping token that the runner unwraps once, so the secret ID itself is not exposed in pipeline logs or intermediate systems.
- Short TTL: Match the secret ID lifetime to the expected job duration, with some margin for queueing.
- Runner network binding: Restrict the role to the address ranges of your runners where your network design allows it.
- Role ID handling: Store the role ID separately from secret IDs, since the secret ID is the credential that must stay protected.
After a failed job, check that its secret ID cannot be used again and that the audit log shows the login and the job it served. Confirm wrapping and use-limit behavior against your OpenBao version and your CI system's secret handling.
Containers can often use platform identity, such as the Kubernetes auth method, so AppRole is usually the fallback for workloads that cannot. Typical cases include clusters that cannot reach the auth path you need, or workloads running outside the cluster that still need pod-style secret delivery. Decide which identity model applies to each workload before writing any role.
- Platform identity first: Use the platform's own identity where the cluster can reach OpenBao, and reserve AppRole for workloads outside that path.
- Secret delivery: Deliver the secret ID through the orchestrator's secret store or a wrapped token, and keep it out of container images and manifests committed to source control.
- Restart behavior: Plan how a restarted pod obtains a new secret ID, since a shorter TTL forces more frequent issuance.
- Renewal: Use a sidecar or agent to renew child tokens so application code does not handle login retries.
- Namespace layout: Keep roles for each team or cluster in a separate namespace where your OpenBao design calls for tenant isolation.
Check that a rescheduled workload gets a new secret ID without manual steps. Confirm the exact Kubernetes and agent options with the OpenBao docs for your version before you design the flow.
Organizations in regulated sectors or isolated networks often cannot rely on external identity providers for servers, so AppRole becomes a central control. The questions shift from convenience to custody: who can issue secret IDs, who can change role settings, and how each login is recorded. These settings should be reviewed with the compliance and security teams before go-live.
- Issuance control: Document who may create secret IDs, how they are delivered, and which change record authorizes each role.
- Administrative access: Restrict permission to edit roles and secret ID settings to a small group, separate from the people who consume secrets.
- Audit logging: Confirm that login and token events reach your audit destination, and that reviewers can tie each login to a role and host.
- Tight TTLs and limits: Use the shortest lifetimes and lowest use counts your operations can support, and record the reason for any exception.
- Failure testing: Simulate a revoked role or expired secret ID so the team knows how the workload fails and how it recovers.
Ask your compliance team which evidence they need from AppRole, such as role configuration exports and audit samples. DeployOpen can prepare the controls and evidence, but independent auditors decide whether they meet your requirements.
In a highly available OpenBao cluster, one active node holds the lock in the data store and standby nodes forward or redirect requests. AppRole logins and renewals therefore depend on the cluster's request path and failover behavior, not only on the role settings. Clients need a stable address and a retry plan so a leadership change does not break a server that is mid-renewal.
- Client address: Point servers at a load balancer or stable name in front of the cluster rather than a single node.
- Retry behavior: Configure login retries with backoff so a failover does not cause a burst of secret ID use against a limit you set.
- Standby reads: Since OpenBao 2.5.0, Raft standbys can serve read-only operations, and 2.7.0 extended this to PostgreSQL, so confirm which operations your clients send to standbys.
- Storage backend: Match the backend choice (integrated storage or PostgreSQL) to the recovery steps your team has tested.
- Limit accounting: Test that use limits and TTLs stay correct after leader changes, so a failover does not consume logins unexpectedly.
Run a planned leader change with a test role and watch the audit log and client retries. Confirm the standby read behavior for your exact version and backend in the OpenBao high availability documentation before relying on it.
AppRole configuration options and when each fits
This table compares the main AppRole settings for a role, the secret ID and the child tokens, and what each one trades off. Read each row as a decision: the right value depends on how many hosts share a role, how the secret ID reaches the machine, and how long a job runs. The main takeaway is that tight secret ID limits and short token lifetimes reduce exposure, but they add rotation and renewal work that your pipelines must handle.
| Setting | What it controls | When it fits | Trade-off to review |
|---|---|---|---|
| Secret ID TTL | How long a generated secret ID can be used to log in | Short-lived CI jobs that fetch their secret ID at start | Expired secret IDs stop logins, so delivery must run just before use |
| Secret ID num uses | How many logins a single secret ID allows | One secret ID per host or per job, set to one use | Multi-instance services need more uses or one secret ID per instance |
| Bind secret ID | Requires the secret ID on every login | Default for most roles, since it adds a second factor to the login | Losing the secret ID means generating a new one through a trusted path |
| CIDR binding | Limits which source addresses may log in | Fixed server fleets or runners with stable egress ranges | NAT changes or autoscaling can lock out legitimate hosts; confirm ranges first |
| Token TTL and max TTL | Lifetime of the token issued at login and its renewal ceiling | Long-running services that renew tokens on a schedule | Longer max TTL keeps access alive longer if a token is copied |
| Token policies | Permissions attached to the token and its child tokens | Narrow read paths for one application or pipeline | Overly broad policies are the most common cause of excess access |
| Response wrapping for secret ID | Delivers the secret ID in a single-use wrapped token | Pipelines where a trusted orchestrator hands off the secret ID | Wrapping TTL must cover the delay between creation and unwrap |
Secret delivery and login flow between broker, server and OpenBao
The flow starts when a pipeline or broker requests a secret ID for a role and wraps it so only the target server can unwrap it. The server then sends its role ID and unwrapped secret ID to OpenBao's AppRole login and receives a token with the policies and child-token settings defined on the role. Check that the secret ID is single-use or limited in uses, that its TTL is short, and that the wrapping token expires quickly. Each hand-off is a point where a leaked value could grant access, so confirm who can read the broker's store.
AppRole login with a response-wrapped secret ID, from broker to server.
Setting up AppRole for a pipeline, step by step
This sequence takes a pipeline or server from no OpenBao access to a scoped AppRole login that issues short-lived tokens, with the secret ID delivered in a way that limits exposure.
Confirm the auth method and policy design
Before any commands run, the platform team decides which workloads need AppRole, which secrets each one reads, and which policy grants that read access. Write the policy with the narrowest paths and capabilities the job needs, and record which pipeline or server owns each role. Confirm your OpenBao version and that the AppRole method is available in your build. The step is done when every planned role has a named owner and a reviewed policy file.
Enable the AppRole auth method
An administrator enables the AppRole method at its default path or at a documented custom path, using a token with the rights to manage auth methods. Keep this administrative token out of pipeline configuration and out of shell history. The check is that the auth method appears in the list of enabled methods and that the path matches what your pipelines will use. Record the path, since every login URL depends on it.
Create the role with token and secret ID settings
Create a role for each workload and set the token policies, token TTL and maximum TTL, and the secret ID TTL and number of uses. Use short token lifetimes so a leaked token expires quickly, and set secret ID use limits that match how often the job logs in. Bind the role to the policy from the first step and nothing broader. Read back the role configuration and confirm each value matches the design, because a mistake here is hard to spot later.
Retrieve the role ID for the workload
Read the role ID for the role. The role ID is an identifier, not a secret, but it still belongs in a controlled location such as the pipeline's configuration with restricted access. Store it alongside the workload definition rather than in a shared document. The step is complete when the role ID is recorded against the owning pipeline and a read of the role ID returns the value you expect.
Generate and wrap the secret ID
Generate a secret ID for the role and request it with response wrapping, so the value comes back as a single-use wrapping token with a short wrap TTL instead of the raw secret ID. Only the workload or a delivery step that runs at the point of use should unwrap it. The check is that the wrapping token exists, has the TTL you configured, and has not yet been unwrapped. Confirm the wrap TTL with your own security team before you rely on it.
Deliver the wrapped secret ID to the workload
Pass the wrapping token to the workload through your existing secure channel, such as the CI system's protected variables or a configuration management secret store. Avoid chat, tickets and logs. The receiving job unwraps the token once, which returns the secret ID and consumes the wrap. If unwrapping fails because the token was already used or expired, treat it as a possible exposure, investigate in the audit log, and generate a new secret ID.
Log in and check child token behavior
The workload sends its role ID and secret ID to the AppRole login path and receives a client token. Verify that the token carries only the intended policies, that its TTL matches the role, and that it can read the secrets it needs and nothing else. Test that a child token created from it respects the parent's limits when your design uses child tokens. The step is done when a test read succeeds, a denied path returns an error, and the audit log records the login.
Confirm audit logging and plan rotation
Check that the audit device records AppRole logins and token use without writing raw secret IDs or tokens to logs. Set a rotation routine for secret IDs that matches the use limits and TTLs you chose, and assign an owner for revoking secret IDs when a pipeline is retired. The step is complete when a test login appears in the audit log, a secret ID revocation has been tested in a non-production role, and the rotation owner is recorded in the runbook.
Protecting the secret ID and the tokens it produces
AppRole splits a login into a role ID that identifies the workload and a secret ID that proves it. The controls below decide how long a stolen secret ID stays useful, how it reaches the server, and how far the tokens issued from it can reach. Work through them in order, because each one narrows the damage the next one has to contain.
Limit secret ID lifetime and uses
A secret ID is the credential that proves a machine is allowed to log in, so it should expire quickly and be usable a set number of times. Set a TTL and a use limit on each role, sized to how long your deployment takes to fetch the secret. Confirm in your environment whether a long-lived pipeline needs a fresh secret ID per run, because a shared, long-lived ID is the most common weakness we see in AppRole setups.
AppRole docsDeliver the secret ID with response wrapping
Response wrapping lets the process that generates a secret ID hand it over inside a single-use wrapping token, so the value never appears in pipeline logs, chat or configuration files. The consuming server unwraps it once. If unwrapping fails, someone has already touched the secret, and that failure should trigger an alert and a new secret ID rather than a retry.
Bind secret IDs to source addresses
Restrict where a secret ID can be used by binding it to the CIDR ranges of the hosts or build agents that legitimately log in. A copied secret ID then fails when presented from an unexpected network. Confirm the binding behavior of your OpenBao version before relying on it, and test it from a host outside the allowed range, because misconfigured ranges behind a NAT or load balancer will lock out real workloads.
Keep child tokens short and narrow
A successful AppRole login returns a token, and that token can be given a short TTL, a maximum TTL, and a limited policy set. Child tokens created from it inherit those limits only if you configure them that way. Decide whether an application needs periodic renewal or a fixed lifetime, and whether it may create child tokens at all, since each extra token is another credential to track in audit logs.
Set token use and renewal limits
Token settings control how many requests a token can make and how long a workload can keep renewing it. Check the token TTL, maximum TTL and any use limit against the actual run time of each job. A pipeline that renews a token for days is holding a credential that outlives its purpose, so test that renewal stops when the job ends and that revocation takes effect immediately.
Audit and revoke on suspicion
Turn on audit logging so every AppRole login, secret ID generation, unwrap and token creation is recorded against the role. Review those records for logins from unexpected places or at unusual times. When a host is retired or a secret ID leaks, revoke the secret ID accessor and the tokens derived from it, then rotate the secret ID. Confirm the exact accessor and revocation commands for your version in the official documentation.
Auth methods docsHow long AppRole takes to set up and what it needs from your team
Can our own team set up AppRole without outside help?
Yes, if you already run OpenBao or Vault and have someone who owns policies and secret delivery. AppRole itself is a small configuration: an auth method, a role with policies and token settings, and a process for issuing secret IDs. The effort usually sits in the surrounding work: mapping each server or pipeline to a role, deciding who may request secret IDs, wiring delivery into your configuration management or CI system, and proving the setup to your security reviewers. Teams without that experience often choose a partner for the design and review, then run the setup themselves.
What drives the time it takes to set up AppRole?
The number of roles and the variety of delivery paths matter most. A single application with one pipeline is a short task. A fleet of servers, several CI systems and different teams each needing their own roles takes longer because each role needs policies scoped to the secrets it reads, a secret ID lifetime and use limit, and a tested way to deliver the secret ID. Other factors include whether a current secret store already holds the credentials to migrate, how many environments you run (for example, development, staging and production), and how long your change process takes to approve auth method and policy changes. Ask any partner to base its estimate on a written list of roles and delivery paths.
What does a partner quote for AppRole cover, and what is paid for separately?
A fixed-scope quote usually covers design of roles and policies, configuration of the auth method, delivery design for secret IDs, verification in your non-production environment, and handover documentation. Costs that sit outside that quote include the infrastructure that runs OpenBao, any licensing or support contract you hold with a vendor, and internal review time from your security and platform teams. Ask for the quote to list deliverables, the environments in scope, the number of roles, and what happens if your inventory of servers or pipelines changes during the work.
What recurring work does AppRole need after go-live?
AppRole needs ongoing attention because roles, policies and secret ID handling change as systems change. Recurring work includes reviewing roles when servers or pipelines are retired, checking that secret ID TTLs and use limits still match how each workload starts, rotating or re-issuing secret IDs as your delivery process requires, and reviewing audit logs for unexpected logins. Upgrades of OpenBao also add recurring effort, so plan a regular review of the release notes for the line you run. Ask a partner whether a retainer for these tasks is part of the quote or a separate agreement.
What inputs does our team need to provide before AppRole work starts?
Your team needs to supply a current inventory of workloads that will log in, the secrets each one reads, and how each one starts (service manager, container runtime, CI job or scheduled task). You also need the OpenBao cluster details: version, storage backend, network paths from workloads to the cluster, and the namespace model if you use namespaces. Approvers should be named for policy and auth method changes, and your security team should state its expectations for secret ID lifetimes and audit retention. Missing inventory is the most common cause of delays, so confirm it early.
Does the AppRole setup need a platform identity such as Kubernetes or cloud IAM?
No. AppRole exists for applications that cannot use a platform identity, such as bare-metal servers, legacy services or pipelines running outside a cluster. If a workload can authenticate with its platform identity, that method is usually the better fit because it avoids distributing a secret ID at all. Confirm the workload inventory first, since many teams find a mix of AppRole and platform methods is the practical result. The OpenBao auth methods documentation lists the options your team should compare before committing to AppRole for every system.
What should we confirm with our security team before starting AppRole?
Confirm the maximum secret ID lifetime and use count your policy accepts, where secret IDs may be delivered and stored, how response wrapping will be handled, and which audit logs must be retained and for how long. Also confirm who may generate secret IDs, whether approvals are needed, and how a compromised secret ID is revoked. Compliance teams will ask for evidence that these settings are enforced in configuration rather than documented only in a runbook, so agree on how that evidence will be produced during testing.
How DeployOpen scopes and delivers AppRole rollouts
DeployOpen plans, implements, hardens, documents and supports self-hosted open-source platforms inside your own infrastructure. For OpenBao AppRole authentication, that means defining which servers and pipelines get roles, how their secret IDs are issued and delivered, and how child token behavior is limited before any production login is enabled.
How we scope
- Inventory every server, batch job and pipeline that needs a non-human login, and record which ones cannot use platform identity
- Agree in writing which role definitions, secret ID limits and delivery paths are in scope before work starts
- Engagements are fixed-scope, with deliverables and timelines confirmed in writing; ongoing support is available as a retainer
How we build
- Configure AppRole roles with bound policies, secret ID TTL and use limits, and token settings matched to each workload's needs
- Design the response-wrapping delivery path so secret IDs reach each host once and are never stored in pipeline logs or images
- Test each role for over-broad policies, reusable secret IDs and child token reach before it is released to production
How we hand over
- Document every role, its policy, its limits and the owner responsible for renewing or revoking its secret IDs
- Provide runbooks for issuing, wrapping, rotating and revoking secret IDs, plus the audit log events your team should monitor
- Walk your security and platform engineers through the configuration so they can review it independently and extend it later
How we support
- Retest role configuration after changes to pipelines, server fleets or OpenBao versions, and review findings with your team
- Plan upgrades on the OpenBao release line you run, confirming version-specific changes before each step
- Offer retainers for ongoing support, upgrades and continuous testing of AppRole and other auth methods

