Key custody and operational security for chain infrastructure

Tier keys by what losing them costs, keep hot keys narrow and low-value behind a signer, and write the compromise playbook before you need it.

Read the briefing
About 3 min to read 7 drills

What to remember

  1. Mixing tiers on one host is the fatal design. Withdrawal credentials 'temporarily' beside a signing key turns any compromise into a permanent loss.
  2. A remote signer means the node never holds the key. Compromising the node buys policy-limited signature requests, not the key.
  3. Identity-based host access, audited off-host. Short-lived SSH certificates, no shared accounts, auditd shipped in seconds.
  4. No auto-update on key-holding hosts. An unattended upgrade is remote code execution you scheduled yourself.
  5. Bound the loss in advance. Value caps and narrow policy are what make a compromise an incident rather than an ending.

The big picture

On chain infrastructure the credential is the asset: a leaked signing key is not an access-control incident, it is a direct loss of funds or of stake. This topic covers custody tiers, remote signing, host access control that assumes compromise, binary supply chain, and a key-compromise playbook written before it is needed.

The mental model

Tier by what losing it costs, then bound each tier: hot keys can sign only narrow message types under policy and audit; warm keys need approval; cold keys need quorum and hardware. Assume any host can be compromised, and ask what the attacker gets. If the answer is "everything", the tiering is wrong.

In depth

Custody tiers and remote signing

Hot keys sign continuously (validator signing keys, relayer or bot keys). They belong behind a remote signer or HSM, with policy limits (allowed message types, rate, slashing protection) and full audit, and they should control as little value as possible. Warm keys perform occasional operational actions (deploying a contract, rotating an operator address) and belong behind an approval workflow with named humans. Cold keys hold value or control (withdrawal credentials, treasury, upgrade admin) and belong in multisig with hardware wallets and a documented quorum, geographically separated, never on an internet-connected host.

The single most common design error is mixing tiers on one machine, for example withdrawal credentials sitting on the validator host "temporarily". Remote signing is what makes hot keys survivable: the workload asks for a signature over an authenticated channel, the signer holds the key, enforces policy, and logs every request, so compromising the node yields the ability to request signatures under policy rather than the key itself.

Host access and supply chain

Access to key-holding hosts is identity-based and audited: short-lived SSH certificates issued from an SSO-backed CA (no long-lived authorized_keys), no shared accounts, no direct internet-facing SSH, bastions with ProxyJump and no agent forwarding, sudo restricted to fixed-argument wrappers, and auditd watches on key directories and sudoers shipped off-host in real time so a root-level attacker cannot erase the trail. Break-glass access exists, is logged and session-recorded, and is tested.

Supply chain is the underrated half. A malicious or backdoored client binary on a key-holding host is a total loss, so binaries and images are pinned by digest and verified against the project's published checksums or signatures before deployment, builds come from a trusted pipeline, and auto-update is disabled on validators: an unattended upgrade is remote code execution you scheduled yourself. The same applies to container base images, CI actions, and any operator tooling that touches keys.

Assume compromise: detection and the playbook

Design so that a compromise is detected and bounded. Detection: immutable, off-host audit of every signature request and every key-file access, alerts on anomalies (a signer request from an unexpected host, an unusual message type, access outside normal hours), file-integrity monitoring, and periodic access reviews against the roster.

The playbook is written in advance and rehearsed: what is rotated and in what order; how validators are migrated or exited without ever running two signers; how funds are moved from a compromised warm key (including the fact that on-chain you may be racing an attacker, so rehearse the transaction); who is notified, internally, customers, and counterparties; what evidence is preserved before hosts are rebuilt; and what the pre-agreed authority is to act at 3 a.m. without waiting for a committee. Bounding the blast radius in advance, through tiering, narrow permissions, and value limits, is what turns a compromise from an extinction event into an incident.

Myths and facts

Myth: Encrypted keystores on disk are enough because the password is in a secrets manager.

Fact: The workload decrypts them into memory on a host you must assume can be compromised; remote signing keeps the key out of that host entirely.

Myth: Withdrawal keys can live on the validator host if permissions are tight.

Fact: Mixing custody tiers is the error; withdrawal credentials belong cold and separate, ideally multisig.

