OpenBao auto-unseal with Nitrokey NetHSM

How OpenBao's PKCS#11 seal can use a Nitrokey NetHSM to unseal the cluster automatically, what the documented basic setup covers, and what production HSM operation still requires.

On this page

When a Nitrokey NetHSM fits as the OpenBao auto-unseal source

A team that wants OpenBao to unseal without manual key shares, and already owns Nitrokey NetHSM hardware, can use OpenBao's PKCS#11 seal to hold the unseal key in the HSM. The NetHSM is reached through a PKCS#11 library, so the seal configuration points OpenBao at that library, a slot and a key label rather than at a cloud key service. This path suits teams that already operate a network HSM in their own data center, want key custody to stay on hardware they control, and would otherwise run a Shamir key ceremony every time a node restarts. It is also a reasonable fit when the security team wants the root key protected by a device with its own access controls and audit trail, separate from the OpenBao administrators.

Before you plan around this path, confirm the details that are specific to the device. The library file, slot identifier, PIN handling and key creation steps depend on the NetHSM firmware and its PKCS#11 library, and no vendor-specific facts were supplied for this page. Check Nitrokey's documentation for the supported library and how it is installed in your OpenBao image, and check the OpenBao PKCS#11 seal documentation for the exact configuration keys and the required key type. Treat the basic setup in OpenBao's documentation as the reference for the configuration itself, and treat this page as a guide to the decisions around it.

Your reasons for choosing this path should be settled before the build starts. Ask whether the NetHSM is dedicated to OpenBao or shared with other applications, who holds its administrator and user credentials, and how the device is backed up and replaced if it fails. Confirm that your OpenBao nodes can reach the HSM over the network path you intend to use, and that the HSM is placed in a location with the availability you need, because every node that restarts must reach it to unseal.

How the NetHSM sits between OpenBao nodes and the root key

The diagram starts with each OpenBao node loading the PKCS#11 library at startup and asking the HSM to perform the unseal operation. The trust boundary separates the OpenBao network from the HSM, so the HSM administration path and the operator recovery keys path both cross into a separate, tightly controlled zone. The storage backend holds only encrypted data, so an attacker who reads it still lacks the root key. Check that every node reaches the HSM over the same expected path, that recovery keys stay with operators, and that HSM administration is restricted to named people.

Nodes unseal through the PKCS#11 library, while the root key stays inside the HSM.

Which seal fits your custody model

This table compares the seal options OpenBao can use for its root key, with the Nitrokey NetHSM PKCS#11 seal as one row among them. Read each row for the custody model it fits, who operates it and the dependency it adds, so a NetHSM is chosen on purpose rather than by default.

Seal optionCustody model it fitsWho operates itMain dependency it adds
Shamir unseal keysKey holders are people who unseal manually after restarts; no hardware custodyNamed key holders and the platform teamHuman availability at every unseal event
PKCS#11 seal on a NetHSMKeys held in a dedicated network HSM under your control, with unseal automatedYour platform team, with HSM admins holding operator credentialsHSM reachability and the HSM's own backup and restore process
PKCS#11 seal on another HSMHardware custody with a vendor-specific library, certification or regional requirementsYour platform team and the HSM vendor's toolingVendor PKCS#11 library version compatibility with the OpenBao release
Cloud KMS sealKeys held by a cloud provider under your account, with IAM-based accessCloud team, with IAM policy ownersCloud provider API availability and IAM configuration
Transit sealUnseal key held in a second OpenBao cluster that you also operatePlatform team running two clustersThe source cluster must be available before the target unseals
KMIP sealKeys managed by a KMIP-compliant key manager you already runKey management team of that KMSKMS availability and externally created key material
Static sealSingle 32-byte key kept beside the configuration, suited to limited or test usePlatform teamProtection of the static key file; loss of it makes data unrecoverable

Decisions to make before the HSM is wired in

The PKCS#11 seal stores its configuration in the OpenBao server config, so the choices below are fixed before any node is initialized. Each one affects how the HSM is shared, how credentials move, and how the cluster recovers if the device fails.

Dedicated or shared NetHSM

