OpenBao GCP service account keys and OAuth tokens

How to plan OpenBao's GCP secrets plugin so workloads get short-lived Google Cloud credentials from IAM policies, and where the GCPKMS plugin fits for Cloud KMS operations.

On this page

OpenBao GCP secrets engine: when teams replace long-lived service account keys

Many Google Cloud teams start with service account JSON keys copied into CI variables, deployment scripts and workload configuration, and then lose track of where those keys live. OpenBao's GCP secrets plugin addresses this by issuing Google Cloud service account keys and OAuth tokens on request from IAM policies, with each credential tied to a lease that OpenBao can revoke. Separately, the GCPKMS plugin covers Cloud KMS key operations, so the two are planned as distinct decisions. Teams usually need this when a key's blast radius is hard to bound: the same long-lived key grants access from several pipelines, a departing engineer once had a copy, or auditors ask who used a given service account and when.

Before building anything, confirm how the GCP secrets plugin is packaged in the OpenBao release you plan to run. Check the plugin documentation and the release notes for your chosen version, and confirm whether it ships in the core binary or must be installed and registered separately, since that changes your upgrade and pinning work. Also confirm which Google Cloud APIs and IAM permissions the plugin's own service identity needs to mint keys and tokens, because the plugin can only grant what its identity is allowed to grant. Ask your Google Cloud administrators whether organization policies restrict service account key creation, since that can block the approach entirely and should be settled early.

Plan the inventory before the cutover. List every existing key, the workload that uses it, the roles it holds and the pipelines that read it, then map each to an OpenBao roleset or equivalent definition that grants the same minimum permissions. Decide which consumers can receive short-lived OAuth tokens and which genuinely need a key file, because tokens are the simpler path for most callers. Set lease durations per consumer and confirm how renewal and revocation behave for long-running jobs. Retire the old keys only after each consumer is verified against OpenBao and the audit trail shows the expected access, so the migration does not break production pipelines.

How OpenBao, IAM and workloads connect for GCP credentials

The flow starts with a workload authenticating to OpenBao, which is the only point where the workload's identity is checked. The workload then requests a GCP credential from a named role. OpenBao, acting under its own privileged Google Cloud identity, calls IAM to create the service account key or OAuth token, and returns it to the workload together with a lease. When the lease expires or is revoked, OpenBao removes the credential again. Check that OpenBao's own identity holds only the permissions needed to manage the roles it serves, because that identity sits on the trust boundary.

Workload requests a GCP credential through OpenBao, which calls IAM under its own identity.

Which GCP credential type fits which workload

This table compares Google Cloud service account keys with OAuth access tokens issued by OpenBao's GCP secrets engine, across the roles that generate each, the workloads they suit and their lease, revocation and compatibility trade-offs. Read each row as a question to answer for your own workloads, then confirm the token lifetime limits in the plugin documentation before you set role TTLs.

FactorService account keyOAuth access token
Generated byA roleset or static account configured to create a key for an existing service accountA roleset that impersonates a service account and returns a short-lived access token
Typical fitLegacy tools that only accept a key file and cannot read a tokenCI jobs, batch processes and scripts that call Google APIs through standard client libraries
Interactive toolingPossible but harder to limit, since the key file persists on the workstationBetter fit, since the token expires and is not written to a long-lived file
Lease behaviorThe key is tied to a lease, so revocation on lease expiry deletes the key in Google CloudThe token expires on its own schedule, so the lease length sets how long a leaked token stays useful
RevocationRevoking the lease removes the key, but any copies already saved outside OpenBao keep working until removedRevocation ends the lease, but tokens already issued remain valid until their own expiry
Downstream compatibilityAccepted by most tools that read Application Default Credentials from a key fileNot accepted by every tool, so confirm each client library and CLI supports access tokens
Limits to confirmConfirm key creation quotas and the maximum keys per service account in Google Cloud documentationConfirm token lifetime limits and maximum TTL in the OpenBao GCP secrets plugin documentation
Security reviewer questionHow the key file is delivered, stored and deleted after useHow the token is cached, logged and scoped to the least-privilege service account

When the GCPKMS plugin is part of the design

The GCPKMS plugin answers a different question from the GCP secrets engine. One decides who issues Google Cloud credentials, the other decides who holds the keys that protect data and OpenBao itself. Each card below is a decision to settle on its own before the plugin enters the architecture.

Key custody boundary

Decide whether the Cloud KMS keys must stay in a project that your security team owns, separate from the project where OpenBao runs. Separate projects make it harder for one administrator to both operate OpenBao and control the key material. Confirm in the GCPKMS plugin docs which key resource names, key rings and key versions the plugin expects, and which identity it uses to call Cloud KMS.

OpenBao HA docs

Seal versus transit operations