Myth: Auto-updating node clients keeps us patched and safe.

Fact: On key-holding hosts it is unattended code execution; pin digests, verify signatures, and upgrade deliberately.

Myth: If we log everything we will know about a compromise.

Fact: Only if logs are immutable and off-host with alerts; an attacker with root edits local logs.

Myth: A key-compromise plan can be written when it happens.

Fact: You will be racing an attacker on-chain; the ordering of rotations, exits, and notifications must be rehearsed.

How pros do it

  • Tier keys by loss impact and never mix tiers on one host; keep hot keys controlling as little value as possible.
  • Put hot keys behind a remote signer or HSM with policy limits and per-signature audit.
  • Identity-based host access: short-lived SSH certificates, bastions without agent forwarding, fixed-command sudo, auditd shipped off-host.
  • Pin and verify binaries and images by digest/signature; no auto-update on key-holding hosts.
  • Write and rehearse the key-compromise playbook, including rotation order, exit procedure, notifications, and evidence preservation.

Questions people ask

What do we do first if we suspect a key leak?

Act as if it is real and give the rehearsed order: contain (cut funding paths and access), rotate or exit, move value, notify, preserve evidence, and only then investigate how it leaked. Interviewers are listening for containment before curiosity.

What is the first question a counterparty asks about our staking setup?

Where the signing keys live, what enforces that only one process can sign, and who can access the hosts, with evidence. Answer it the way you would in that meeting: worst-case exposure from one compromised host first, then the mechanisms.

Do we need an HSM or is a software remote signer enough?

A software signer with strong host controls covers most operational risk; HSMs raise the bar for key extraction and become usual once the stake is large or a counterparty requires it. Say which you would start with and what would make you upgrade.

How should operator bots hold funds?

Minimum working balance in a hot key, automated top-up from a warm tier with a rate cap, and alerts on unexpected outflows; never treasury balances on a bot key. The phrase to use is 'bound the loss in advance'.

How do we rotate a validator signing key?

On Ethereum you generally exit and re-deposit rather than rotate a signing key in place; describe the timeline and say explicitly that old and new signers never run concurrently.

Further reading

Drills · 7

Answer in your head, or out loud, before you reveal. Mark each one: "Again" brings it back, "Got it" counts on your desk.

1 Pick the strongest answer

Which of these custody arrangements would you sign off on for a staking operation, and why?

  1. Validator signing keys in a remote signer with policy limits; withdrawal credentials in a hardware-wallet multisig held offline by separate people; a small hot balance for the fee-payer bot with automated top-up. Each tier is separated by loss impact, with the hot tier controlling minimal value.
  2. All keys in the same encrypted keystore on the validator host, with tight file permissions and a strong password. Compromising that host yields everything; tiers exist precisely to avoid this.
  3. Keys on a hardware wallet plugged into the validator host so signing is always available. A permanently connected hardware wallet on an internet-facing host loses much of its benefit; use a remote signer for hot signing.
  4. Signing and withdrawal keys in the cloud secrets manager, fetched by the validator at start-up. A secrets manager improves access control and audit but still puts withdrawal credentials within reach of a compromised workload.
In short

Signing keys in a remote signer, withdrawal credentials in an offline hardware multisig, and a small hot balance for the bot.

Why

The test is: if this host is fully compromised, what does the attacker get? With correct tiering the answer is "the ability to request policy-limited signatures", not "the stake and the treasury".

The common mistake

Treating a secrets manager, tight file permissions, or an always-connected hardware wallet as tiering. Each still leaves the coldest credential within reach of a compromised workload.

Read the docs

2 Scenario: what do you do next?

At 02:10 an alert fires: an unexpected process on a relayer host read the hot wallet's key file, and 4 ETH has left that address to an unknown destination. The hot wallet holds 20 ETH and is topped up automatically from a warm wallet holding 400 ETH.

Step 1. First actions, in order?

  1. Assume compromise: stop the automated top-up immediately, sweep the remaining hot balance to a safe address, isolate the host from the network while preserving its state for forensics, and start the compromise playbook including notifications. Cut the funding path first (it would keep feeding the attacker), then save what is left, then preserve evidence.
  2. Investigate how the process got there before touching anything. The automated top-up would keep sending funds to a compromised key while you investigate.
  3. Rotate the warm wallet key first. The warm key is not known to be compromised; the immediate bleed is the hot wallet and its top-up.
  4. Power off the host immediately. Loses volatile evidence and may not be necessary if network isolation stops the harm; isolate rather than destroy.

