Rotating OpenBao's encryption key and unseal keys

Barrier key rotation and unseal or recovery key rekeying answer different risks and need different ceremonies. This page explains each, how often to run them and what changes for operators.

On this page

Rotating OpenBao's encryption key and unseal keys: what each operation changes

A production OpenBao cluster has to be unsealed after every restart, and its key material has to be managed for as long as it runs. Two operations are often confused here. bao operator rotate changes the barrier encryption key, while rekeying changes the unseal or recovery key shares, and they are separate operations. Rotating the barrier key changes what encrypts data written to storage going forward. Rekeying changes how the root key is split into shares and how many shares are needed to unseal, so it changes what your operators hold and do at startup. This section and the rest of the page cover when teams need each one, how often to run them and what changes for the people who handle keys.

Rotation is usually a routine, policy-driven task, because it does not require operators to hold shares again. Rekeying is needed when key holders leave, when a share may have been exposed, or when the unseal threshold needs to change. Before choosing a cadence, confirm the exact behavior for your target release in the OpenBao documentation and the release notes for your minor line, since rotation and rekey procedures and their defaults can change between versions. Also confirm which seal you use. With a Shamir seal, the rekey ceremony involves people; with an auto-unseal seal such as a cloud KMS or HSM, the recovery key plays a different role and the operator workflow differs.

Plan the operator impact before you start. A rekey requires a quorum of current key holders to participate, so confirm that enough holders are reachable and that the new shares are distributed to their intended custodians before the old ones are retired. Test both operations on a non-production cluster that mirrors your seal configuration, and record who performed each step, when, and where the new shares are stored. That record is the evidence your auditors and security team will ask for.

Which operation fits which goal

This table compares barrier key rotation, unseal key rekey, recovery key rekey and a full seal migration by the goal that usually triggers each one. Read each row to see who must take part, what the operators do, and what changes for automation. Confirm exact CLI flags and endpoints for your running version before any change, because the procedure and default behavior can differ between minor lines.

GoalOperationWho must take partWhat changes for operators and automation
Routine refresh of the encryption key protecting data at restBarrier key rotation (bao operator rotate)One operator with sufficient policy rights; no key holders needed for the new barrier keyRuns without unsealing; existing secrets stay readable; confirm the rotation and retention behavior for your version
Replace the unseal key shares after a holder leaves or a share may be exposedUnseal key rekeyA quorum of current unseal key holders, plus the new shares distributed to new holdersOperators must collect shares again; unseal scripts and runbooks must be updated with the new key custody record
Replace recovery key shares used for root token generation and recoveryRecovery key rekeyA quorum of current recovery key holders when auto-unseal is in useRecovery shares change, so offline copies and break-glass procedures need to be replaced and retested
Change how the root key is protected, for example moving from Shamir shares to an external key storeFull seal migrationPlatform, security and key custody owners, plus the holders of the existing seal material during cutoverLargest change: unseal automation, HSM or KMS permissions and monitoring all need review; plan a rehearsal on a non-production cluster
Respond to a suspected compromise of the root key or key materialTreat as incident; combine barrier rotation with rekey and token revocationIncident response, security owners and the key holdersAutomation credentials and any scripts holding shares should be assumed exposed until replaced; confirm the sequence with your security team
Keep unseal automation working during routine workBarrier key rotation onlyOne operatorNo change to unseal inputs, so unseal pipelines and sealed-state alerts remain valid

How to run a rotation or rekey safely

