Protecting Hyperledger Fabric MSP material on Kubernetes

Fabric MSP keys and configuration on Kubernetes need deliberate storage, access and volume choices. This page explains the options, trade-offs and what to verify before go-live.

On this page

Protecting Hyperledger Fabric MSP material on Kubernetes: what it covers and when you need it

If you run Fabric peers or orderers on Kubernetes, you must decide where MSP keys, certificates and configuration live before the first peer joins a channel. For most networks, the starting point is Kubernetes secret objects for important configuration files, with an HSM or an encrypted persistent volume as the next layer of protection. Fabric's production deployment guidance names these options, and the choice matters because the peer file system holds the ledger, installed chaincode, identities and the MSP directory, so anyone who copies that material can impersonate the node. The decision is not only about the keys themselves. It also covers who can read the mounted files, where backups go, and how a replacement pod gets its identity back.

Plan around one fact first: Kubernetes stores Secrets unencrypted in etcd by default. Anyone with direct access to etcd snapshots or backups, or with broad list and watch rights on Secrets in the namespace, can read MSP material stored that way. The Kubernetes good practices page asks administrators to enable encryption at rest, restrict list and watch access with least-privilege RBAC, or pull secrets from an external store through the Secrets Store CSI Driver. Confirm with your cluster team which of these is already in place, and whether etcd backups are encrypted, before you decide that a secret object alone is enough.

You need HSM-backed keys when the organization requires that signing keys never exist as exportable files on a node, or when your key custody policy names an HSM. Fabric supports PKCS#11 for peer and orderer MSP keys, but TLS keys must stay file-based, and the prebuilt Docker images are not built with PKCS#11, so custom images are required. Treat this as a separate design decision with its own build, test and recovery steps. Ask your team to confirm, in writing, which key classes the policy covers and who approves any exception.

Storage options for MSP material and when each fits

This table compares four ways to store Fabric MSP material on Kubernetes: Kubernetes Secrets with encryption at rest, the Secrets Store CSI Driver with an external store, HSM-protected signing keys through PKCS#11, and encrypted persistent volumes. Read each row to see what the option protects, what stays as files on the peer or orderer, and how much operating work it adds. The main takeaway is that no single option covers every key, so most teams combine them.

OptionWhat it protectsWhat remains file-basedOperational burdenWhen it fits
Kubernetes Secrets with encryption at restSecret objects stored in etcd once encryption at rest is configured; without it, Secrets sit unencrypted in etcd by defaultMSP and TLS material is mounted as files into the pod, so the file copy is what the process readsLow to moderate: configure the encryption provider, restrict list and watch RBAC, and back up etcd keys with the dataTeams starting with file-based keys who can enforce encryption at rest and tight RBAC on the cluster
Secrets Store CSI Driver with an external storeKey material stays in an external secret manager and is fetched into the pod at mount timeMounted copies in the pod filesystem; the external store does not hold a live signing functionModerate to high: provider integration, rotation handling and access policies for the external storeOrganizations that already run a central secrets platform and want rotation and audit outside the cluster
HSM-protected MSP signing keys via PKCS#11Peer and orderer MSP signing keys never leave the HSM, so they cannot be copied from the file systemTLS keys stay on disk, and the peer still needs local files for identity configurationHigh: custom PKCS#11-enabled images, HSM partitions, library mounts and key lifecycle testingRegulated networks that require hardware-backed signing keys and can staff HSM administration
Encrypted persistent volumesData at rest on the volume holding the ledger, chaincode, identities and MSP directoriesEverything the process reads is decrypted in the running pod, so the live files remain exposed to anyone with pod accessModerate: storage class encryption, key management for the volume and restore testingTeams whose main requirement is protecting the peer file system as a whole, not individual keys
Mounting volumes outside podsLimits what a compromised workload can reach by keeping MSP directories on storage that the pod mounts read-only where possibleFiles still exist on the node or storage backend and need host and storage access controlsModerate: storage layout, mount permissions and node-level hardeningClusters where separate teams or namespaces must not share host paths or volume contents
Pod security and filesystem restrictionsConstrains who can exec into or read from the peer and orderer containersAll key files remain readable to the process that owns themLow to moderate: Pod Security Standards settings and workload reviewAs a baseline under any of the options above, regardless of key storage choice
Key rotation and revocation handlingLets operators replace enrollment material without rebuilding images or redeploying the networkRotated files still exist on the volume or mount, so old copies must be removedModerate: rotation runbooks, CA coordination and verification after each changeAny network that expects certificate renewal during its life, which Fabric CA supports through renewal and revocation