Step 2. Bleeding stopped, 16 ETH saved. What next, and what do you tell people?

  1. Restore the host from a snapshot taken last week and continue. The snapshot may contain the compromise, and the key is burned regardless.
  2. Rebuild the relayer from known-good artifacts with a new key, verify the binary supply chain, review the warm wallet's exposure and rotate if any credential touched that host, and notify internally and any affected counterparties with the facts, the amount lost, and what has been contained. Recovery on clean foundations, exposure analysis by credential path, and honest, factual communication.
  3. Say nothing publicly since the loss is small. Counterparties whose funds or operations touched that host need to know; silence is discovered later and costs more.
  4. Move all remaining funds to the hot wallet's replacement on the same host. Reuses an untrusted host and re-concentrates value in the hot tier.

Step 3. Postmortem mechanisms?

  1. Require two engineers to approve every relayer transaction. Impractical for an automated relayer; bound value and use policy limits instead.
  2. Cap hot-wallet balance and top-up rate to a bounded loss, move relayer signing behind a signer with policy limits, per-person access with auditd shipping off-host, digest-pinned verified binaries, alerts on unexpected outflows and on key-file reads, and a rehearsed playbook with pre-agreed authority to act. Bounds the blast radius, removes the key from the host, and makes detection and response fast by design.
  3. Add a firewall rule blocking the attacker's IP. Addresses one indicator, not the class.
In short

Stop the automatic top-up first, then sweep the remaining balance, then isolate the host without wiping its evidence.

Why

The pattern interviewers want: stop the funding path before anything else, save what can be saved, preserve evidence without destroying it, rebuild on clean foundations, communicate honestly, and convert the loss into value caps, policy-limited signing, and detection.

The common mistake

Investigating before containing, or powering the host off. The automated top-up keeps feeding the attacker while you look, and a hard power-off destroys the volatile evidence you need.

Read the docs

3 Pick the strongest answer

Why do experienced operators turn off automatic updates for node client binaries on validator hosts?

  1. Because bandwidth on validator hosts is limited. Not a real constraint.
  2. Because updates always break consensus compatibility. Some do, but the security argument is the primary one.
  3. Because the client cannot be restarted safely. Restarts are routine when done with the one-signer rule respected.
  4. An unattended update is unreviewed code execution on a key-holding host; combined with a compromised release channel it is a direct path to key theft. Upgrades should be pinned by digest, signature-verified, canaried, and deliberate. Supply chain is the highest-leverage attack on key-holding infrastructure.
In short

An unattended update is unreviewed code running on a key-holding host; pin, verify, canary, and upgrade on purpose.

Why

The controls are pinning by digest, verifying the project's published signatures or checksums before deploy, canarying, and doing upgrades on your schedule (which fork deadlines constrain, but do not remove).

Read the docs

4 Find what's broken

This host is a total loss waiting to happen. Which four lines make it one?

