Protecting Besu node private key files without an HSM

When an HSM is not in budget, Besu node key files need deliberate placement, permissions and backup. This page explains the options, the trade-offs and what to confirm.

On this page

Protecting Besu node private key files without an HSM

When a permissioned Besu network has no funded HSM yet, the node key sits on disk as a file, and the first thing to accept is that Besu does not encrypt the local node private key file. Protection therefore comes from four controls around the file: where it lives, who can read it, how it is backed up, and how it reaches the node at start-up. Besu generates the key in the data directory on first start unless --node-private-key-file points to an existing key file, so the decision about location is made before the node ever runs. Teams that pre-generate keys can place them on a dedicated path, restrict ownership to the service account that runs Besu, and keep the directory off shared volumes and off the same disk as chain data.

Accepting file-based keys is reasonable when the network is a pilot, a non-production environment, or a production network whose operator has documented compensating controls, such as a locked-down host, restricted administrative access, and tested backups of the key file. Write these choices down, because the node's public key is part of its enode URL and anyone who reads the key file can impersonate that node. Confirm with your security team how the key file will be rotated and what happens to peers when a node key changes, since peers referencing an old enode will need updating. Pre-generated keys should be created on a controlled workstation or inside your key management process, not on the node that will use them.

Revisit the HSM path when the network moves toward production with regulated counterparties, when your audit or risk function asks for hardware-backed key storage, or when a key file has been exposed or copied outside the planned locations. The Besu docs describe a security module plugin, the Besu HSM plugin, selected with the --security-module option, for this case. Before a go-live decision, read the node keys documentation to confirm the current key file options for your Besu version, and ask your team to verify each file path and permission in a staging environment before relying on them.

Which key file option fits which deployment

This table compares four ways to store a Besu node private key without an HSM, from the default data-directory file to a cloud secret store synced into the pod. Read each row for what the option protects, what it still leaves exposed, and the deployment it suits. The main takeaway is that every file-based option leaves the key readable by anyone with access to the host, volume or pod, so the choice depends on who can reach that location.

OptionWhat it protectsWhat it leaves exposedWhen it fits
Default data-directory keyCreates the key automatically at first start, so no key handling step is needed during deploymentThe key sits in the data directory next to chain data and is not encrypted, so anyone who can read the node's data volume or backups can copy itSmall test or pilot networks where the node host is tightly controlled and the team accepts the exposure
Custom --node-private-key-file path on a separate volumeSeparates the key from chain data, so routine data directory handling, snapshots and backup jobs can exclude it, and file permissions can be restricted to the Besu service accountKey is still a plain file on disk, so host administrators, root users and anyone with access to the volume or its snapshots can read itBare-metal or VM nodes where the team can set ownership and permissions and wants the key kept out of the general data path
Pre-generated key injected at deploy timeKeeps the node's identity stable across rebuilds, so the enode URL stays the same and peers and permissioning entries do not changeThe key exists on the deployment tooling, CI system or operator workstation before deploy, so those locations and their logs need the same protection as the nodePermissioned networks where enode URLs are registered in advance and nodes are rebuilt or replaced regularly
Cloud secret store synced into the podKeeps the key in a managed secret service with access controlled by cloud identity, and the Kubernetes charts can use Secrets Manager or Key Vault with managed identities when cloudNativeServices is enabledThe key is still written into the pod filesystem at runtime, and cluster administrators or anyone who can read the Kubernetes secret or exec into the pod may reach itKubernetes deployments on AWS or Azure where the cloud provider's secret service and identity controls are already part of the operating model

Set up a key file outside the default data directory