Separate two uses of Cloud KMS: sealing OpenBao's root key at startup, and encrypting or decrypting data through the transit or GCPKMS path. A seal outage stops the whole cluster, while a failed encryption call affects only the workload that made it. Confirm in the plugin documentation which operations it supports and whether any of them run on the seal path.

Who can use each key

List the principals allowed to encrypt, decrypt and manage each key, and keep them distinct from the principals that request GCP credentials. An OpenBao token that can ask for service account keys should not automatically be able to decrypt application data. Confirm how the plugin authenticates to Google Cloud and whether it supports workload identity or requires a stored service account key.

Key rotation and version handling

Decide how often Cloud KMS keys rotate and who approves a rotation. Rotation changes which key version encrypts new data, while older versions must remain available to decrypt existing records. Confirm in the plugin docs how it selects the key version for encryption and whether it picks up rotated versions without a configuration change.

Availability and regional placement

Check where the Cloud KMS key is located relative to the OpenBao nodes, and what happens if the KMS endpoint or the region is unavailable. Placing the key far from the cluster adds latency and a dependency on another region. Confirm the supported locations, the quota limits for KMS requests in your project, and the recovery steps your team would follow during an outage.

Audit trail for key operations

Plan how Cloud KMS audit logs and OpenBao audit devices will be correlated, so an investigator can tie a decryption event to the OpenBao request that caused it. Enable Cloud KMS audit logging in the key project and confirm that the logs are retained in a location the OpenBao administrators cannot edit. Confirm in the plugin docs which request fields it passes to Cloud KMS.

Setting up the GCP secrets engine step by step

This sequence takes you from a dedicated Google Cloud identity for OpenBao through to a tested, revocable set of GCP credentials issued from role definitions. Each step ends with a check so you can confirm it before moving on.

  1. Create a dedicated Google Cloud identity for OpenBao

    A Google Cloud administrator creates a service account used only by OpenBao, then grants it the narrowest IAM roles needed to mint service account keys or OAuth tokens for the target projects. Avoid project Owner or broad Editor roles, and scope bindings to the specific projects or service accounts OpenBao will manage. Export or source its credentials only in the form the plugin accepts, and keep that material out of shell history and configuration files in version control. Confirm the exact role names and the credential input format against the current docs before you grant anything. The step is done when the service account exists, holds only the bindings you documented, and a test call with its credentials shows the permissions you expect and no others.

  2. Enable the GCP secrets engine at a path

    On your OpenBao cluster, an operator with policy rights to manage secrets engines mounts the GCP secrets engine at a path that matches your naming convention, such as one path per environment or per team. Mounting at a clear path matters because roles, policies and audit entries all refer to it. Check the mount command and any path-related flags against the current OpenBao documentation for your version. The step is done when the engine appears in the list of enabled secrets engines with the path you chose, and the change is recorded in the audit log.

  3. Configure the engine with the Google Cloud credentials

    Write the service account credentials that OpenBao will use into the engine's configuration, so the engine can call Google Cloud on behalf of issued credentials. Store this configuration in a way that restricts who can read it, because anyone who reads these credentials can mint access to the bound projects. Confirm which configuration keys the engine accepts, including any optional settings for the default lease behavior, against the current docs. The step is done when the configuration write succeeds and reading it back shows the engine is configured without returning the secret material itself.

  4. Define roles with IAM bindings

    Create one role per use case, such as a CI pipeline that needs read access to a single bucket, and attach the IAM bindings that role should receive on the named Google Cloud resource. Decide for each role whether it should issue service account keys, OAuth access tokens, or both, because the two credential types have different lifetimes and revocation behavior. Keep each role narrow so a leaked lease exposes as little as possible. Check the role definition fields and binding syntax against the current documentation before applying them. The step is done when each role reads back with the bindings and credential type you intended, and a reviewer has signed off on the scope.

  5. Test credential issuance from an authorized client

    Using a client identity that your policies permit to read the role's credentials, request a credential from the role and use it against the target Google Cloud resource. Confirm the call succeeds for the permitted action and fails for an action outside the role's bindings. Record the lease identifier and TTL returned by OpenBao so you can match it to the Google Cloud side later. Also confirm that a client without read permission on the role path is refused. The step is done when the permitted call works, the out-of-scope call is denied, and the audit log shows both attempts.

  6. Confirm revocation on lease expiry

    Let a test lease expire, or revoke it early, and then check in Google Cloud that the issued service account key or token no longer works. Revoking a lease should remove the credential at the provider, not only in OpenBao, so verify this on the Google Cloud side rather than trusting the OpenBao response. Also test a manual revoke and the bulk revocation path your team plans to use in an incident. The step is done when the credential is rejected by Google Cloud after expiry or revocation, and the lease no longer appears as active in OpenBao.

  7. Document and hand over the configuration

    Record the mount path, service account identity, configured roles, bindings, TTL settings, the policies that grant read access, and the revocation test results. Assign an owner for the service account key rotation and for reviewing role bindings on a schedule your organization sets. Confirm the procedure for upgrading OpenBao and the GCP plugin behavior with the current release notes before you rely on this configuration in production. The step is done when the runbook is stored with your other infrastructure documentation and the owners have acknowledged their responsibilities.