How to set up protected MSP storage on Kubernetes

This sequence takes a Fabric peer or orderer from unclassified files to a cluster where MSP keys, TLS material and ledger data each sit in a storage model that matches their sensitivity, with checks at every stage. The result is a running node whose signing identity is not readable by unintended workloads.

  1. Inventory MSP, TLS and ledger files

    The platform or security engineer lists every file the peer or orderer reads or writes: signing keys and certificates under the MSP directory, TLS keys and certificates, the admin and client identities, channel configuration, and the ledger, chaincode and state database directories. Mark each file as MSP material, TLS material, configuration or ledger data, because the Fabric production deployment guide and the peer planning docs treat the peer file system, which holds ledgers, chaincode, identities and MSP, as material that must be protected. Done when the team has a signed-off table that maps each path to a file class and an owner, and no path is left unclassified.

  2. Choose a storage model per file class

    The architect assigns each file class a storage model. Kubernetes Secret objects are the option the Fabric deployment guide suggests for important configuration files, while HSMs or encrypted persistent volumes are the alternatives it names. Signing keys are the strongest candidates for an HSM, since Fabric supports PKCS#11 for peer and orderer MSP keys, but TLS keys must remain file-based. Ledger data usually belongs on encrypted persistent volumes because of its size and write pattern. Confirm the storage choices with your security team and your cloud or data center provider before implementation. Done when a decision record names one storage model for each class and states why.

  3. Enable etcd encryption and restrict Secret access

    The cluster administrator confirms that encryption at rest is configured for etcd, because Kubernetes stores Secrets unencrypted in etcd by default. Next, the administrator creates RBAC roles that grant only the Fabric service accounts the get access they need on their own Secrets, and removes list and watch permissions from broad roles such as namespace editors or monitoring agents. Confirm the exact encryption provider configuration with your Kubernetes distribution documentation. Done when a test user or service account without a Fabric role receives a forbidden response when it tries to list or watch Secrets in the Fabric namespace, and the encryption-at-rest configuration is recorded in the change log.

  4. Mount secrets or CSI volumes outside the file system

    The platform engineer changes the peer and orderer deployment so that MSP and TLS material is delivered as mounted volumes, not copied into the container image or baked into a configuration file. Where the team needs keys to come from an external store, it uses the Secrets Store CSI Driver, which the Kubernetes good practices page lists as an option for external stores. Mount each secret read-only, with the narrowest path the node needs, and keep it out of environment variables where logs or process listings could expose it. Done when a shell inside the running container shows the expected files at the mount paths, the files are read-only, and no key material appears in the image layers or the pod specification.

  5. Apply Pod Security Standards to Fabric workloads

    The cluster administrator labels the Fabric namespace with a Pod Security Standards level that fits the workload and checks that the peer and orderer pods meet it. The Pod Security Standards describe baseline and restricted profiles that limit privilege escalation, host paths and root execution. Fabric pods that need specific capabilities or host access should be documented as exceptions with a named owner. Confirm the level your cluster supports and how your admission controller enforces it. Done when the namespace enforces the chosen level, a deliberately non-compliant test pod is rejected, and the peer and orderer pods are admitted without exceptions beyond the documented list.

  6. Build a PKCS#11 image if using an HSM

    If the design places signing keys in an HSM, the image team builds a custom peer and orderer image with PKCS#11 support. The Fabric HSM documentation states that the prebuilt Docker images are not built with PKCS#11, so the standard images will not work for this design. The build should pin the Fabric version, include the vendor PKCS#11 library, and be scanned and stored in the organization's own registry. Test the image first in a non-production environment with a software HSM, then with the real device. Done when the image starts, reports PKCS#11 support, and signs a test transaction using a key held in the HSM, with the build record stored alongside the release.

  7. Verify peers start, sign and protect secrets

    The team runs a final verification in the target cluster. It confirms that the peer and orderer start with their mounted MSP and TLS material, that the operations service health endpoint reports healthy, and that the node signs a test proposal or endorsement successfully. It then repeats the RBAC test from the earlier step using the service accounts of other workloads in the cluster and confirms they cannot read Fabric Secrets, and checks that the ledger volume is encrypted as the storage design requires. Record the results and keep them with the change records for later audit and upgrade work. Done when all checks pass, the results are signed off by the platform and security owners, and any failed check has a tracked fix.