This sequence places the Besu node private key in a location you control, restricts who can read it, and confirms that the node keeps the same enode identity across restarts. The result is a node whose identity you can document, back up and verify before it joins the network.

  1. Decide the key location and owner

    Agree with the platform team and the security owner where the key file will live, which operating system account will own it, and which service account will run the Besu process. Record the path, owner, group and the people allowed to administer it. The step is done when the decision is written down and the service account that will start Besu is named, so that no one has to guess later which account should read the file.

  2. Create a dedicated volume or path

    Create a directory for the key outside the Besu data directory, on a separate volume if your platform supports one, so that key material is not swept into routine data copies or snapshots. Create the directory with ownership set to the Besu service account and a restrictive mode. Check the mount with a simple write and read as the service account, and confirm that the volume is included in your backup scope so the key can be restored.

  3. Generate or import the node key before first start

    Create the key before Besu runs for the first time. If Besu has not yet written a key in the data directory, you can generate one in the key location with the tool your team uses for key generation, or copy an existing key that you already hold. Do this before first start, because Besu otherwise creates its own key in the data directory and the node identity would then differ from the one you planned. Confirm that the file exists at the chosen path and contains a single private key.

  4. Restrict file permissions to the service account

    Set the key file so that only the Besu service account can read it, typically by setting the owner to that account and removing group and other read access. Verify with a directory listing that the permissions show no access for other users, and confirm that a different local account gets a permission error when it tries to read the file. The Besu node keys documentation states that the local private key file is not encrypted, so these file permissions are the main control on this key.

  5. Point node-private-key-file at the key

    Set the --node-private-key-file option to the full path of the key file in your Besu configuration or start command, and keep the data directory separate. Review the configuration so that no second key path or stale data directory key takes precedence. The step is complete when the configuration file or unit definition shows the intended path and the same path is used by every restart script, container definition or Helm value that starts the node.

  6. Start the node and export the public key

    Start the node as the service account and wait until it reports that it has started and is connected to its configured peers. Then run the public-key export subcommand against the same key file and record the output. Compare the exported public key with the public key portion of the enode URL that Besu logs or exposes, so you know the running node uses the key you planned. Record both values in your change record.

  7. Confirm the enode matches the peer list

    Add the exported enode to the static peers or permissioning list of the other nodes in the network, as your design requires, and confirm that those nodes connect to it. If you use node permissioning, confirm that the enode in the allowlist matches the exported value exactly, since a single character difference will block the connection. The step is done when peer connections show the node as a known participant.

  8. Confirm the enode is stable across restarts

    Stop and restart the node, then repeat the public-key export and compare it with the value recorded earlier. Also confirm that the file's permissions and owner have not changed and that no new key was written to the data directory. The step is complete when the enode is identical after the restart and the file check passes, which is the evidence that the node identity is anchored to the key file you control.

Controls that matter when the key is a file

A Besu node private key file is the identity of the node, so anyone who can read it can impersonate that peer. Without an HSM, the controls below are the ones that carry the protection, and each one needs an owner, a check and a record.

File permissions and ownership

Run the Besu process as a dedicated service account and make that account the only owner of the key file. Restrict the file to read-only for that account and remove group and world access, so no interactive user or sidecar can read it by accident. Check the directory holding the key as well as the file, because a writable parent directory lets someone replace the key. Verify ownership and mode after every provisioning run, since configuration management tools and container init steps often reset them.

Besu node keys docs

Separate volume and mount options

Place the key on its own volume or mount, separate from the chain database, logs and temporary files. This keeps the key out of routine snapshots and log bundles that teams share during incidents, and lets you apply stricter mount options such as nosuid and nodev. Pass the location with --node-private-key-file so the path is explicit in the startup configuration rather than inherited from the data directory. Confirm that the volume is not world-readable on the host and that backup jobs targeting the chain data do not sweep it up.

Encryption at rest from the platform

Besu documents the local node private key file as unencrypted, so the file itself offers no protection beyond access control. Encryption at rest has to come from the layer beneath it, such as full-disk or volume encryption on the host, encrypted block storage in your cloud account, or an encrypted filesystem. Ask the infrastructure team which key encrypts that volume, who can unwrap it, and whether a host compromise that gives root access also gives access to the decrypted key.

Backup with restricted access and tested restore

A lost key means the node loses its identity and its enode changes, so back up the key file to a restricted location with its own access list, separate from routine backups. Encrypt the backup with a key held apart from the node's host. Restore the key in a non-production environment on a schedule and confirm that the node starts with the same public key, since an untested backup is only a file that may or may not work.

No key in images, logs or git history

Keep the key out of container images, Helm values, Ansible variables in plaintext, CI artifacts and repository history. If a key was ever committed, treat it as exposed and re-enroll the node rather than trusting a later deletion. Configure logging so startup output and debug traces do not print file contents or paths that reveal sensitive material. Scan repositories and image layers for key-like material as part of the release gate, and record the result.

Rotation and peer re-enrollment

A changed node key produces a new public key and therefore a new enode URL, so every peer and static node list that references the old enode must be updated. Plan rotation as a change with a window, a list of affected peers, and a rollback path that keeps the old key available until the new enode is confirmed. Coordinate with the other consortium operators, because a node that has rotated without notice can appear to be offline or misconfigured to everyone else.

Monitoring for unexpected reads or changes

Set file integrity monitoring or audit rules on the key path so that reads, permission changes and replacements produce alerts. Forward those events to the same log platform that receives Besu logs, and define who responds and how quickly. Compare the node's public key at each start against the expected value, so a swapped key is noticed as a change in identity rather than discovered later as a peering failure.

Using cloud secret stores in Kubernetes deployments