This sequence moves a rotation or rekey from planning to a recorded, verified change, so the cluster stays available and every key holder knows what changed. It separates the barrier key rotation from the unseal key rekey, which need different preparation.

  1. Confirm version and cluster health

    The platform engineer checks the running OpenBao version on every node with the status and version output, and confirms the active node and all standbys report healthy and unsealed. Confirm the target version matches the release notes you are working from, because the release line you run determines which operator commands behave as documented. Do not start if any node is sealed, out of sync, or unexplained errors appear in the logs. You are done when every node reports the same version and a clean health state.

  2. Take and verify a backup

    Before any change, the operator takes a snapshot of the storage backend using the backup method for your backend (integrated storage, PostgreSQL or another documented backend), and stores it outside the cluster's failure domain. Restore the snapshot into a non-production environment or confirm the backup is readable by your restore procedure, since an unverified backup gives no recovery option. Record the snapshot identifier, timestamp and checksum in the change record. You are done when a restore test or integrity check has passed and the identifier is written down.

  3. Confirm key holders and availability

    The change owner lists every holder of an unseal key or recovery key, and confirms each holder can attend and provide their share at the scheduled time. Rekey requires the threshold number of existing key holders to authorize the operation, so count the available holders against the threshold before you proceed. If the count falls short, reschedule rather than reducing the threshold under pressure. You are done when the attendance list meets or exceeds the threshold and each holder has confirmed their share is accessible.

  4. Run the rotate or rekey command

    The operator runs bao operator rotate to create a new barrier encryption key, or starts the rekey process for unseal or recovery keys and collects shares from the required threshold of holders. Each command runs under a privileged identity that is recorded in the audit log, and the operator avoids typing shares into shared terminals or chat. Save the output of the new key material only through the procedure your organization has approved for key custody. You are done when the command returns a success response and the cluster reports the expected key state.

  5. Verify unseal and access afterward

    After the operation, the operator confirms every node reports unsealed and the active node serves requests, then checks that a test identity can read a known secret and that policies apply as before. For a rekey, verify that a fresh unseal with the new shares works on a test or standby path where your procedure allows it. Watch the logs for errors on forwarding or lock acquisition for a short period. You are done when a read and a write test succeed and no node is reporting errors.

  6. Confirm the audit device still logs

    The operator checks that at least one audit device is enabled and that new entries appear for the test operations just performed. A rotation or rekey that silently disables audit logging leaves no evidence of the change, so this check belongs before the change is closed. If an audit device is missing or failing, treat the change as incomplete and restore logging before continuing. You are done when recent entries for the test requests appear in the audit destination.

  7. Record the event and close the change

    The change owner records the date, operator, key holders present, backup identifier, command output summary, verification results and any deviations in the change record. Holders confirm in writing that they received, stored or destroyed their shares as the procedure requires, and old shares are retired according to your policy. Schedule the next review based on your own key management policy, since the researched facts do not set a required interval. You are done when the record is complete and the change owner signs off.

How rotation and rekey move through the cluster

The path starts with the trigger: routine barrier rotation, suspected exposure of key shares, or a change in who holds keys. Routine rotation re-encrypts the barrier key while the cluster stays unsealed, whereas rekeying the unseal or recovery keys is a separate ceremony that issues new shares to the key holders. Both branches end in verification and audit logging, so check that the cluster is healthy, the new material works, and the events are recorded in the audit device before you close the change.

Decision path from trigger to the rotation or rekey branch, then verification and audit.

Security controls around key ceremonies

Rekeying and key rotation change who can touch the root of trust, so the controls around them matter as much as the commands. The cards below cover who holds shares, how holders are separated, how the most powerful endpoints are gated, what gets logged and what happens to old shares.

Custody of unseal shares

Each Shamir share should sit with a named holder in a location that holder controls, such as a hardware-backed vault or sealed envelope with a documented handover. Record which share belongs to which person and where each copy lives, because a rekey that fails to collect the threshold of shares cannot be recovered by guessing. Check that no share is stored in the same password manager, repository or ticket as another.

Separation of key holders

Spread shares across people and reporting lines so no single administrator can reconstruct the root key alone. Keep the people who hold shares separate from the people who run routine operator tasks, and confirm that a holder can be replaced without exposing the others' shares. Document the quorum your organization needs to unseal during an outage, including out-of-hours availability.

Rekey endpoint and root token control