Decide whether this NetHSM serves only OpenBao or also hosts keys for other applications. A dedicated device limits who can change its users, keys and backups, which simplifies review. A shared device means OpenBao's key and user must be scoped carefully so other tenants cannot read or delete the unseal key. Confirm with the Nitrokey documentation how partitions and users are separated on your model.

HSM user and PIN lifecycle

The PKCS#11 seal logs in with a user PIN that OpenBao reads from configuration or an environment variable. Decide who generates the PIN, where it is stored, and how it is rotated without taking the cluster offline. Plan the rotation sequence in writing, because a changed PIN that is not updated in every node's configuration will stop unsealing at the next restart.

PKCS#11 library location

The seal needs the vendor PKCS#11 library present at the path set in the lib key of the seal stanza. Decide whether to bake it into a custom OpenBao image or mount it from the host. An image keeps every node identical, while a host mount ties upgrades to the operating system. Check that the library version matches what the NetHSM vendor documents for your firmware.

Key label and slot selection

The seal references the HSM key by key_label and the token by slot or token_label. Pick names that identify the purpose, such as the cluster name and environment, and record them in your change log. Two keys with similar labels are a common source of wrong-key errors. Confirm how the NetHSM exposes slots, since its identifiers may differ from other PKCS#11 devices.

Nodes per HSM key

Every OpenBao node in the cluster must reach the same key to unseal. Decide how many nodes will share one key and one NetHSM network path, and whether a second device will be available for failover. Each node needs its own network route to the HSM, so the device's placement determines the blast radius of a network fault. Document the expected node count before the first initialization.

Recovery if the HSM is lost

Wrapped keys in the storage backend cannot be decrypted without the HSM key, so loss of the device or its key means a sealed cluster that cannot start. Decide in advance whether you hold a verified backup of the key material under the vendor's procedure, whether a replacement device is pre-provisioned, and who can authorize recovery. Test the restore on a non-production cluster before you rely on it.

How to configure the NetHSM PKCS#11 seal step by step

This sequence takes an empty OpenBao cluster from a Nitrokey NetHSM with no seal configured to a cluster that initializes against the HSM and restarts without an operator unsealing it. Each step ends with a check you can run before moving on.

  1. Confirm the NetHSM and OpenBao versions support the seal

    Before installing anything, confirm with Nitrokey and in the OpenBao PKCS#11 seal documentation that your NetHSM firmware and the OpenBao release you plan to run are a supported pairing. Check the OpenBao release notes for the version you intend to deploy, and confirm which PKCS#11 library and version the NetHSM documentation names. Ask Nitrokey which NetHSM model and firmware version they recommend for this use. The step is done when you have written down the OpenBao version, the NetHSM firmware version and the PKCS#11 library version, and each one is confirmed against a vendor or project source.

  2. Install the PKCS#11 library on every node

    On each OpenBao node, install the NetHSM PKCS#11 library from the path and package source Nitrokey documents for your operating system. Every node that will run OpenBao needs the same library version, because a mismatch between nodes can cause one node to unseal while another fails. Record the absolute path of the shared object file, since the seal stanza in the next steps depends on it. The step is done when the library file exists at that path on every node and the library version matches across the cluster.

  3. Create or import the wrapping key on the NetHSM

    Using the NetHSM administrator tooling described in the Nitrokey documentation, create a dedicated user and a key that OpenBao will use to wrap its root key. Choose a key label that describes this cluster, because you will reference it in configuration. Decide whether to generate the key on the device or import one you created under your key ceremony policy, and follow the vendor guidance for the key type and size the seal requires. Keep the administrator credentials out of the OpenBao configuration file. The step is done when the key is listed on the device under the expected label and the dedicated user can see it.

  4. Verify the key is visible through the PKCS#11 library

    Before pointing OpenBao at the device, use a PKCS#11 inspection tool to list the slots and objects the library exposes. Confirm that the slot holding the NetHSM user is visible, that the PIN unlocks it, and that the key label from the previous step appears as an object with the expected attributes. If the library lists no slots or the key is missing, fix the device user permissions or the library configuration before continuing. The step is done when the inspection output shows the wrapping key under the expected slot and label with the PIN accepted.

  5. Add the seal stanza to the OpenBao configuration

    Add a seal "pkcs11" stanza to the server configuration on each node, setting lib to the library path, slot to the slot identifier, pin to the user PIN and key_label to the wrapping key label. Use the parameter names and any NetHSM-specific values exactly as the OpenBao seal documentation and the Nitrokey documentation give them, and confirm each one with those sources. Supply the PIN through a file, environment variable or a secret delivery method you control rather than plain text in shared configuration. The step is done when the configuration validates on each node and the server starts far enough to report that it is waiting for initialization.

  6. Initialize OpenBao against the HSM

    On the first node, run the initialization command for the cluster. With an HSM seal, OpenBao stores the root key wrapped by the HSM, and it issues recovery keys rather than Shamir unseal shares. Record the recovery keys and the initial root token in your approved custody process, and note that the recovery keys are needed for certain administrative operations. Confirm the seal type reported by the status endpoint. The step is done when the status output shows the cluster initialized and sealed with the PKCS#11 seal type, and the recovery material is stored where your key custody policy requires.

  7. Join the remaining nodes and confirm they unseal

    If the cluster has more than one node, join each additional node to the cluster using the join method for your storage backend, then confirm each node reads the same seal configuration. Each node should unseal automatically once it reaches the HSM. Check the status output on every node for the sealed flag and the seal type. The step is done when every node reports unsealed and the cluster reports a healthy active node and standbys.

  8. Restart a node and confirm automatic unseal

    Restart one node, then watch its status until it returns to unsealed without any operator running an unseal command. Repeat the test on each node, and also test a full cluster restart if your change window allows it. Check the server logs for any PKCS#11 errors during startup. If a node stays sealed, check device reachability, the PIN source and the library path first. The step is done when each node restarts and reports unsealed with no manual intervention, which is the basic proof that the seal works.