How to protect the peer file system that holds ledgers and identities

The peer file system holds more than the ledger. Under the planning guidance for a production peer, the file system carries ledgers, installed chaincode, identities and the MSP directory, so a compromise there can expose signing identities even when no Kubernetes Secret is read. Secrets objects protect individual configuration files, but they do not protect the data the peer writes at runtime. Treat the peer's persistent volume as a security boundary in its own right, and document which paths hold key material, which hold ledger data and which can be rebuilt. Ask your platform team to confirm where the peer writes its MSP and keystore paths in your chart or manifests, since those paths determine what each volume must protect.

Encrypt the volume and separate what lives on it. The planning guidance names encrypted persistent volumes as an option for protecting this data. Encryption at rest is only as strong as the key management behind the storage class, so confirm with your cluster or storage provider whether encryption is applied at the volume, the node or the storage backend, who holds the keys, and how rotation works. Keep ledger data on its own volume rather than mounting it alongside key material. A separate volume lets you restrict who can mount or snapshot the identity volume, apply different retention and backup rules, and resize ledger storage without touching the identity path. Restrict write access to the MSP directory to the peer's service account, and confirm that no other workload in the namespace mounts it.

Plan backups of MSP directories as sensitive material. The Fabric upgrade guidance tells operators to back up the ledger and MSPs before upgrading, which means identity material enters your backup system. Encrypt those backups, limit restore rights to the same people who can rotate identities, and store them separately from ledger snapshots so a routine data restore does not reintroduce retired keys. Test a restore into an isolated namespace and check that the restored peer enrolls with the expected identity. Ask your backup vendor how it handles encryption keys, access logs and retention for these archives, because those answers decide whether your backup policy meets your own key-handling standard.

Security risks to address when Fabric keys run in a cluster

Fabric MSP keys and identities are only as safe as the cluster that holds them. The risks below sit in the places keys are stored, read, copied and replaced, so each card pairs a risk with the control that addresses it and a check to run against your own cluster.

Unencrypted Secrets in etcd

Kubernetes stores Secrets unencrypted in etcd by default, so anyone who can read etcd data or its snapshots can recover MSP private keys and certificates. Configure encryption at rest for the Secret resource before loading keys, and confirm the encryption provider is active on every control plane node. Also ask who holds access to the etcd data directory and its backups. The default is unencrypted storage, so this control must be set explicitly.

Secrets good practices

Overly broad list and watch access

Listing or watching Secrets in a namespace returns the full content of every Secret, so a service account with list or watch rights can read peer and orderer keys without ever asking for them by name. Restrict these verbs with least-privilege RBAC, bind roles to named workloads only, and audit which subjects hold them. Operators and CI pipelines often hold broader roles than they need, so review those bindings first.

Secrets good practices

Cluster admin access to mounted keys

Anyone with cluster-admin rights, or rights to exec into pods or create pods that mount a Secret, can read keys from a running peer or orderer. Limit exec and port-forward rights, require a separate break-glass path for administrators, and record who uses it. Ask whether HSM-backed MSP keys are in scope for your threat model, because the PKCS#11 approach keeps signing keys out of the file system while TLS keys stay on disk.

Key material in backups

Cluster backups, etcd snapshots, GitOps repositories and CI artifacts can each contain plaintext key material if Secret manifests were committed or exported. Treat every backup target as sensitive, encrypt it, and restrict who can restore it. Confirm that restoring a snapshot into a new cluster does not reveal keys to staff who should not hold them. Use the Fabric backup steps for ledgers and MSPs as the scope for what must be protected.