Rekey and root token operations are the most powerful paths in the server, so they must be restricted before any ceremony starts. Confirm which rekey endpoints are enabled on your version and who can reach them from the network, and review the root token generation process. The sibling topic on securing root token generation and rekey endpoints covers these settings in detail.

Audit logging of each operation

Enable an audit device before the ceremony and confirm that rekey initialization, share submission, rotation and root token events are written to it. Ship those logs to storage that the key holders cannot edit. Check that the log entries identify the operator and the time, and test that a missing audit device blocks the operation rather than letting it proceed silently.

Handling old shares after a rekey

After a rekey, the previous shares no longer unseal the cluster, so each old share should be destroyed or returned under a recorded process. Retire old shares only after the new set is verified by a test unseal in a non-production cluster or a documented restore check. Keep a dated record of when each share generation was issued and retired so that a lost or leaked share can be traced.

Ceremony runbook and rehearsal

Write a step-by-step runbook that names the operator, witnesses, the order of commands and the rollback steps. Rehearse the full ceremony in a lab cluster so the team knows how long share collection takes and where it can stall. Ask any partner to provide the runbook and the evidence from the rehearsal before the production ceremony is scheduled.

What changes for operators after each operation

Platform operators run the cluster, schedule the change and own the runbooks. A barrier rotation can usually be planned inside a normal maintenance window, but it still affects every node and the storage that holds the encrypted data, so the operator needs a clear before and after check.

  • Verify health before and after: Confirm that all nodes are unsealed and healthy before the operation, then check the key status output (for example, with bao operator key-status) and the cluster health endpoints afterward. Confirm the exact commands against the OpenBao version you run.
  • Take a storage snapshot first: Record the active key generation and the snapshot identifier so that a restore can be matched to the correct state.
  • Keep rekey in its own change record: A rekey needs unseal key holders, a quorum and a distribution plan, so it should never be folded into a routine rotation ticket.
  • Check standbys and load balancers: In high availability, confirm that standby nodes report the same state and that load balancer health checks still pass after each step.
  • Keep share entry out of automation: Unseal share entry should be done by a person holding a share, not by a pipeline with stored credentials.

Before closing the window, confirm that the change record names the operation, the start and end times, and the post-change health output.

Questions teams ask before rotating OpenBao keys

What drives the cost of rotating OpenBao keys?

Most of the cost is people's time, because OpenBao is MPL-2.0 licensed and the software itself carries no license fee. Your internal staff are paid for planning the change window, running the ceremony, testing dependent automation, updating runbooks and collecting evidence for auditors. If you engage a partner, the fee follows from the written scope. The main cost drivers are the number of clusters, the number of key holders who must attend, how many environments need the same change, how many applications or pipelines depend on the cluster staying available, and how much evidence your compliance team requires. Ask any quote to list each ceremony session, the runbook, verification steps and any retest as separate line items.

How long does a key ceremony take?

The elapsed time depends mostly on key holder availability, not on the command itself. A ceremony needs enough holders present to meet the unseal or recovery threshold, and each holder must confirm their share is handled correctly. If holders work in different time zones or must travel to a secure room, scheduling can take longer than the technical steps. Other factors include how many clusters are in scope, whether a change freeze applies, and whether you verify the cluster after each step. Plan for a fixed session with all holders booked in advance, a rollback plan, and a backup of the storage backend taken before you begin.

What does a key rotation need from our internal team?

Your team needs named owners for the cluster, a list of current key holders with confirmed contact details, and access to the systems that hold any stored recovery material. Someone must own the change window, approve the runbook, and decide what happens if a step fails. Platform engineers need admin access to the OpenBao cluster and the storage backend, and security or compliance staff should review how key shares are stored and recorded. Your team also needs to know which applications depend on the cluster so they can check them after the change. Write these responsibilities down before the first ceremony so nobody learns them during an incident.

Can our team run a key rotation without outside help?