Key creation differs between a lab and a production NetHSM

A lab run exists to confirm that OpenBao can reach the HSM, unseal, and recover after a restart. Treat the single test device and its key as disposable, and accept the vendor's documented defaults so the first build stays focused on the OpenBao side of the integration. Nothing built in a lab should move into production without being rebuilt under the production controls.

  • One test device: Use a single NetHSM on a network segment your team can reach, with no shared use by other systems.
  • Disposable key: Create a key for testing only, and expect to delete or abandon it. Losing it should cost a rebuild and nothing more.
  • Documented defaults: Take initial users, passphrases and key settings from the vendor's guide, and change them only where the guide asks.
  • Restart and unseal test: Restart the OpenBao node and confirm it unseals against the HSM without operator input.
  • Throwaway storage: Use OpenBao storage that can be wiped along with the key, so the lab setup does not become the pattern for production.

Before you reuse any part of this setup, check that the key, the device and the credentials meet the production requirements in the other tabs.

What production operation of the NetHSM still requires

The documented basic setup gets OpenBao unsealing against the NetHSM, but it does not make the HSM production infrastructure. The most important consequence is that OpenBao cannot unseal after a restart without the HSM, so every restart of an OpenBao node is also a dependency on the HSM being reachable, authenticated and holding the key. Treat HSM availability as a monitored service in its own right. Ask Nitrokey which health signals the NetHSM exposes, how a failed or unreachable HSM presents to a client, and what the supported monitoring approach is, then alert on that signal separately from OpenBao's own seal status. Confirm also what happens to an in-flight unseal when the HSM is briefly unavailable.

Plan redundancy for both the device and the network path between each OpenBao node and the HSM. Confirm with Nitrokey whether a supported high-availability or multi-device arrangement exists for the NetHSM, how key material is replicated or backed up between devices, and whether that replication is covered by the same key ownership and export rules as the original key. Then test the failure cases you actually expect: a single OpenBao node restart while the HSM is down, a full cluster restart, a network path failure and a credential rotation on the HSM side. Record how long each restart takes to return to unsealed, and repeat these tests after every change to the HSM, the network or OpenBao itself.