Pods with excess privileges

A peer or orderer container that runs as root, mounts host paths, or has broad Linux capabilities can read files that belong to other workloads or to the node itself, including mounted MSP directories. Apply a restricted Pod Security profile, run as a non-root user, drop unneeded capabilities and avoid hostPath volumes for identity material. Check the workload against the CIS Kubernetes Benchmark as an external reference.

Pod Security Standards

Rotation and revocation through the CA

Replacing a compromised peer or orderer identity means reissuing its certificate through Fabric CA, revoking the old one and updating the MSP in channel configuration. If keys are copied into Secrets by hand, the old copies can survive a rotation. Define who triggers revocation, how the new Secret replaces the old one everywhere it was mounted, and how quickly channel configuration is updated. Confirm the process with your CA operators before an incident.

Questions teams ask before protecting MSP material on Kubernetes

Are Kubernetes secrets enough to protect Fabric MSP material?

Kubernetes secrets are a workable starting point, but they need hardening before they hold signing keys. Kubernetes stores Secrets unencrypted in etcd by default, so you should enable encryption at rest, restrict list and watch access with least-privilege RBAC, and confirm who can read secrets in each namespace. The Fabric production deployment guide names Kubernetes secret objects for important configuration files, with HSMs or encrypted persistent volumes as alternatives. Many teams combine these: secrets for configuration, and an external store through the Secrets Store CSI Driver for key material. Decide this per key type before building the peer or orderer deployments.

Do we need an HSM to protect MSP keys?

An HSM is not required by Fabric, but it is the strongest option for MSP signing keys when your policy demands keys that never leave hardware. Fabric uses the PKCS#11 standard to keep peer and orderer MSP keys in an HSM. TLS keys must remain file-based, so an HSM does not cover every key in the node. The prebuilt Fabric Docker images are not built with PKCS#11, so you need custom images. Your compliance team should confirm which keys their policy requires in hardware before you choose between an HSM, encrypted volumes and secrets.

What does this work cost, and what drives the cost?

DeployOpen does not publish prices. A quote follows from written scope, and the main cost drivers are the number of peers and orderers, the number of MSP and TLS keys to protect, whether an HSM is in scope, and how many clusters or environments must be built and tested. Ask for the quote to separate one-time work (design, build, custom images, testing, documentation) from recurring work (key rotation procedures, upgrades, retesting after Kubernetes or Fabric version changes). Also ask which items the client provides, such as the HSM, cloud accounts and cluster access.

How long does protecting MSP material take, and what depends on the cluster?

Duration depends on the cluster and the number of nodes, not on a fixed template. Factors include whether the cluster already has encryption at rest and an external secret store, how many organizations and nodes share the cluster, whether HSM hardware is already provisioned, and how quickly your change process approves access policies. Kubernetes releases about three times a year on a cycle of about 14 weeks, so confirm that the cluster version is supported for the duration of the work. Agree a timeline in the written scope.

What must our internal team provide before the work starts?

Your team should provide cluster access with the rights needed to configure encryption at rest and RBAC, a named owner for each Fabric organization's identities, and the policy decisions on which keys must stay in hardware. You will also need to supply the HSM or cloud HSM account if one is in scope, the Kubernetes version and distribution details, backup arrangements for etcd, and the change windows for rolling restarts. Confirm the exact list with DeployOpen in the written scope so nothing blocks the build.

Can our own team protect the MSP material without a partner?

Yes, a capable platform team can do this if it has Fabric and Kubernetes skills and time to test failure cases. The work requires understanding the peer file system, which holds ledgers, chaincode, identities and MSP data, and planning how each piece is protected and backed up. Kubernetes authentication, etcd backups and version skew rules also apply to the cluster that holds the material. Teams that build in-house should test restores and key rotation before go-live. A partner is useful when deadlines are tight or when independent review is needed.

How does this interact with CA certificate renewal?

Renewal changes the files that the protection design must handle, so the design should cover the renewal process from the start. Fabric CA issues enrollment certificates, handles renewal and revocation, and generates certificate revocation lists. When an MSP certificate is renewed, the new material must reach the right secret, HSM or volume without breaking running peers and orderers. Confirm how renewal updates are rolled out in your cluster, who approves them, and how expired certificates are recovered. Test a renewal in a non-production cluster before relying on it.

