Why teams auto-unseal OpenBao with a Securosys Primus HSM
Teams choose to auto-unseal OpenBao with a Securosys Primus HSM when they need the root key protected by dedicated hardware in their own data center, rather than depending on a group of people to re-enter Shamir unseal key shares after every restart or failover. With the PKCS#11 seal, OpenBao wraps its root key using a key that never leaves the HSM. When OpenBao starts, it asks the HSM to unwrap the root key, so the cluster comes back without a human ceremony. The security question shifts from who holds which share to who can administer the HSM, who can use the key slot, and how the HSM itself is backed up and audited. A Primus fit is strongest where the organization already operates Securosys hardware, where key custody must stay on premises, or where an auditor expects a certified HSM boundary for a critical secret.
This build relies on four components that must match each other: the openbao-hsm-ubi base image, the Primus client library, the Securosys KMS plugin, and external keys support, which lets OpenBao use a key created outside its own initialization flow. Your custom image has to bundle the Primus library correctly, and the seal stanza in the OpenBao configuration must point at the right library path, slot and key label. Before you commit to this design, confirm with Securosys which Primus model, firmware and client library versions it supports with your OpenBao release, and check the current project guide for the exact image tag, plugin behavior and external key steps. Treat those details as values to verify in a lab, not as settled facts from this page.
Plan the HSM dependency before the first production start. An auto-unseal seal that cannot reach the Primus during a restart will leave the cluster sealed, so network paths, HSM availability, failover to a second HSM partition or site, and tested recovery procedures are part of the decision. Keep the Shamir recovery keys or the recovery method documented, because they are still needed for some administrative operations. Ask Securosys and your integrator for the licensing terms, support model and any recurring HSM costs, since those depend on your hardware and contract rather than on OpenBao itself.
Choosing between Shamir, the PKCS#11 seal and cloud KMS plugins
This table compares the unseal options available for OpenBao, including the Securosys Primus path, so you can see who holds the key material, what each option depends on at startup, and when each one fits. Read each row against your own custody model and availability requirements before committing to a seal type.
| Option | Custody model | Operational dependency | When it fits |
|---|---|---|---|
| Shamir key shares | Key shares split among named people; no single external key store holds the root key | Enough shareholders must be available to unseal every node after a restart or failover | Small deployments, lab or evaluation clusters, or teams that accept manual unseal and want no HSM |
| PKCS#11 seal to Primus HSM | Root key wrapped by a key held inside your Primus HSM, under your administrative control | HSM and its partitions must be reachable from every OpenBao node, and HSM credentials must be available at startup | Organizations with an existing Primus estate and policy requiring hardware-backed key custody on premises |
| Securosys KMS plugin path | Key custody remains in the Primus HSM, with the plugin handling the seal integration | Plugin version must match OpenBao release and the HSM library; confirm compatibility with your Primus firmware | Teams that want the plugin model over the built-in PKCS#11 seal; confirm the current support status with Securosys and DeployOpen before planning |
| Cloud KMS plugin | Key held by the cloud provider; custody depends on the provider's key management terms and your key policy | Nodes must reach the cloud KMS API and the identity used to call it; outages block unseal | Cloud-hosted clusters that already rely on the provider's key services and do not need on-premises hardware custody |
| KMIP or static seal | KMIP: key held by a KMIP-compatible KMS; static: key file delivered alongside configuration | KMIP: KMS reachability at startup; static: protection of the key file depends entirely on your host controls | KMIP when your KMS already speaks the protocol and key material is created outside OpenBao; static only where the risk is accepted and documented |
How the OpenBao node, custom image and Primus HSM connect at startup
The diagram starts at the OpenBao node, which runs from a custom image built on openbao-hsm-ubi that includes the Primus library and the Securosys KMS plugin. At startup the node makes PKCS#11 calls across the trust boundary into the Primus HSM network, where the wrapping key stays inside the HSM. The recovered unseal key then lets OpenBao open the encrypted data in its storage backend. Check that the HSM host is the only path crossing the boundary and that storage stays on the OpenBao side.
Startup path from the OpenBao node through PKCS#11 to the Primus HSM.
Building a custom OpenBao image on openbao-hsm-ubi with the Primus library
The image that runs OpenBao must carry the Securosys Primus client library and the Securosys KMS plugin, because the seal reaches the HSM through PKCS#11 and the OpenBao process loads the vendor library at startup. If the library is missing, sits at a different path than the seal configuration expects, or is built for a different architecture or C runtime than the base image, OpenBao will fail to unseal after a restart, which is the moment auto-unseal exists to handle. The usual starting point is the openbao-hsm-ubi base image, which is intended for HSM-backed builds. Confirm with the OpenBao documentation for the version you are deploying that this base image and its tag are the ones the project recommends, and record the exact image digest you build from so a later rebuild cannot silently change the base.
Before you write the Dockerfile, confirm three things against the Securosys and OpenBao documentation rather than from memory: the library install path inside the image, the file path that the Primus client configuration must reference, and the plugin files the seal needs to load. Client configuration files usually hold the HSM endpoint, credentials or partition details, and TLS trust material, so decide where they are mounted at runtime and who can read them. Keep credentials out of the image layers. Set the seal stanza's library path and any environment variables to the same locations you verify inside the built container, not to paths you assume from a previous build.
Tag the image with a version that identifies the OpenBao release, the Primus library version and the build date, and do not reuse a mutable tag such as latest for production. Then run the container on a non-production node and confirm that the process loads the library, that the PKCS#11 slot and key label resolve, and that a restart unseals without manual input. Store the build inputs, the library checksum and the test output with your change record. The exact build commands, file locations and supported library versions are not set out here and must be confirmed with Securosys and the OpenBao project before you rely on them.
How to set up Primus auto-unseal step by step
This sequence connects a new OpenBao cluster to a Securosys Primus partition so the root key unseals automatically at startup. It ends with a tested restart, confirming that the node unseals without operator key shares and that recovery material is stored under your control.
Prepare the Primus partition and credentials
Your HSM administrator creates a dedicated partition on the Primus for OpenBao and a client identity that can use it for wrap and unwrap operations on the unseal key. Your platform team confirms the network path from every planned OpenBao node to the Primus appliance, and records the partition name, slot details and credential storage location in your change record. Done means the administrator can list the partition with the client identity from a node that will run OpenBao, and the credential file is readable only by the OpenBao service account. Confirm the exact permission model and client software requirements with Securosys documentation before you start.
Build the custom image on openbao-hsm-ubi
Your build engineer creates a container image on the openbao-hsm-ubi base, adds the Primus client library and the Securosys KMS plugin, and places the plugin where the OpenBao binary expects to load it. The image is built in your own registry from source or packages you have verified, and the plugin and library versions are pinned in the build file. Done means the image starts, the plugin file is present at the expected path, and the library loads without errors when the container runs a version check. Confirm which OpenBao version the Securosys plugin supports before you pin the base image.
Create or import the unseal key as an external key
The HSM administrator either generates a new AES key on the Primus inside the partition or imports key material that was created outside the device, following your key custody policy. The key is marked as usable for wrapping and unwrapping by the OpenBao client identity and nothing else, and its label is recorded for the seal configuration. Done means the key appears in the partition with the expected label and attributes, and a test wrap and unwrap with the client identity succeeds on a test value. Ask Securosys which external key options the plugin supports and whether the key must be created before OpenBao initializes.
Write the seal stanza in the OpenBao configuration
Your platform engineer adds a seal block to the server configuration file, typically named
config.hcl, that points to the Securosys plugin and passes the partition, key label and credential path. Keep the PIN or credential out of the file itself, using a file reference or the secret delivery method your team has approved. Done means the configuration validates with the OpenBao binary in the custom image without parse errors, and the seal type shown in a dry run matches the Securosys plugin. Confirm the exact configuration keys and any required TLS settings in the Securosys documentation.Initialize the cluster with recovery settings
On the first node, the operator runs the initialize command with the recovery settings required by the auto-unseal seal, which generates recovery key shares instead of unseal shares. The recovery shares are split between the custodians named in your ceremony plan and each custodian stores their share under the agreed control. The root token is handled according to your hardening plan and is not written to shared notes. Done means the node reports that it is initialized and unsealed, and each custodian confirms receipt of a recovery share. Confirm the recovery share count and threshold options your OpenBao version supports before running the command.
Verify the seal status and recovery material
The operator checks the seal status output on the initialized node and confirms that the seal type is the Securosys plugin, the seal is reported as healthy, and the node is active. A custodian or second operator then confirms they can locate their recovery share in the agreed store, and the team tests a read of a non-sensitive secret to confirm the cluster serves requests. Done means the status output matches the expected seal type and the recovery custodians have verified their material. Record the status output in your change ticket for the audit trail.
Restart the node and confirm automatic unsealing
The operator stops the OpenBao process on a standby or test node, starts it again, and watches the logs until the node reports unsealed without any operator input. The team repeats the restart on each planned node and then restarts the whole cluster in a controlled order to prove that startup does not depend on a person. Done means every node returns to unsealed on its own, the Primus audit or access log shows the unwrap calls, and client requests succeed after each restart. Confirm the expected log messages and any startup retry behavior with the Securosys and OpenBao documentation before you set alerts.
Using external keys with the Primus HSM
When the key is generated inside the Primus HSM, the private key material never leaves the device in plaintext. OpenBao only sees a PKCS#11 object handle and asks the HSM to perform wrap and unwrap operations on the root key. Custody sits with the HSM administrators and the HSM's own backup and domain controls, which is usually the simplest story for a security team to explain.
- Custody: The HSM holds the key. Confirm with Securosys how key objects are marked non-extractable and which role can create, export or delete them.
- Rotation: Rotation is an HSM-side operation followed by an OpenBao reseal and unseal cycle. Plan the change window and confirm how the old key is retired.
- Recovery: Recovery depends on HSM backup material and the authentication credentials for the partition. Losing both can make the root key unrecoverable.
- Testing: Restore the HSM backup into a separate environment and confirm OpenBao unseals from it before relying on it.
- Access: Limit which service accounts can use the key and keep HSM logs flowing to your audit pipeline.
Before go-live, ask Securosys to confirm the exact key attributes, backup procedure and partition authentication model for your Primus firmware version.
When the key is created outside the HSM and imported before OpenBao is initialized, the key material exists briefly in a system you control, such as a key generation host or a ceremony workstation. That exposure is the central custody question. Teams usually choose this path when they need a key they can generate, escrow or audit independently of the HSM vendor, or when a standard process requires it.
- Custody: The generating environment, the transport path and the import session all become part of the custody chain. Document each step and who witnessed it.
- Rotation: A new key means a new import and a controlled migration, not a simple in-place replacement. Treat it as a planned key change.
- Recovery: Keep an independent, protected copy of the source material according to your key management policy, stored separately from the HSM backups.
- Sequencing: The key must exist in the HSM before OpenBao initialization, so the import is part of the ceremony plan.
- Verification: Confirm OpenBao unseals using the imported key in a test cluster before production use.
Confirm with Securosys whether the Primus supports importing externally generated keys for this use, which wrapping keys and mechanisms it requires and whether the import is logged.
Support for external keys depends on the Primus model, firmware, the PKCS#11 library version and the OpenBao plugin build, so the vendor must confirm each combination rather than assume it. The questions below should be answered in writing before the ceremony is scheduled, and the answers should be kept with the change record.
- Key import: Whether the Primus accepts imported key objects, which wrapping key and mechanism to use and what attributes the imported key must carry.
- Extractability: Whether imported or generated keys are non-extractable and whether that setting can be changed later.
- Backup and restore: How HSM backups include or exclude these keys and how a restore is tested.
- Library compatibility: Which Primus PKCS#11 library version is supported with the OpenBao KMS plugin you build.
- Logging: Which import, use and deletion events the HSM records and how they reach your audit system.
Ask for the answers in a written statement tied to your firmware and library versions.
Security risks in HSM-backed unseal operations
With a Securosys Primus HSM, OpenBao's root key protection depends on a chain of components: the HSM partition, the network path, the custom image and the admin accounts that manage the HSM. A weakness in any one link can expose the unseal material or stop nodes from unsealing after a restart. The cards below list the checks to make for each link before the seal goes into production.
HSM partition credentials
The PKCS#11 seal logs in to a Primus partition with credentials that OpenBao must read at startup. Decide where those credentials live, who can read them and how they rotate, because anyone holding them can use the partition's keys through the library. Confirm that the partition user has only the object permissions the seal needs, and that the credentials are not baked into the image or the configuration file in plain text. Ask Securosys for the partition policy model before you grant access.
Network path and TLS to the HSM
Each OpenBao node talks to the Primus appliance over the network during unseal and, depending on the setup, during key operations. Place the HSM on a segment reachable only from OpenBao nodes, and confirm that the connection uses the transport protection your Primus deployment supports. Check which hosts can reach the HSM port, and test what happens when the path fails, because a node that cannot reach the HSM cannot unseal.
Image provenance and base layer patching
The custom image combines the openbao-hsm-ubi base, the Primus client library and the Securosys KMS plugin. Record which base image digest and library version went into each build, and rebuild when the base layer or the OpenBao release changes. Verify that the plugin you package matches the OpenBao version you run, since a mismatch can break unseal at the next restart. Treat the library itself as a component to track for advisories.
OpenBao overviewAdmin access to the HSM
Administrators who manage Primus partitions, key objects and the appliance hold the power to disable or copy keys, which is a larger risk than any single OpenBao operator. Separate the HSM administrator role from the OpenBao platform role, require named accounts with individual authentication, and document who may change partition configuration. Confirm how the appliance handles quorum or multi-person approval for sensitive changes before you rely on it.
Audit logging of seal operations
Unseal and key operations happen at the HSM and at the OpenBao node, and each side keeps different records. Enable the Primus audit facilities that your appliance supports, forward them to a central log system, and correlate them with OpenBao's own audit log by time and node. Confirm that the records show which node unsealed, when, and which key object was used, so that an unexpected unseal can be traced to a host and an operator.
Key loss and backup of key material
A key object that exists only on one Primus appliance is a single point of failure for every OpenBao node that depends on it. Confirm with Securosys how keys are backed up, replicated and restored, and test a restore into a separate environment before production. Document the recovery procedure, including who can authorize it, and keep the recovery steps out of any system that depends on the same HSM.
Questions teams ask before auto-unsealing with Primus
How much does OpenBao auto-unseal with a Primus HSM cost?
The cost is set by the written scope, and no price is published here. Costs fall into three groups: the Primus hardware, licenses and support you buy from Securosys, the engineering time to build the custom image and configure the seal, and any testing or hardening you add. Build and integration work is one-time, while HSM support contracts, image rebuilds for each OpenBao release and any retainer for upgrades recur. Costs rise with the number of clusters, the number of HSM partitions or environments, and the number of failure and recovery tests you require. Ask for a quote that lists each item separately, states what you provide and names what is excluded.
How long does a Primus auto-unseal project take?
No duration is fixed until the scope is written, and the main driver is how ready your environment is. Work moves faster when the Primus appliance is already installed, the network path from OpenBao nodes to the HSM is open and a test cluster exists. Slower projects involve new change approvals, unclear key ownership, multi-region clusters or a container build pipeline that does not exist yet. Ask for a plan with phases: environment check, custom image build, seal configuration on a test cluster, failure tests, and then a change window for production nodes. Confirm change window dates and vendor delivery times early, because they often set the pace more than the configuration itself.
What does our team need to provide for the HSM integration?
Plan to supply HSM access, network connectivity and named staff before work starts. On the HSM side, you need a Primus environment you control, a partition or slot dedicated to OpenBao, and credentials limited to what the seal needs, along with Securosys documentation and library access. On the network side, you need a tested path from every OpenBao node to the HSM over PKCS#11, with approved firewall rules. On the platform side, you need a container registry, a build host and a test OpenBao cluster. On the people side, you need an HSM administrator, a platform engineer and a security approver who can accept the key custody model. Confirm each item in the written scope so that delays are visible early.
Can an internal team set up Primus auto-unseal alone?
Yes, if the team already has the skills and time, but the work spans three disciplines: HSM administration, container image engineering and OpenBao operations. A team that has run a Shamir-sealed OpenBao cluster, built container images and handled PKCS#11 credentials can usually complete the build with the vendor documentation. Gaps tend to appear in failure testing: what happens when the HSM is unreachable during a node restart, how recovery keys are used and how a seal change is rolled back. Ask who will own the runbook after go-live. An outside partner can take the build and testing as fixed scope or review your internal design, while your team keeps daily operation.
What usually goes wrong with an HSM-backed unseal?
Failures tend to come from a few predictable places, so test each one before go-live:
- Library or image mismatch: the Primus library, the Securosys KMS plugin and the OpenBao release must work together, so a rebuild can break the seal.
- Unreachable HSM at restart: a node that cannot reach the HSM stays sealed, which matters most during network outages or maintenance.
- Wrong slot, label or permissions: a configuration that works with test credentials may fail with production credentials.
- Untested recovery: teams often never practice recovery key use or a rollback to the previous seal.
Record the result of each failure test in the runbook.
What should a quote for this work include?
A quote should follow from a written scope and list each deliverable, environment and assumption. Ask it to cover the environments included, named as they appear in your inventory; the custom image build on openbao-hsm-ubi with the Primus library and the Securosys KMS plugin, including external keys support configuration; the seal configuration and key creation steps; failure and recovery tests; documentation and a handover session; the client responsibilities described above; and exclusions such as HSM hardware, Securosys licenses or a move to a different seal. Also ask for the terms of any retainer covering upgrades and retests, and how changes to scope are priced.
How does auto-unseal work after upgrades and HSM rotation?
The seal configuration has to be checked on every OpenBao upgrade and every HSM change, because either can break unseal at the next restart. Each OpenBao release has its own release notes, so an upgrade may require rebuilding the custom image and retesting the seal on a test cluster before production. Check the OpenBao releases page for changes before planning each cycle. HSM changes, such as replacing a Primus unit, updating firmware or rotating key material, need a planned transition and a restart test. Document the rebuild steps so they run the same way each time. A retainer can cover these cycles, while a one-off project covers only the first build.
Is DeployOpen a Securosys partner for Primus work?
No. DeployOpen is not an official partner, reseller or certified provider of Securosys, and this page does not imply partner status. DeployOpen plans, builds, tests and documents self-hosted OpenBao deployments in your infrastructure, including the custom image and seal configuration. Hardware purchase, Securosys licensing, library access and vendor support for the Primus appliance come through Securosys or your existing agreement. Confirm with Securosys which Primus model, firmware and library versions it supports with your chosen OpenBao release before scoping. The written scope will name who handles each vendor relationship.
Operating and upgrading an HSM-unsealed OpenBao cluster
Once the Securosys Primus seal is live, the recurring cost of this design is operational, not one-time. Every OpenBao release means rebuilding the custom image on openbao-hsm-ubi with the Primus library, the Securosys KMS plugin and external keys support, then proving that the rebuilt image still unseals against the HSM before any production node is touched. Treat the 2.7.x line as a moving target: the project published v2.7.0 on September 23, 2026, followed by v2.7.1 on October 1, 2026, so plan for patch-level rebuilds in addition to minor upgrades. Confirm with Securosys which Primus library and plugin versions are compatible with each OpenBao release before you pin them, because the image is only as current as its PKCS#11 and plugin components.
Test unseal as a separate step after every upgrade and every credential change. Run the upgrade on a non-production cluster first, restart one standby, confirm it auto-unseals from the Primus partition, and only then roll the remaining nodes. Rotating HSM credentials, such as the partition PIN or the client identity used by the plugin, should follow the same pattern: change the value in a staging copy, verify unseal, then schedule the production change. Monitor seal health through OpenBao's telemetry and alert on seal-related errors in node logs, so a failed HSM session is found during business hours rather than during the next restart.
Plan recovery drills before you need them. Ask Securosys and your HSM administrators to document how the partition is restored, who can authenticate to it, and how long a restore is expected to take in your environment. Rehearse a full cluster restart with the HSM unreachable to confirm that the sealed state, recovery procedure and escalation path behave as your runbook says. If clusters that predate Vault 1.3 are moving onto this seal, the migration guide's notes apply first: a rekey may be needed before the move, and disable_mlock must be removed from configuration because OpenBao stopped using mlock in 2.0.0.
How DeployOpen scopes and delivers HSM auto-unseal for OpenBao
DeployOpen plans, implements, hardens, documents and supports self-hosted open-source platforms inside your own infrastructure, so OpenBao auto-unseal with a Securosys Primus HSM is scoped against your HSM partitions, network paths and operating model before any build starts. The work is delivered as a fixed-scope engagement with written deliverables, and the handover leaves your team able to run the unseal path.
How we scope
- Written scope confirms which Primus partition, key and network path OpenBao will use for unseal and who approves each change.
- We record the OpenBao version, the image base and the Primus client library version you intend to run before work starts.
- The scope names the recovery plan for HSM outage, including who holds recovery keys and how a sealed node is restored.
How we build
- We build a custom OpenBao image on the openbao-hsm-ubi base with the Primus library and the Securosys KMS plugin in your build pipeline.
- Configuration covers the PKCS#11 seal stanza, external keys support, and the settings that match your HSM partition and credentials.
- We test initialization, restart and unseal on every node, then confirm behavior when the HSM connection is interrupted.
How we hand over
- You receive the image build definition, seal configuration, and a runbook covering startup, unseal failure and rollback steps.
- Documentation records which HSM objects, credentials and network rules the deployment depends on, and where each is stored.
- A handover session walks your operators through a planned restart and a simulated HSM failure so they can run the procedure alone.
How we support
- Engagements are fixed-scope, and changes to scope, such as a new OpenBao minor version, are agreed in writing before work resumes.
- Ongoing support, image rebuilds for new OpenBao releases and continuous testing of the unseal path are available as a retainer.
- Confirm with Securosys and your own environment which Primus firmware and library versions are supported with your OpenBao release.