Firmware and PKCS#11 library updates need the same change control as OpenBao upgrades, because a library or firmware change can break the seal even when OpenBao is unchanged. Pin the library version in your custom image, confirm with Nitrokey which NetHSM firmware versions your library and OpenBao release support, and test the pairing in a non-production cluster before rollout. Finally, document the key lifecycle for auditors: who created the unseal key on the NetHSM, under which user and role, where the backup or replica lives, who can administer the device, how keys are rotated or retired, and how the seal migration path works if you later leave the HSM. Ask Nitrokey for its documentation on key generation, access control and audit logging so that your evidence cites the vendor's own description rather than your assumptions.

Security considerations for an HSM-backed unseal

With an HSM-backed seal, the HSM holds the key that wraps OpenBao's root key, so the security of the unseal path depends on the HSM credentials, the network route to the device, the software that talks to it and the people who administer both sides. The cards below cover the controls to decide on before the seal goes into production.

Protect the HSM PIN and user credentials

The PKCS#11 seal needs the HSM user PIN, and that PIN must reach the OpenBao process at startup. Keep it out of plain configuration files and version control, and load it from a secret store or a protected file with restricted read permissions. Ask who can read the configuration on each node, and whether the PIN appears in process listings, logs or backup snapshots. Rotate the PIN on a documented schedule and test the rotation on a non-production cluster first.

OpenBao HA docs

Restrict network access to the HSM

Only the OpenBao nodes that must unseal should be able to reach the Nitrokey NetHSM over the network. Place the appliance on a segment that is separate from user and general workload traffic, and limit access with firewall rules that name the exact source hosts and port. Confirm which TLS settings the NetHSM deployment uses for its API, and whether the HSM management interface is reachable from anywhere other than the approved administration path.

OpenBao storage docs

Keep the PKCS#11 library and image patched

Auto-unseal depends on the Nitrokey PKCS#11 library and the OpenBao build running in each node, so both are part of the attack surface. Track releases for the Nitrokey client library and the OpenBao version you run, and test each update against the seal before rolling it out. Rebuild container images when a base image or library receives a fix, and record which library and OpenBao versions each node runs so an advisory can be matched to affected hosts.

Latest supplied patch release
2.7.1
OpenBao releases

Log HSM access and key use

Record the times and identities behind every unseal, every login to the HSM and every key operation the seal performs. OpenBao's own audit devices capture requests to the server, but they do not replace logs from the HSM itself. Ask the Nitrokey deployment which administrative and cryptographic events it logs, where those logs go, how long they are kept and whether they are forwarded to your central log platform. Alert on failed PIN attempts and on key operations outside maintenance windows.

Separate HSM and seal administration

One operator should not be able to both change the HSM configuration, such as keys, users or PINs, and change the OpenBao seal stanza or the nodes that consume it. If the same person controls both, they can redirect unseal to a key they control or lock the cluster without a second check. Assign HSM administration and OpenBao configuration to different roles, require two people for key-object changes, and keep the change record for each side.

Manage recovery keys after auto-unseal

When auto-unseal is enabled, OpenBao generates recovery keys instead of unseal shares, and those recovery keys still authorize sensitive operations such as generating a new root token or certain rekey work. Decide who holds them, store each share separately under controlled custody, and confirm the threshold recorded at initialization. Do not treat the HSM as the only recovery path. Test the recovery procedure in a non-production cluster so the team knows the steps before an incident.

Questions buyers ask before configuring a NetHSM seal

What drives the cost and effort of a NetHSM auto-unseal project?

The main drivers are the number of Nitrokey NetHSM devices, the number of OpenBao nodes that must reach them, the network design between them, and how much testing and documentation the project requires. Each HSM adds provisioning, key creation, and access setup. Each node adds a PKCS#11 configuration, a restart path, and a verification step. Network design often decides the effort, because routing, firewall rules and name resolution between the nodes and the HSMs must be approved by your network team before anything is configured. Testing covers failover, node restarts and HSM unavailability, and documentation covers the runbook your operators will follow later. Ask any provider to break its quote into these components. A quote should name who does each task, what is one-time setup, and what recurs, such as HSM firmware handling, key backups, and periodic restore tests that your team carries after handover.

How long does a NetHSM seal setup and verification take?