Security risks to design around before issuing GCP credentials

Issuing Google Cloud credentials from OpenBao moves a high-value control point into your infrastructure. The risks below connect because the same privileged service account, the same IAM bindings and the same lease records decide how far a single compromise can reach and how well you can trace it afterward.

OpenBao's service account is the top target

To mint keys or tokens, OpenBao authenticates to Google Cloud as a service account that can create credentials for other identities. Anyone who controls that account or its key can issue access to any identity it manages. Keep its key out of configuration files, restrict who can impersonate it, and monitor its use in Cloud Audit Logs. Confirm the exact IAM roles the GCP secrets plugin requires for your chosen credential types before granting them.

Auth methods docs

Issued keys can outlive intent

A dynamic credential is only safe if its lease is revoked when the workload stops needing it. If OpenBao cannot reach the cloud API during revocation, or a lease TTL is set longer than the job runs, access can persist. Test revocation end to end, set TTLs per workload, and alert on leases that fail to revoke. Ask the vendor whether service account keys are deleted on lease expiry for each credential type you plan to use.

What is OpenBao

Broad bindings multiply blast radius

A generated credential carries whatever roles its binding grants, so one overly broad role in an OpenBao roleset exposes every workload that requests it. Define rolesets per workload with the narrowest project, resource and role scope, and review them as code. Remember that a credential issued for one identity can reach every resource that identity can reach, so keep project boundaries tight.

Correlate leases with Google Cloud activity

Google Cloud logs will show the service account or generated identity performing an action, but not which application or OpenBao lease requested it. Record lease IDs, requesting entity and workload identity in OpenBao audit logs, and use distinct, traceable naming for generated accounts where the plugin allows it. Verify that a single action in Cloud Audit Logs can be matched back to one lease within your incident response timeline.

Protect root tokens and unseal material

Whoever holds a root token or enough unseal keys can read every secret and reconfigure the GCP secrets engine. Generate the root token only for a documented task and revoke it afterward, split unseal material across custodians, and store recovery keys separately from the cluster. Plan which seal mechanism protects the root key in your environment before go-live, since it determines who can unseal after a restart.

Control who can request credentials

Authentication decides which callers can read a GCP roleset path, so a weak auth method exposes cloud access even when bindings are narrow. Bind each roleset to specific AppRole, Kubernetes or JWT identities and keep the policy list short. Review policies on a schedule and remove access for retired workloads. Confirm which auth method your CI system and workloads can use to authenticate without a long-lived secret.

Questions teams ask before hiring help with GCP credentials in OpenBao

What drives the cost of a GCP credentials engagement in OpenBao?

The main drivers are how many IAM roles and service accounts need to be mapped, how complex the IAM design is, how much existing key usage has to be migrated, and how much testing the workloads need before cutover. Each role you define in OpenBao is a design decision that someone must document, test and review, so a small set of roles on one project costs less to scope than many roles across several projects and folders. Ask any partner for a quote that lists these items separately: IAM design, role mapping, migration of existing keys, test plan and handover. A written scope is what makes the price comparable between bids.

How long does a fixed-scope GCP credentials engagement take?

The length depends mostly on how ready your environment is when work starts. Teams that already have a clear inventory of workloads that use service account keys, a defined IAM model and access to the target Google Cloud projects can move faster than teams that still need to discover which keys exist. Access approvals, change windows and the number of environments to test in also affect the schedule. Because most engagements are fixed-scope, the timeline is agreed in writing before work starts, and it should name the dependencies it assumes, so you can see which delays would change it.

What access and information must we provide before work starts?

You should expect to provide access to the Google Cloud projects in scope, an administrator who can grant or review IAM roles, and a workload inventory. The inventory should list each application, job or pipeline that uses a service account key or OAuth token, the identity it runs as, the APIs it calls and who owns it. You will also need a place to run OpenBao that meets your network and hosting rules. Confirm with your own cloud team which admin rights are required and whether the work needs a separate project or a sandbox first.

Can an internal platform team set up GCP credentials in OpenBao alone?

A capable internal team can do it, provided it has someone who understands Google Cloud IAM, someone who can run OpenBao in production, and time to test before cutover. The harder parts are usually not the plugin configuration itself but deciding which roles should exist, proving that least privilege holds, and moving existing applications off long-lived keys without breaking them. If your team lacks one of those skills or has no spare capacity, a fixed-scope engagement can cover the gap, and the handover should leave your team able to operate the result.