Trust boundaries for MSP material in a Fabric cluster

The diagram starts at the Kubernetes API, where secrets are written and stored in etcd, which holds them unencrypted by default unless encryption at rest is configured. A Secrets Store CSI Driver or a mounted secret moves material into the peer pod, where the file system holds ledgers, chaincode, identities and MSP. Signing keys can leave the pod for an HSM through PKCS#11, while TLS key files stay on disk. Check each hand-off: who can read etcd, who can list secrets, and which boundary the signing key crosses.

Trust boundaries and hand-offs for MSP and TLS material in a Fabric peer pod.

How to keep protected MSP storage working after go-live

Protected MSP material needs routine work after go-live, and the first item is certificate rotation. Fabric CA issues enrollment certificates, handles renewal and revocation and generates certificate revocation lists, so the team that owns the CA must set renewal windows and confirm that each renewed certificate is written back to the place the peer or orderer reads it. For keys held in an HSM, the signing key does not change when the certificate is renewed, but the certificate in the MSP folder does, so the PKCS#11 configuration and the Kubernetes secret or volume that carries the certificate must both be updated. Schedule a rehearsal in a non-production network before the first production renewal, and confirm with your CA operator how renewal and revocation are triggered and audited.

Every change to a Kubernetes secret that holds MSP files or configuration needs a planned rolling restart, because a running peer or orderer does not reliably pick up new files on its own. Restart one replica at a time, check the operations service health endpoint before moving to the next, and keep the rollout inside the window your channel policies allow for an outage on that node. Kubernetes upgrades follow the version skew policy: kube-apiserver goes first, one minor version at a time, followed by kube-controller-manager, kube-scheduler and kubelets, and kubelets may trail the API server by up to three minor versions. Confirm which minor releases are still patched on the releases page before you plan an upgrade, because an unsupported cluster cannot receive fixes for the secret handling you rely on.

Protected material is only recoverable if it is in the backup set, so back up etcd on a schedule with etcdctl snapshot save and treat the MSP secrets, HSM configuration, CA databases and persistent volumes as part of the same recovery plan. Restores use etcdutl, and a restore drill should prove that a peer comes back with its MSP identity intact, not just that the snapshot file exists. Monitor each peer through the operations service /healthz endpoint and the /metrics endpoint, both protected by mutual TLS client certificates, so the monitoring client must hold a valid certificate that is itself on the rotation schedule. Record who approves each rotation, restart and restore, because those records are the evidence an auditor will ask for.

How DeployOpen works on this

DeployOpen approaches MSP protection on Kubernetes as a fixed-scope piece of work agreed in writing before any change is made to your cluster. We plan the key storage, secret handling and file system controls for each Fabric peer and orderer in infrastructure you control, then build and test them in your environment and document the result for your own operators.

How we scope

  • We inventory every peer and orderer MSP directory, its secret objects, and where its keys currently sit in the cluster.
  • We agree in writing which protection options apply to each component, such as Kubernetes secrets, an HSM or encrypted persistent volumes.
  • We confirm which cluster controls are in scope, including encryption at rest for etcd, RBAC for secret access and pod security settings.

How we build

  • We configure MSP and TLS file mounts so private keys stay outside container images and are not copied into pod specs.
  • We restrict who can list, read or watch the secrets that hold MSP material, and test that least-privilege rules hold.
  • We test peer and orderer restarts, rolling upgrades and key rotation against the protected layout before handover.

How we hand over

  • You receive a written record of each MSP secret, volume, mount path and access rule, with the reasons behind each choice.
  • We deliver runbooks for backup of MSP material, restore testing and recovery after a node or cluster loss.
  • We walk your platform and security teams through the configuration so they can review and change it themselves.

How we support

  • Ongoing support, upgrades and continuous testing are available as a retainer after handover.
  • Retainers can cover Kubernetes version changes and Fabric patch releases that affect how MSP material is mounted.
  • Where the scope includes a security review, we retest the MSP protection after fixes are applied.

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.