Yes, many teams run these ceremonies themselves if they have trained operators, a tested runbook and a verified backup. The work is mainly procedural: confirm the key holders, follow the vendor steps for your version, record each action, and verify that the cluster is healthy and clients reconnect. Outside help is most useful when the environment is complex, such as multiple clusters, air-gapped networks or unusual unseal setups, or when you need an independent reviewer for evidence. DeployOpen plans, implements and documents this work inside your infrastructure under a fixed-scope agreement, and runs retests when you ask for them. Decide which steps your team owns and which need support before you start.

How often should we rotate the OpenBao encryption key?

The supplied project facts do not set a rotation interval, so set one from your own policy, your compliance obligations and your risk assessment. Many organizations rotate on a fixed schedule and also after events such as a suspected key exposure, staff departure from the key holder group, or a major upgrade. Rotating the barrier encryption key and rekeying unseal keys are separate actions with different effects on operators, so schedule each one on its own terms. Ask your auditors which evidence they expect for each rotation, and record the interval and triggers in your key management standard so the schedule is defensible.

Does rotating the barrier key change the unseal keys?

Rotating the barrier key and rekeying the unseal keys are different operations. Rotating the barrier key creates a new key used to encrypt data written to storage, and the command is bao operator rotate. Rekeying changes the unseal or recovery key shares that holders keep, so the people holding shares receive new material. Operators should expect different steps for each: rotation affects the cluster's internal encryption, while rekey requires the key holders to take part. Confirm the exact behavior, prompts and any required threshold in the OpenBao documentation for your version before you schedule either task.

Which OpenBao docs should we check for our version?

Start with the release notes for your exact version, because command behavior and defaults can change between releases. The supplied release record lists v2.7.0 on September 23, 2026, v2.7.1 on October 1, 2026, and v2.6.4 on the same day for the previous minor line. Read the notes for every release between your current version and your target version, then check the operator documentation for the rotate and rekey commands. Confirm whether your version changes how endpoints are authenticated or disabled, what key holder steps apply, and whether any storage backend requires extra steps. Keep a copy of the checked notes with your change record.

Do we need to rekey before moving from Vault to OpenBao?

Possibly. The OpenBao migration guide notes that Vault clusters bootstrapped before Vault 1.3 may need a rekey before you move to OpenBao. The same guide says OpenBao stopped using mlock in version 2.0.0, so the disable_mlock setting must be removed from configuration. The guide was tested only against Vault 1.14.1 community edition, not Vault Enterprise, so confirm your source version and edition before you plan the change. Check whether your cluster was bootstrapped before Vault 1.3, plan any rekey as its own ceremony with key holders present, and test the migration in a non-production copy first. The OpenBao migration guide is the natural next read.

Limits to confirm in your environment

Rotating the barrier key and rekeying the unseal keys are different operations with different preconditions, and both depend on the version, storage backend, unseal method and cluster history you are running. The cards below list what to verify in your own environment before scheduling either operation on a production cluster.

Version-specific rotate and rekey behavior

Confirm how bao operator rotate and bao operator rekey behave on the exact OpenBao version you run, including the release notes for any changes to the rekey flow. Current minor lines are v2.7.x and v2.6.x, and the v2.7.1 release is the latest patch in the sources we reviewed. Read the release notes for your own minor line before the change window, and test the procedure on a non-production cluster that matches your version.

OpenBao releases

Storage backend constraints

Raft (integrated storage) and PostgreSQL are the officially supported HA backends, and each has its own operational path for rotation and backup. Before you run a rotation, confirm that your snapshots or database backups are current and restorable, because a failed operation is much harder to recover from without them. Check the storage documentation for any backend-specific caveats that apply to your deployment.

Storage backend docs

HSM and auto-unseal impact

If your cluster uses an HSM, a cloud KMS or another auto-unseal method, the root key is protected by that external system, so the operator workflow for unseal and recovery keys can differ from a Shamir setup. Confirm which keys the seal wraps, who controls access to the external key, and whether recovery keys are still generated and held by people. Test the procedure against your seal configuration, since the steps for your environment may not match the defaults shown in generic guides.

