OpenBao AppRole authentication for servers and pipelines

AppRole is the OpenBao auth method the project recommends for servers, and it works when a workload has no platform identity to present. This page covers how to configure roles, limit secret IDs, deliver them safely and control child tokens.

On this page

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.

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.

SettingWhat it controlsWhen it fitsTrade-off to review
Secret ID TTLHow long a generated secret ID can be used to log inShort-lived CI jobs that fetch their secret ID at startExpired secret IDs stop logins, so delivery must run just before use
Secret ID num usesHow many logins a single secret ID allowsOne secret ID per host or per job, set to one useMulti-instance services need more uses or one secret ID per instance
Bind secret IDRequires the secret ID on every loginDefault for most roles, since it adds a second factor to the loginLosing the secret ID means generating a new one through a trusted path
CIDR bindingLimits which source addresses may log inFixed server fleets or runners with stable egress rangesNAT changes or autoscaling can lock out legitimate hosts; confirm ranges first
Token TTL and max TTLLifetime of the token issued at login and its renewal ceilingLong-running services that renew tokens on a scheduleLonger max TTL keeps access alive longer if a token is copied
Token policiesPermissions attached to the token and its child tokensNarrow read paths for one application or pipelineOverly broad policies are the most common cause of excess access
Response wrapping for secret IDDelivers the secret ID in a single-use wrapped tokenPipelines where a trusted orchestrator hands off the secret IDWrapping 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.

  1. 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.

  2. 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.

  3. 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.

  4. 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.

  5. 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.

  6. 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.

  7. 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.

  8. 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 docs

Deliver 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 docs

How 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

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.