Duration depends on the same factors as cost: how many HSMs and nodes are involved, how quickly network and security approvals arrive, and how many failure scenarios the verification must cover. A single-node lab setup with an HSM you already operate is much shorter than a production cluster with redundant HSMs, separate change windows and documented recovery steps. Most of the elapsed time usually sits in approvals and change scheduling rather than in the configuration commands themselves. Ask for a timeline tied to a written scope, with named milestones for network access, key creation, the first unseal, failover testing and handover. Do not accept a duration that is not tied to those milestones.

What does the work need from our team?

Plan for four inputs before work starts. The first is HSM access: a provisioned NetHSM with an administrator account, the network path to it, and the ability to create the key the seal will use. The second is network approvals, including firewall rules from each OpenBao node to the HSM and the correct certificate or TLS trust material where your design requires it. The third is an administrator for the HSM who can make decisions about key ownership, user roles and backup handling. The fourth is a change window on the OpenBao cluster, because the seal configuration is applied with a restart of each node. Confirm these with the vendor documentation for your NetHSM version, since the exact administration steps depend on the firmware you run.

Can our internal team configure a NetHSM seal without an outside partner?

Yes, a team with OpenBao operations experience and HSM administration skills can follow the documented basic setup on its own. The harder part is production operation: how the HSM is backed up, how key access is reviewed, what happens during an HSM outage, how a node is rebuilt, and how the team proves recovery works. If your team has not tested those scenarios before, the gap is more about time and practice than about the configuration itself. Some organizations do the configuration internally and use an outside partner for the verification, the runbook, or the first failover test. Decide which parts you want to hand over, and put that split in the written scope.

What happens to recovery keys after auto-unseal is enabled?

With auto-unseal, OpenBao no longer needs the Shamir key shares to unseal at each start, but recovery keys still exist and still matter. They are used for operations such as generating a new root token and certain administrative actions, and they are separate from the unseal material held by the HSM. Store the recovery keys under your existing custody rules, split among trusted holders, and record who holds them. Losing the HSM key or the HSM itself without a valid backup can make the cluster unable to unseal, so the HSM key backup and access records must be part of the runbook. Confirm the current recovery-key behavior in the OpenBao documentation for your version before you finalize the procedure.

Does DeployOpen handle the HSM hardware and the network for us?

DeployOpen plans, implements, hardens, documents and supports self-hosted open-source platforms inside your own infrastructure, which includes the OpenBao seal configuration, the key setup on the HSM as agreed in scope, and the verification steps. Hardware procurement, vendor support contracts with the HSM manufacturer, and your network and firewall changes remain your responsibility unless the written scope says otherwise. The scope should name each device, each node, each change window and each deliverable, so both sides know who acts at every step.

How do we get a price for this work?

DeployOpen does not publish a price list. Most engagements are fixed-scope, and the quote follows from a written scope that lists the HSM count, node count, network work, testing and documentation, and the handover. Send your current OpenBao version, your HSM model and firmware, your number of nodes and sites, and your change process, and ask for a scope with deliverables and milestones. Ask the provider to separate one-time setup from any recurring support or retainer, so you can compare the quote with an internal estimate on the same basis.

Limits to confirm in your environment

The NetHSM auto-unseal path depends on several pairings that no single page can certify for your hardware and release. Each card below names one pairing to confirm before you commit to a design, since a mismatch usually surfaces only at unseal time.

NetHSM model and firmware support

Confirm that your specific NetHSM model and firmware version are supported by the PKCS#11 seal in the OpenBao release you plan to run. Support is a pairing question, not a product question, so ask for the combination in writing. Record the model, serial, firmware build and OpenBao build in your design document, because an unsupported pairing can fail only after initialization.

HA docs

OpenBao release line

Decide which OpenBao release line you run and confirm the seal behavior for that line before you copy any configuration. Recent releases have changed how seal plugins and built-in seals are handled, so a tutorial written for one line can be wrong for another. Pin the exact version in your image and in your upgrade plan, and retest the unseal path after each change.

OpenBao releases

PKCS#11 library version

