Why Hyperledger Fabric HSM protection matters for peer and orderer keys
A regulated member or ordering organization running Hyperledger Fabric must be able to show where its signing keys live. Fabric can keep peer and orderer MSP keys in a hardware security module (HSM) through the PKCS#11 standard, but TLS keys must remain file-based. Those two facts shape the whole design, so settle them early with your compliance and security teams, and treat the Fabric HSM documentation as the primary reference for what the software supports in your release line.
The HSM protects the private keys that sign transactions and prove the identity of a peer or orderer under its MSP. It does not protect everything else. TLS keys stay on disk, so the file system, the Kubernetes or host access model, and the controls around those files still carry weight. MSP certificates, configuration and ledger data also need backups, and an HSM does not make a backup of a signing key safe on its own. Confirm with your HSM vendor how key backup, replication and key loss recovery work before you rely on the device for continuity.
The prebuilt Fabric Docker images are not built with PKCS#11 support, so a custom image is required for HSM-backed peers and orderers. Plan that image as a maintained artifact with its own build, scanning and upgrade path. For context, LF Decentralized Trust describes Hyperledger Fabric as a graduated project for permissioned networks, licensed under Apache 2.0, so the software itself is open for inspection and modification. Your team, or a partner, still owns the build and the verification of the result.
Which key storage option fits each part of a Fabric node
This table compares file-based MSP keys, PKCS#11 HSM-backed MSP keys and TLS keys on disk across protection, build effort, operational cost and fit. Read each row as a separate key class on a peer or orderer, because the HSM option covers signing identity keys only and TLS keys stay on disk in every case.
| Key class | What it protects and build need | Main operational cost | When it fits |
|---|---|---|---|
| MSP signing keys on disk | Private keys stored as files in the MSP directory; uses the prebuilt Fabric images with no PKCS#11 build step | Key files must be protected through file permissions, volume encryption and access control on the host or cluster | Lower-assurance environments, test networks, or where your assessors accept file-based signing keys with compensating controls |
| MSP signing keys in an HSM | Private keys held in the HSM and used through PKCS#11; requires a custom peer or orderer image built with PKCS#11 support, because the prebuilt images do not include it | Custom image build and patch cycle, HSM licensing and partitions, and key import or ceremony procedures for each identity | Regulated networks where signing keys must sit in tamper-resistant hardware and your security team wants that evidenced |
| TLS keys on disk | Transport keys for peer and orderer endpoints remain file-based; the HSM option does not move them | Rotation, certificate renewal and file protection still run on your existing process | Always; plan TLS key handling separately from the HSM project rather than assuming HSM coverage |
| Fabric CA keys | Confirm with your CA design whether CA signing keys are stored in an HSM; this table covers peer and orderer MSP keys only | Depends on your CA topology and the HSM support of your CA build | Review in the CA and PKI design before committing hardware |
| HSM library and vendor fit | Confirm with the HSM vendor that the PKCS#11 library version, mechanisms and key types Fabric needs are supported | Vendor support terms and testing time for your chosen library | Confirm before purchase; vendor documentation and your own test results decide the fit |
| Key import and immutability | Confirm the key import procedure your HSM requires and how keys are bound to the MSP identity after creation | Ceremony time per identity and staff training for key custodians | Plan before enrollment, since changing a signing key later is an identity change, not a file edit |
Where the HSM sits in a peer or orderer trust boundary
The diagram starts at the custom Fabric peer or orderer image, which carries the PKCS#11 library in addition to the node process. The node process calls the HSM through the PKCS#11 interface, and that call crosses the trust boundary: the MSP signing key stays inside the HSM and is used for signing without leaving it. On the other side of the node, the TLS key and certificate remain as files on the file system, a boundary the HSM does not cover. The operations service endpoint sits on the same node and is protected by mutual TLS client certificates. When you review a design, check which keys sit on each side of the boundary and who can reach the file system.
The MSP signing key stays in the HSM, while TLS material stays on disk.
How the HSM build differs for production, cloud HSMs and test environments
An on-premises or data center HSM is a network or PCIe appliance that your organization owns, racks and administers. The build starts with the hardware and its security domain, then moves to the PKCS#11 library the appliance vendor supplies, which must be installed in the custom Fabric image so that the peer or orderer process can load it. Your team controls partitions, operator roles, firmware and physical access, so most of the work sits in planning those controls before Fabric is configured.
- Appliance and library installation: The vendor's PKCS#11 library must match the operating system and architecture of the custom image. Confirm the library path and version with the vendor and the Fabric HSM documentation, not from this page.
- Partition and credential setup: Create the partition, the signing user and the Crypto Officer roles that Fabric will use. Record who holds each credential and how it is rotated.
- Key labels and BCCSP settings: Define the key label and token label that the BCCSP section of the node configuration will reference, and keep them identical across environments.
- Network placement and high availability: Decide whether each peer or orderer reaches the HSM over a dedicated network path, and how the vendor handles cluster failover or replicated partitions.
- Backup and recovery: Confirm how key material is backed up, who can restore it, and whether a restored key can be re-associated with the same MSP identity.
Before you commit, ask the vendor which PKCS#11 features the library supports, how it handles key import and whether it is on the list of libraries your auditors expect.
A cloud-hosted HSM, such as AWS CloudHSM, gives you dedicated hardware in a provider's facility that you manage through the provider's client tooling and cluster controls. The shape of the work is similar to an on-premises appliance, but the provider runs the hardware and some of the failover, while your team carries more responsibility for client software, user management and network reachability. The Fabric-specific steps for this model, including the extra AltID setting and how the PKCS#11 library is mounted, are covered on the sibling page for AWS CloudHSM.
- Client and library components: Install the provider's client software and PKCS#11 library in the custom image, and confirm the supported versions with the provider before you pin them.
- Cluster and network path: Plan security groups, subnets and the route from each peer or orderer to the cluster. Confirm how the provider handles cluster membership and failover.
- Crypto user lifecycle: Define who creates crypto users, how their credentials are stored and how they are removed when a node is retired.
- Data residency and shared responsibility: Ask the provider which controls it runs, which ones you run, and where key material and logs reside.
- Quorum and key continuity: Confirm how the provider handles cluster recovery and whether a key can be re-created or must be imported again after an incident.
Confirm the library mounting steps and the required settings with the provider's documentation and the Fabric HSM documentation before writing any configuration.
SoftHSM is a software implementation of a PKCS#11 token. It lets a team exercise the same BCCSP configuration, custom image build and key label logic before production hardware is available. Because it is software, it stores keys in files on the machine that runs it, so it does not share the protections of a dedicated appliance. Treat it as a way to test the integration path, not as a stand-in for production key protection.
- What the test proves: That the custom image loads a PKCS#11 library, that the node finds the configured token and label, that signing works through the BCCSP path and that the node starts and joins a test channel.
- What the test does not prove: Tamper resistance, operator role separation, hardware failover, audit logging of key use, or performance under production signing load.
- Configuration parity: Keep token labels, key labels and configuration keys identical to the production design, so the only difference is the library and the token backend.
- Key immutability checks: Use the test to confirm the team's procedure for what happens when a key is rotated or lost. This is where the procedure is exercised, even though SoftHSM will not enforce it.
- Isolation and cleanup: Keep test tokens out of shared storage and destroy them after the exercise so test keys are not mistaken for production material.
Before sign-off, confirm with your security team which parts of the test evidence will be accepted for compliance review and which parts require a run on the production HSM.
Setup sequence for a PKCS#11 HSM on a Fabric peer or orderer
This sequence moves a peer or orderer's MSP signing keys into an HSM through PKCS#11 while keeping TLS keys on disk, and ends with a change record that lets another engineer reproduce and audit the setup.
Confirm the HSM and PKCS#11 library
The platform team confirms that the target environment has the HSM, its PKCS#11 client library, a token or partition for the node, and network or device access from the container host that runs the peer or orderer. Ask the HSM vendor which library file ships for your OS and which PKCS#11 version it implements. The step is complete when the team can list the token from the host with the vendor's tooling and the library path is recorded. Do not proceed if the token cannot be reached from the same host and user context the node will run under.
Build a custom Fabric image with PKCS#11
The engineering team builds a Fabric peer or orderer image that includes the PKCS#11 library and its runtime dependencies, because the prebuilt Fabric Docker images are not built with PKCS#11 support. Start from the Fabric release line your network runs, and keep the build pinned to that version. The image must also carry the vendor client library in a path the node can load. The step is complete when the image builds in your registry and a container started from it reports the PKCS#11 provider as available in its startup logs.
Test the image with SoftHSM
Run the custom image in a non-production network with SoftHSM, an open-source software token that implements PKCS#11, so the team can exercise configuration, token labels and PIN handling without touching production HSM partitions. Create a test token, point the node's BCCSP configuration at it, and confirm the node starts, enrolls and signs a transaction proposal. This step is complete when the test network runs end to end with keys held by the software token. Note that SoftHSM validates the integration path only and does not prove the production HSM's behavior, so the production test in a later step still matters.
Configure BCCSP for the PKCS#11 provider
The engineer edits the peer or orderer configuration to select the PKCS#11 provider under BCCSP and sets the library path, token label, PIN source and key identifier. Keep the PIN out of the configuration file itself, for example by reading it from a mounted secret, and confirm each key name against the Fabric HSM documentation for your release, since configuration keys change between versions. The step is complete when the node starts with the new configuration and its logs show the HSM provider loaded without falling back to file-based keys.
Generate or import MSP signing keys
The organization generates the MSP signing keys inside the HSM, or imports an existing key where the enrollment process requires it. Where policy requires non-exportable keys, the security team checks that the HSM marks the signing key as non-extractable and records how that was verified. Do this check in the HSM's own tooling, not only in Fabric logs. The step is complete when the key exists on the token, the non-exportable attribute is confirmed where required, and the enrollment certificate matches the key the HSM holds.
Keep TLS keys file-based
The engineer confirms that TLS private keys stay as files on the node's file system and are not placed in the HSM through this configuration. The Fabric HSM documentation states that TLS keys must remain file-based, so the team should verify the TLS paths in the peer or orderer configuration point to files and that no TLS entry references the PKCS#11 provider. Protect those files with the storage controls described in your MSP and secrets design. The step is complete when a configuration review shows TLS material is file-based and the TLS handshake succeeds after the restart.
Start the node and verify signing and health
The operator starts the node in production and checks that it signs a proposal or block using the HSM key, then queries the operations service. Confirm the /healthz endpoint reports healthy, the /version endpoint returns the expected build, and the /metrics endpoint or StatsD output is reachable through mutual TLS client certificates. Also confirm the log level endpoint responds. The step is complete when a test transaction is endorsed with the HSM-backed identity and all operations endpoints return the expected results.
Record key identifiers and image digest
The change owner records the HSM token label, the key identifiers for each MSP signing key, the library version, the Fabric release, the configuration file version, and the custom image digest in the change record. Store the digest rather than only a tag so the exact image can be redeployed, rolled back or audited later. The step is complete when a second engineer can read the record and identify which image and which HSM keys the node uses, and the record is stored with the other change documentation for that node.
Security and operational controls that keep HSM-backed keys protected
An HSM protects only the keys it holds, and the surrounding controls decide whether that protection survives rotation, upgrades and incidents. The cards below pair each control with the evidence a reviewer should ask for, covering key lifecycle, the file-based TLS exception, PIN handling, recovery, image supply chain and monitoring.
Key immutability and rotation
Keys generated inside the HSM for MSP signing cannot be exported or edited, so rotating a key means enrolling a new identity and updating the MSP and channel configuration that reference it. Confirm with the Fabric HSM documentation and your HSM vendor exactly what happens to existing certificates, whether re-enrollment reuses the same key label, and how old signatures stay verifiable. Evidence to request: a written rotation runbook and a test showing a peer rejoining after re-enrollment.
Fabric HSM docsFile-based TLS key protection
TLS private keys must stay on disk, so the HSM does not protect the connections that peers and orderers open. Protection moves to the file system, volume permissions and the container or pod that mounts the key material. Check which users and processes can read the TLS key directory, whether it is mounted read-only, and whether backups of the volume are encrypted. Evidence to request: file permission listings and the volume encryption configuration.
- TLS key storage
- File-based
PIN and token credential handling
The PKCS#11 PIN or token password is the credential that unlocks signing keys, so it needs the same care as any privileged secret. Identify who can read the PIN from environment variables, configuration files or orchestrator secrets, and restrict that access to the peer or orderer process account. Avoid placing the PIN in image layers or shell history. Evidence to request: the secret store configuration, access logs for the secret and a list of accounts with read access.
Backup and recovery of MSP material
The upgrade guide asks operators to back up the ledger and MSPs before changing binaries, and an HSM adds a second store that must be covered. Confirm whether your HSM vendor allows key backup or cloning, and if not, document how the signing identities are re-provisioned after a loss. Test a restore on a non-production node and record the time it takes. Evidence to request: backup schedules, restore test records and the HSM recovery procedure.
Custom image supply chain
The prebuilt Fabric images are not built with PKCS#11, so your team owns a custom image that must be rebuilt for each Fabric patch release on both the 3.x and 2.5 LTS lines. Pin the base image and Fabric version, scan the build, and keep the HSM client library version under change control. Verify that the image still loads the library and reads keys after every rebuild. Evidence to request: the build pipeline definition, image digests and the signed release record for each deployed image.
Monitoring through the operations service
The operations service exposes health, log level, version and Prometheus metrics endpoints, and it is secured with mutual TLS client certificates. Restrict which client certificates can reach these endpoints, and alert when a peer or orderer fails health checks after an HSM connection error. Avoid leaving log levels at debug in production, since verbose logs can expose configuration detail. Evidence to request: the list of authorized client certificates, alert rules and log level change records.
What changes when Fabric upgrades with an HSM in place
The Fabric upgrade guide sets out four steps: back up the ledger and MSPs, upgrade orderer binaries in a rolling fashion, upgrade peer binaries in a rolling fashion, then update application channel capability levels. An HSM-backed node keeps all four steps but adds two items to each one. First, the custom PKCS#11-enabled image must be rebuilt against the target Fabric release, because the prebuilt Docker images do not include PKCS#11 support and your image is a fork you own. Second, signing must be re-tested in SoftHSM before any production node moves, so you confirm that the new binaries still load the PKCS#11 library, find the key by label and produce signatures the MSP accepts. Record the HSM library version and the image digest for each node so the rollback target is known.
Version choice comes first. Fabric v3.0 changed consensus and lifecycle requirements: it added a SmartBFT ordering service and Ed25519 signing alongside ECDSA, and it removed Solo and Kafka consensus and the v1.x legacy chaincode lifecycle. A network that still runs Kafka ordering or v1.x lifecycle must migrate first, so an HSM-backed network on v2.5 has its own planning work before the move to 3.x. The Fabric GitHub releases page lists v3.1.5 and v2.5.16, published on June 18, 2026, and the 3.x and 2.5 LTS lines both receive patch releases in parallel. Staying on the 2.5 line for patches is a valid choice, but it still needs a planned patch cadence and a new custom image for each patch you apply.
Before each rollout, read the release notes for the exact target version, not only the upgrade guide, and confirm three things: whether the PKCS#11 build flags or the BCCSP configuration keys changed, whether the Go or base image requirements changed, and whether any HSM-related issue is open against that release. Ask your HSM vendor and your PKCS#11 library provider to confirm support for the Fabric release and the operating system in your image. Keep TLS keys file-based throughout, so the upgrade does not change how the operations service and gossip connections are secured. Finish by checking that the signing test passes on every node type before you update channel capability levels, since that step is hard to reverse.
Questions teams ask before adding an HSM to Fabric peers and orderers
What does it cost to put Fabric peer and orderer keys into an HSM?
No price is published for this work, and the cost is set by the written scope. The main components are the HSM itself and its hosting, the engineering time to configure BCCSP and build custom PKCS#11-enabled images, testing against a non-production network, and the change work on each peer and orderer. Costs rise with the HSM vendor and environment (on-premises appliance, cloud HSM or air-gapped site), the number of peers and orderers, how many images your pipeline must rebuild, how deep the testing goes, and how often you upgrade Fabric. Ask for a quote that separates one-time build work from any recurring image rebuilds and upgrade testing. DeployOpen provides a quote from a written scope.
How long does an HSM integration for Fabric take?
Duration depends on the scope, so no timeline is given here. The main drivers are how many peers and orderers hold MSP signing keys, whether your HSM is already provisioned and reachable from the nodes, how long the custom image pipeline takes to build and approve, and how many environments (test, staging, production) must be changed in sequence. Change windows and the orderer and peer rollout approach also affect the schedule. Ask for a plan that lists each environment and each change window as separate milestones so you can see what sets the critical path.
Can an in-house team set up PKCS#11 signing for Fabric on its own?
Yes, a team with Fabric operations experience and HSM administration skills can do this, but the work crosses several disciplines. The team needs to understand BCCSP configuration, build an image that includes PKCS#11 support (the prebuilt Docker images are not built with it), manage HSM slots and key labels, and test key use before any production change. Key immutability also means a mistake in key setup can be hard to reverse, so the rollout needs a rehearsed procedure. Consider whether your team has spare capacity for a test network, an image pipeline and the HSM administration at the same time. DeployOpen works from a written scope, so you can compare a self-built plan against a quoted one.
What does the client need to provide for an HSM integration?
The work needs several inputs from your side before it can start:
- Access to the HSM, including a test partition and a production partition, and the library path or client software installed on the nodes
- A container image registry where custom PKCS#11-enabled images can be built, stored and pulled by your clusters
- A test network that mirrors your peer and orderer layout closely enough to exercise the same configuration
- Change windows for each environment, plus named owners for the HSM, the cluster and the Fabric network
- Read access to your current MSP layout and the channel configuration that references those identities
Confirm each item with your HSM vendor and platform team before scheduling, since exact requirements depend on your environment.
Is SoftHSM enough to test an HSM setup before production?
SoftHSM is useful for testing the configuration path, because it lets you exercise PKCS#11 calls, BCCSP settings and the custom image on a test network without dedicated hardware. It does not prove that your production HSM behaves the same way. Vendor libraries, slot and token handling, key attributes, performance under load, and failover can differ from a software emulator. A sound test plan uses SoftHSM for early build checks, then repeats the key generation, enrollment, signing and restart tests on the real HSM in a non-production environment before any production peer or orderer changes. Confirm the testing depth with the people who own the HSM.
Can TLS keys for Fabric peers and orderers go into the HSM?
Fabric's HSM documentation states that TLS keys must remain file-based, so the HSM protects the MSP signing keys used by peers and orderers, not their TLS keys. This means TLS key material stays on disk and needs its own protection, such as restricted file permissions, encrypted volumes or a secrets store, plus a rotation plan. Plan your TLS certificate lifecycle separately, including renewal and the trust configuration that depends on it. Confirm this constraint against the Fabric HSM documentation for the release you run, since the guidance is the basis for the design.
How does a partner's HSM work differ from an internal build?
The main difference is who holds the planning, test evidence and handover. A partner working from a written scope commits to defined deliverables, such as the BCCSP configuration, the custom image build, the test results and the runbook, before work starts. An internal build depends on your team's availability and existing skills, and the knowledge often stays with the people who built it. Either way, the operational duties stay with you: the HSM remains under your control, your environment hosts the network, and your staff run the day-two work. Ask any provider which artifacts you receive at the end and how upgrades to new Fabric releases will be handled.
Limits to confirm in your environment before you commit
An HSM setup for Fabric depends on several moving parts: the Fabric release line, the signing algorithms it supports, the HSM vendor's library, your key policy and your monitoring stack. Each card below is a question to settle with the vendor and your own team before you order hardware or start building a custom image.
Release and library support
Ask whether your HSM and its PKCS#11 library are supported with the exact Fabric release you plan to run. Fabric publishes patch releases on both the 3.x and the 2.5 LTS lines, so confirm support for the specific patch you will deploy, not only the major line. Check that the library version loads in the custom peer and orderer images you build.
Fabric HSM docsKey type and algorithm alignment
Confirm that the key types your HSM generates match the MSP signing algorithms the chosen release accepts. Fabric v3.0 added Ed25519 alongside ECDSA for MSP signing, so an HSM that handles only one of these may constrain your design. Verify that the key generation, signing and certificate chain behavior work end to end before you issue identities.
Import, export and backup policy
Check whether your HSM can meet your organization's policy on key import, export and backup. Some policies require keys to be non-exportable, while recovery plans may depend on a documented backup or cloning procedure. Agree on who holds the authorization to restore keys, and test that a replacement HSM can recover signing identities without changing the MSP that other members trust.
Image pipeline maintenance
Because the prebuilt Fabric images are not built with PKCS#11, your team owns a custom image pipeline. Confirm who rebuilds the images when a new patch ships on either the 3.x or the 2.5 LTS line, who tests the library inside each build, and how long your change process takes. Decide how the pipeline handles security fixes in the HSM client library itself.
Capacity and failover
Ask the vendor how many signing operations per second the HSM sustains for your expected endorsement and ordering load, and what happens when a device fails. Confirm whether failover is active or passive, whether it needs a cluster or a second appliance, and whether a peer can reach a standby without a restart. Capacity figures should come from the vendor in writing, not from assumptions about your network.
Monitoring without weakening TLS
Confirm that your monitoring and operations tools can reach each peer and orderer without widening the trust model. The operations service exposes health, log level, version and metrics endpoints secured with mutual TLS client certificates, and TLS keys stay file-based. Check that any agent or sidecar you add uses approved client certificates and does not require HSM access to the TLS keys.
Operations service docsHow DeployOpen scopes, builds and supports HSM-backed Fabric nodes
DeployOpen plans, implements and hardens self-hosted Hyperledger Fabric nodes inside infrastructure you control, including the PKCS#11 wiring that moves peer and orderer signing keys into an HSM. Each engagement starts with a written scope that defines which keys move, which stay file-based and how the result will be tested and handed over.
How we scope
- Inventory which peer and orderer MSP keys move into the HSM and which TLS keys stay file-based.
- Confirm the HSM vendor, PKCS#11 library, partition layout and the Fabric version the nodes run.
- Agree the scope, deliverables and timeline in writing before any build work starts.
How we build
- Set the BCCSP configuration for each peer and orderer and validate it against a SoftHSM test setup first.
- Build custom images with PKCS#11 support, since the prebuilt Fabric images do not include it.
- Test enrollment, signing, key immutability and node restarts before anything reaches the production environment.
How we hand over
- Deliver configuration files, image build records and a runbook describing key labels and recovery steps.
- Document which keys are HSM-backed, which remain on disk and why, so reviewers can trace each decision.
- Walk your platform and security teams through the operating procedures and the retest results.
How we support
- Offer ongoing support, upgrades and continuous testing as a retainer after handover.
- Plan the custom image rebuild and retest each time you move to a new Fabric patch release.
- Review HSM access, backups and operations logging as part of scheduled support work.