Behavior during HA failover

In an HA cluster, the active node performs the operation and standby nodes must pick up the change consistently. Confirm how a leader change during or after a rotation is handled, and whether all standbys reach the new state before you resume normal traffic. Verify health on every node after the operation, and plan the sequence so that a failover does not occur in the middle of a rekey ceremony.

Migration-era rekey requirements

Vault clusters bootstrapped before Vault 1.3 may need a rekey before they move to OpenBao, according to the migration guide. If you are migrating a legacy cluster, check when it was first bootstrapped and whether this step applies before you change the server binary. Record the outcome in your change ticket so that the unseal key holders and the rekey history are clear to auditors and the next operator.

Migration guide

Custody of unseal and recovery keys

A rekey generates new unseal keys and invalidates the old set, so every current key holder must receive the new shares through a controlled process. Confirm who holds each share, where shares are stored, and that the threshold still matches the number of people you can gather during an incident. Write down the custody list and update it after each rekey so that no shares are left with departed staff.

How DeployOpen plans key rotation with your team

DeployOpen treats a barrier key rotation or an unseal or recovery rekey as a written, fixed-scope task with named steps, owners and a rollback plan agreed before anyone touches the cluster. The scope states which operation is in play, which OpenBao nodes and seal configuration are involved, which key holders take part, and what evidence the change must leave behind. Because the two operations change different things, the scope comes first: bao operator rotate changes the encryption key used for new writes to storage, while a rekey changes how the unseal or recovery key shares are issued. Writing that distinction down prevents a team from running a rekey when it needed a rotation, or the reverse.

From the scope, DeployOpen prepares a ceremony runbook for your environment. It covers the pre-change checks, such as confirming the cluster is healthy and that a current snapshot exists, the exact command sequence, the points where a key holder must be present, how the new shares are recorded and stored, and the verification steps afterward. The runbook also records how the change appears in the audit log and in your change management system, so your compliance and security teams can review the same evidence an assessor would ask for. Your team confirms the runbook against its own seal type, storage backend and key custody arrangements, and DeployOpen does not hold your unseal keys, recovery keys or root tokens at any point.

DeployOpen supports the change itself by running the ceremony with your operators, or by coaching them through it, and by checking the result before the engagement closes. Ask prospective partners to confirm in writing who handles which key material during the work, where any scripts or runbook copies are stored, and how they are removed afterward. DeployOpen prepares systems, controls and evidence for compliance assessments, but it does not issue audit reports, attestations or certifications. Independent auditors and certification bodies make those determinations, so the evidence pack is built for their review, not in place of it.

How DeployOpen delivers OpenBao key management

DeployOpen plans and runs key rotation for OpenBao inside your own infrastructure, separating the barrier encryption key from unseal and recovery keys in the written scope. Each step is agreed before work starts, documented, and handed over so your security and operations teams can run it after the engagement ends.

How we scope

  • Engagements are fixed-scope, with the rotation and rekey steps agreed in writing before work starts
  • Scope records which storage backend, seal type and key holders your cluster uses today
  • Scope names who approves rotations, who holds unseal or recovery shares, and the change window

How we build

  • We run rotation and rekey rehearsals in a non-production OpenBao cluster that mirrors your storage and seal setup
  • We verify that secrets stay readable after barrier key rotation and that existing audit devices keep logging
  • We test the unseal ceremony with the named key holders, including a documented fallback if a share is unavailable

How we hand over

  • You receive a written runbook covering each rotation and rekey procedure, prerequisites and rollback steps
  • Runbooks record the rotation cadence agreed in scope and the triggers that require an out-of-cycle rotation
  • Operators are walked through the procedure and the evidence to keep for your compliance and audit reviews

How we support

  • Ongoing support, upgrades and continuous testing are available as retainers after handover
  • Retainers can cover rotation runs, re-verification after OpenBao version upgrades, and runbook updates
  • Ask for the support scope, response arrangements and exit terms to be written into the quote

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.