Confirm which PKCS#11 library version the NetHSM requires and whether the OpenBao seal loads it in your container image. The library must match the HSM's interface, and the library must be present in the image that runs on every node. Ask the vendor which library build is current for your firmware and where it must be installed in the runtime.

Key types and operations

Check that the key type and the cryptographic operations the NetHSM exposes match what the PKCS#11 seal calls during wrap and unwrap of the root key. A key that exists on the device but cannot be used for the required operation will block initialization or unseal. Create a test key with the exact attributes your design uses and run a full seal and unseal cycle in a non-production cluster before you rely on it.

Behavior during firmware updates

Find out how the NetHSM handles keys, users and availability during a firmware update, and whether an update requires a restart or a maintenance window. An HSM that is offline during an OpenBao restart leaves the cluster sealed. Plan the update order so that a backup unseal path or a recovery procedure exists before the device is touched, and write the rollback steps down.

Vendor support terms for production

Ask the vendor what support covers the NetHSM in a production role, including response times, hardware replacement, and whether the vendor supports the combination with OpenBao at all. Clarify who supports the OpenBao side, the HSM side and the PKCS#11 library, since a fault can sit between them. Get these terms in the contract before you go live, not after the first incident.

How DeployOpen scopes and delivers this seal

This sequence takes an agreed scope through a verified PKCS#11 auto-unseal setup, leaving your team with documented key lifecycle and recovery steps for the HSM and OpenBao cluster.

  1. Agree scope and deliverables in writing

    DeployOpen and your team define the OpenBao cluster, the Nitrokey NetHSM units, the number of nodes to unseal, the environments in scope and the deliverables before work starts. The agreement names who supplies hardware, network access, change windows and approvals. Fixed-scope engagements are quoted from this written scope, so the output is a signed scope document that both sides can check against at handover.

  2. Confirm HSM, OpenBao and network versions

    Before any configuration, DeployOpen confirms the NetHSM firmware and client library versions, the OpenBao release line, the operating system and the PKCS#11 library build against the vendor and project documentation for those exact versions. The network design is reviewed for routing, firewall rules and the path between each OpenBao node and the HSM. The output is a compatibility record and an approved network diagram.

  3. Build the node images and libraries

    Your team's platform or DeployOpen installs the PKCS#11 provider on every OpenBao node, places it at a fixed path, and confirms the OpenBao binary can load it. Images are built from pinned versions and checked into your change control. The check that closes this step is a successful library load on each node with no unsealing yet attempted.

  4. Create and register HSM keys

    An operator creates the NetHSM user, the partition or key namespace and the AES key that OpenBao will use for wrapping its root key, following the documented basic setup for the NetHSM. Credentials are split so that the OpenBao service account has only the permissions the seal needs. The output is a key inventory with key labels, IDs and permission records, stored under your key custody procedure.

  5. Configure the seal and initialize the cluster

    DeployOpen writes the PKCS#11 seal stanza in the OpenBao configuration, referencing the library path, slot, key label and PIN source from a secret store rather than a plain file. The cluster is initialized, and recovery keys are generated and recorded under your custody rules. The check is that a fresh initialization completes and the seal reports itself as configured on every node.

  6. Verify unseal, failover and restart behavior

    The team restarts each node, restarts the HSM connection, and simulates an HSM outage in a test environment to confirm how the cluster behaves and what operators must do. Standby failover and leader change are exercised on the HA cluster. Results are written to a test record listing each scenario, the observed behavior and the required operator action. Done when every scenario has a documented outcome.

  7. Document the key lifecycle and recovery

    DeployOpen writes runbooks for PIN and credential rotation, HSM key backup and replacement, OpenBao upgrades that touch the seal, library version changes and recovery from HSM loss. Each runbook names the owner and the evidence to keep. The deliverable is a document set that your operators can follow without DeployOpen present, reviewed with your security and compliance teams.

  8. Hand over and schedule retesting

    The handover walks your operators through the runbooks and a live restart drill. Ongoing support, upgrade assistance and retesting after OpenBao or NetHSM changes can be arranged as a retainer. DeployOpen configures and documents the work. Independent auditors assess your compliance posture, and this handover does not constitute a certification or a vendor partnership with Nitrokey.

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.