Besu's Kubernetes production charts can source node key material from cloud-native services instead of a key file you manage by hand. Setting cloudNativeServices: true switches the chart to the cloud path: on AWS that means AWS Secrets Manager and IAM, and on Azure it means Azure Key Vault and Managed Identities. The decision this section helps you make is whether moving the node key into a managed secret store reduces your exposure more than it adds operational dependence. Before you rely on the setting, confirm the chart version you deploy and the exact secret names, keys and workload identity wiring against the production chart documentation, because the mapping between the chart values and the cloud secret is the part most likely to change between releases. Besu docs: Deploy Besu for production on Kubernetes is the page to check first.

The secret store does not remove the key from the workload. At runtime the node private key still reaches the pod, either as a mounted file on a filesystem or as a value in the environment, and Besu reads it from there. The real exposure therefore sits in three places: which identities can read the secret (the IAM role or Managed Identity bound to the pod), how that identity is bound to the pod (for example, whether any other workload in the namespace can assume it), and who can exec into the pod or read its mounted volume. Review those bindings as carefully as the secret policy itself, and confirm that the node's key file is never written to a persistent volume or container image layer.

Plan rotation and recovery before go-live. Rotating a node key changes its public key and therefore its enode URL, so every peer that lists the old enode must be updated, which is a network change, not only a secret change. Ask your platform team to demonstrate how a rotated secret reaches a running pod, whether the node restarts, and how the cloud store, its access logs and its backup policy are retained for your audit evidence. Keep an offline, access-controlled copy of the key material according to your key management policy, and test restoring a node from it in a non-production cluster.

Limits to confirm in your environment

A file-based node key is simple to run, but several limits depend on your Besu version, your chart values and your own policies. The cards below list the checks to complete before go-live, because each one can change where the key lives and how it is rotated.

Version support for flags and chart values

Confirm that your Besu version accepts the --node-private-key-file option and the key-related chart values you plan to use. Flags and defaults can change between calendar releases, and removed features are announced in release notes. Check the release notes for every version between your current build and your target, and test the exact flags on a non-production node before you rely on them. Note the Besu version in your change record so auditors can match behavior to a release.

Besu releases

Fit with your key management policy

A plaintext key file is a stored secret, and the Besu documentation states that the local node private key file is not encrypted. Ask your security team whether a file protected by filesystem permissions and volume controls meets your internal key management policy, including protection at rest, access logging and separation of duties. Record the decision and the compensating controls you chose, since an assessor will ask how the key is protected.

Secret store sync and rotation

If a cloud secret store supplies the key to Kubernetes nodes, confirm how the secret reaches the pod, how often it syncs, and whether a change restarts the node. Decide who approves rotation and how the old key is retired. A rotated node key changes the node identity, so plan the enode update and the peer list change in the same window. Test a rotation in a non-production network before the first real change.

Need for hardware-backed storage later

Plan for the possibility that a regulator, customer or internal policy will require hardware-backed key storage later. Besu supports security module plugins through the --security-module option, so ask whether your key file location, backup routine and pre-generated key process can move to an HSM without changing the node identity. Confirm this with the plugin documentation for your Besu version rather than assuming the migration is simple.

Relationship to the enode list

Other validators and bootnodes hold the enode URL of each node, and that URL contains the public key derived from the node private key. Before you pre-generate keys, decide who collects the public keys, who signs off the enode list and how changes reach every operator. Confirm that a key file change is treated as a change to the network configuration, not as a local restart, so peers do not reject the node.

Backups of the key and its location

Confirm where the key file is backed up, who can restore it and how fast a restore can happen when a volume fails. A backup copy of the key is as sensitive as the live copy, so store it under the same access controls. Also check that a restored key brings the node back with the same identity, which keeps the enode list valid.

Questions buyers ask before deciding on file-based node keys

Can we protect a Besu node key without an HSM?

Yes, but the protection is operational rather than cryptographic. Besu's documentation states that the local node private key file is not encrypted, so the key is only as safe as the controls around the file: where it lives, who can read it, how the host is hardened and how access is logged. A separate volume, restrictive file permissions, a custom key location set with --node-private-key-file and a dedicated service account reduce exposure considerably. Whether that meets your risk appetite and your auditor's expectations is a decision to confirm with your compliance team before you commit to the design.

What drives the effort of protecting node key files?

The effort depends mostly on how many nodes you run, how your hosts are managed today and how much of the control set you already own. The main drivers are:

  • Host and volume design: separate volumes, ownership and permissions for each node, and whether these are enforced by configuration management.
  • Platform: bare metal or VMs with a known host baseline is simpler than a mixed estate, and Kubernetes adds secret handling and storage choices.
  • Evidence: the logs, access reviews and documented procedures an assessor will ask for.
  • Testing: confirming that Besu starts with the intended key, that the enode is stable and that unauthorized users cannot read the file.