# host: validator-prod-04 (inventory excerpt)
files:
  /var/lib/validator/{keys/*.json,password.txt}   mode 0644 owner validator
  /root/withdrawal-mnemonic.txt                    mode 0600 owner root
services:
  validator: { user: validator }
  node_exporter: { user: nobody }
access: { ssh: shared "ops" authorized key, sudo: "%ops ALL=(ALL) NOPASSWD: ALL" }
audit: { auditd_rules: [], log_shipping: "local files only" }
In short

Line 4 keeps the withdrawal mnemonic on the validator host, line 3 leaves the keys and their password world-readable, line 8 shares one SSH key with full sudo, and line 9 has no audit rules and ships no logs.

What's broken
  • Line 4: Withdrawal mnemonic stored on an internet-facing validator host mixes the coldest custody tier with the hottest workload.
  • Line 3: Keystore files and the password that decrypts them are world-readable (0644), so any process or user on the host can take the signing keys.
  • Line 8: Shared 'ops' SSH key plus passwordless sudo for the whole group means no attribution and no least privilege.
  • Line 9: No auditd rules and local-only logs mean a compromise is neither detected nor reconstructable.
Why

Every one of these is common in real deployments. The tiering violation is the worst because it converts any compromise into a permanent loss; permissions and shared accounts make the compromise easy; missing audit makes it invisible.

Read the docs

5 Answer out loud

A counterparty asks how you protect the keys behind their staked funds. Answer as you would in that meeting: custody model, what a host compromise would and would not give an attacker, supply chain, detection, and what happens if a key leaks. Five to seven sentences.

In short

A strong answer says exactly what an attacker gets from one compromised host: policy-limited signatures, not the stake.

What a strong answer does
  • model: Explicit tiers with what each controls, remote signer/HSM with policy limits, withdrawal credentials in offline multisig, and the compromise question answered directly.
  • controls: Short-lived certificates, no shared accounts, fixed-command sudo, auditd off-host, digest-pinned verified binaries, no auto-update, access reviews.
  • response: Rehearsed playbook with ordering, exit/migration without double signing, value movement, notification commitments, and evidence preservation, plus what bounds the loss in advance.
  • communication: Answers the counterparty's real question (what do I lose in the worst case), is specific, and states residual risk honestly.
Why

Counterparty-facing answers must lead with the worst-case exposure, be specific about mechanisms, and state residual risk; vague reassurance is the failure mode.

6 Quick recall

What does a remote signer give you that an encrypted keystore on the validator host does not?

In short

The key never sits on the node, so a compromised node cannot take it.

Accepted

the key never lives on the node · key separation from the workload · the node cannot read the key

Why

The key stays out of the workload's host: the signer enforces policy and slashing protection centrally and audits every signature request, so compromising a node does not hand over the key.

7 Read the output

What has happened on this host, and what can the audit trail tell you about who did it?

$ ausearch -k keys -ts today | tail -6
type=SYSCALL ... uid=0 auid=4294967295 comm="cat" exe="/usr/bin/cat" key="keys"
  path=/var/lib/validator/keys/keystore-0031.json
type=SYSCALL ... uid=0 auid=4294967295 comm="curl" exe="/usr/bin/curl" key="keys"
$ journalctl -u sshd --since today | grep Accepted | tail -2
Accepted publickey for deploy from 203.0.113.44 port 51122 ssh2: RSA SHA256:9v2...
Accepted publickey for deploy from 203.0.113.44 port 51140 ssh2: RSA SHA256:9v2...
$ getent passwd deploy
deploy:x:1002:1002::/home/deploy:/bin/bash
$ sudo -l -U deploy | tail -1
    (ALL) NOPASSWD: ALL
  1. The logs prove which engineer did it via the SSH key fingerprint. A shared account key can be held by several people or by an attacker; the fingerprint identifies a key, not a person.
  2. Routine maintenance: cat and curl are normal administrative tools. Reading key material and then running curl is the exact pattern the audit rule exists to catch.
  3. A root process outside any login session (auid unset, so a service, timer, or container exec rather than the SSH sessions shown) read a keystore and then ran curl: treat the key as exfiltrated. The SSH trail cannot help with attribution either, because 'deploy' is a shared account with NOPASSWD: ALL, so the fingerprint names a key, not a person. auid=4294967295 means the process never passed through a tagged login; the shared account and NOPASSWD: ALL mean even the logins that did are not attributable. The read plus curl is exfiltration until proven otherwise.
  4. Nothing conclusive; auditd cannot record file reads. The watch clearly recorded the path and the command.
In short

A root process outside any login session read a key file and then ran curl, so treat the key as stolen; the shared deploy account means these logs cannot name a person.

Why

Two findings: a probable key compromise by something running outside a login session (look for a planted unit, timer, or cron job), and a control failure that makes attribution impossible. The response starts with the assumption of compromise (rotate or exit, move value, preserve evidence), and the systemic fix is per-person short-lived certificates, no shared accounts, and fixed-command sudo.

Read the docs

Next lesson RPC fleets: routing by method and height, rate limiting, multi-provider failover, and public endpoints
Drill · Key custody and operational security for chain infrastructure
0:00

Loading…