Does the GCP secrets plugin work with keys from our existing service accounts?

Confirm this with the plugin documentation for the OpenBao release you plan to run before you design the migration. In general, the question to answer is whether OpenBao will generate new credentials from roles you define, and whether existing keys will be retired or left in place during a transition. Your inventory should record which keys can be deleted after cutover and which must stay for a period. Treat any change to an existing key as a change that needs its own test and rollback plan.

What recurring work remains after GCP credentials go live?

Recurring work includes reviewing IAM roles when projects or applications change, checking that lease lifetimes still fit each workload, watching audit logs for unexpected credential use, and keeping OpenBao itself on a supported release. Upgrades need testing against your role definitions, since a new release can change plugin behavior. Many teams run this work internally, and some buy ongoing support or continuous testing as a retainer. Ask any partner which of these tasks are included in the handover and which are priced separately.

What should we check before choosing GCP credentials over static keys?

Check whether each workload can fetch short-lived credentials at runtime, whether its code can handle token renewal and failure, and who is allowed to request credentials from OpenBao. You also need to decide how OpenBao itself authenticates to Google Cloud and how that identity is protected. Review the OpenBao security guidance for your deployment, and confirm with your security team how audit logs for credential issuance will be retained and reviewed.

Does DeployOpen prepare evidence for compliance reviews of this setup?

DeployOpen can plan and build the controls, document how credentials are issued and revoked, and prepare evidence for a compliance assessment. It does not issue audit reports, attestations or certifications, since independent auditors and certification bodies do that work. Ask your auditor which evidence they expect, such as IAM role definitions, change records and audit log samples, and make sure the engagement scope names those artifacts.

What changes for your existing service account keys after rollout

Start by inventorying every Google Cloud service account key your organization already uses, because the rollout only removes risk once the old keys are gone. Pull the list of keys per service account from the Cloud console or the IAM API, and record which workload, pipeline, script or person holds each key file. Keys that nobody can name are the first candidates for deletion after confirming they have no recent use. Check the key age and last-used data available in your Google Cloud logs, and confirm with the owning team before anything is disabled.

Next, map each consumer to the role it needs and decide whether OpenBao should issue service account keys, OAuth access tokens, or both. Each consumer should move to an OpenBao roleset or static account that carries only the IAM bindings it requires, so a CI job that deploys one service does not inherit project-wide permissions. Switch consumers in small groups, starting with low-impact workloads. For each group, confirm that the application reads credentials from OpenBao at runtime, that leases renew before expiry, and that failures surface in alerts rather than in a silent authentication error during a deployment.

After each group has run on OpenBao-issued credentials for an agreed observation period, disable the old key first and keep it disabled through a full business cycle before deleting it. Disabling is reversible in practice only if you can re-enable quickly, so record the key IDs and owners before you act. Delete keys only when logs show no authentication with them. Store the change record with the ticket, the consumer, the new role and the deletion date, since auditors ask for this evidence. OpenBao's own migration and upgrade guidance covers moving the server itself and is separate from this consumer work. Confirm the server version and any cluster changes through that guidance before you start moving consumers.

How DeployOpen works on this

DeployOpen plans, implements, hardens, documents and supports self-hosted open-source platforms inside your own cloud accounts, data centers or air-gapped networks. For GCP credential issuance, that means agreeing in writing which projects, IAM bindings and Cloud KMS keys are in scope before any OpenBao configuration changes are made.

How we scope

  • Inventory the GCP projects, service accounts and IAM roles that OpenBao will issue credentials for.
  • Decide which credential type applies to each workload: service account keys, OAuth access tokens or Cloud KMS operations.
  • Agree in writing the deliverables, the environments covered and the timeline before work starts, since engagements are fixed-scope.

How we build

  • Configure the GCP secrets plugin with roles that map to least-privilege IAM policies, reviewed against your access model.
  • Set lease durations and revocation behavior, then test issuance, renewal and expiry for each role in a non-production environment.
  • Wire the GCPKMS plugin only where Cloud KMS key operations are part of the agreed scope, and verify key permissions separately.

How we hand over

  • Deliver configuration, role definitions, IAM binding maps and runbooks that your platform and security teams can review.
  • Document audit logging settings and the evidence your compliance team needs to assess how credentials are issued and revoked.
  • Walk your operators through rotation, emergency revocation and troubleshooting before the engagement closes.

How we support

  • Offer ongoing support, OpenBao version upgrades and continuous security testing as retainers, if your team wants them.
  • Retest changed IAM policies and new roles after handover so credential scope does not drift over time.
  • Review each new OpenBao release and plugin change against your configuration before you adopt it in production.

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.