Ask any partner to show how each driver is estimated in a written scope.

What do we need to provide before a file-based key setup starts?

You need to provide access to the environment and the people who own it. Typically that means the list of nodes and their roles, the hosts or cluster where they run, the storage and backup platform, your privileged access process, and the logging and monitoring tools you already use. You should also provide your key management policy, any existing control framework mapping, and the change approval path for production. If the work touches Kubernetes, provide the cluster version, the secret store you intend to use and the identity provider for workload access. Confirm the exact list with the partner in writing before work starts.

Can our own team set up protected node key files?

Often yes, provided your team is comfortable with Linux permissions, Besu configuration and change control. The configuration itself is small: set the key location, create the key or copy in a pre-generated one and confirm the node starts with it. The harder parts are consistent enforcement across every node, documenting the procedure, testing recovery and producing evidence. If your team lacks capacity or has not run a permissioned network before, an outside partner can design the pattern, build it once and hand over the runbook. Either way, decide ownership of key generation, backup and replacement explicitly.

How do we rotate or replace a Besu node key?

Replacing a node key changes its public key, and therefore its enode URL, so every peer that lists the old enode must be updated. Plan the change as a coordinated network event: generate or import the new key, stop the node, replace the key file, restart it and update the static or permissioned peer lists on the other nodes. Keep the old key securely until the change is verified, then destroy it according to policy. Confirm with the Besu documentation how your version handles peer discovery and permissions during the transition, and test the procedure on a non-production network first.

Does a cloud secret store remove the need for an HSM?

Not necessarily. A cloud secret store protects the key at rest and controls access through identity, which is a real improvement over a plain file, but it does not make the key hardware-bound. Besu's Kubernetes production charts can use cloud native services, such as Secrets Manager with IAM on AWS or Key Vault with Managed Identities on Azure, when you set cloudNativeServices: true. Whether that satisfies your regulator or internal policy on key custody is a question for your compliance and security teams. Confirm the provider's key protection options and your policy requirements before choosing this route.

When should we move from key files to an HSM plugin?

Move when your policy, your auditor or your risk assessment requires hardware-backed storage for node keys, or when the network carries value that the file controls cannot justify. Besu documents a security module plugin, such as the Besu HSM plugin used with the --security-module option, for deployments that need hardware-backed key storage. Plan the move early because it changes key creation, start-up and recovery procedures. Confirm supported HSM models and provider options with the plugin's documentation and your HSM vendor before you select hardware.

How the key file reaches the node

The key starts in one of two places: a secret store that a Kubernetes deployment reads at pod start, or a file generated offline on a controlled workstation. Either way it lands in a restricted volume that the Besu process reads through --node-private-key-file. Besu does not encrypt this file at rest, so the volume boundary, file permissions and access to the secret store carry the protection. The enode advertised to peers is derived from the public key, so check that it matches the value you registered before go-live.

Key file path from secret store or offline generation to the advertised enode.

How DeployOpen scopes and delivers node key protection

DeployOpen plans and implements Besu node key file protection inside the infrastructure you control, from key location and file permissions to the secret store used by Kubernetes deployments. The written scope sets which nodes, volumes and secret stores are covered, and the handover shows your team how each key is stored, rotated and restored.

How we scope

  • Inventory every validator and bootnode, its current key file path, and the volume and host it runs on.
  • Confirm whether the target is bare metal, virtual machines or Kubernetes, since each changes where the key file can live.
  • Agree in writing which key locations, permission models, pre-generated enodes and secret store integrations are in the fixed scope.

How we build

  • Move node key files to a dedicated path set with --node-private-key-file, separate from the data directory and its backups.
  • Apply restrictive ownership and file permissions, and mount key volumes separately so they are not swept into routine data copies.
  • Pre-generate keys and record the resulting enode URLs, then test that each node restarts with the same identity and peers reconnect.

How we hand over

  • Deliver a written record of key paths, owners, permissions, enode URLs and where each key backup is held.
  • Document the procedure for restoring a node key onto a replacement host without changing its enode identity.
  • Walk your platform and security teams through the runbook and the checks they should repeat after every node change.

How we support

  • Offer ongoing support and upgrade work as a retainer, covering key handling changes that follow Besu release updates.
  • Re-test file permissions and key access after host, image or cluster changes, and after staff or access-policy changes.
  • Confirm with your team which recurring reviews and evidence your compliance function expects for key custody on your network.

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.