RHEMS JapanJA

Rethinking SSH Key Distribution and Storage in Operations Design

How widely to distribute SSH private keys, how to store and revoke them, and how to keep usage records. This is not a description of any internal configuration.

Where work over SSH is required, private keys have to be managed across distribution, storage, revocation, and usage records.

This article considers what to organize in operations before adding more keyholders or storage locations.

Managing SSH use

Containerization reduced one category of work: the kind that only becomes clear once you log in to a server. Application state shows up in logs and metrics, and configuration changes stay in Git. The need to log in and check has itself declined.

Exceptional connections should not be left unmanaged either; they belong in the set of procedures you control.

Why key distribution needs review

Keys multiply the moment you treat them as something to hand out. Where they were distributed, where they are stored, when they are revoked, how often they rotate. Each of these needs a register and an operating routine. It is also hard to decide which task proves that no key remains on a departed employee's device.

Account for password reuse and for copies of private keys, and decide how widely credentials are distributed and how they are managed.

Handling entrusted keys

When you receive a key in order to connect to a customer's environment, you still have to decide where it is stored, who may use it, and how it is revoked.

Three storage patterns are common. The key sits on a shared server and everyone uses it. It is placed in ~/.ssh for each task. It is left on each person's own PC. All three are the same in that the key sits in plaintext somewhere it can be copied.

A rule can prohibit it. But a rule cannot stop a copy from being made on disk. Having prohibited something and having prevented it are different things. In this arrangement, answering exactly where and how many copies of a key exist becomes difficult.

Storage and usage permissions

Decide where keys are stored, then manage who may retrieve and use them and keep a history of that use.

You need to verify both that a destination is reachable and that the key may be used.

Aligning procedures and records

Organize the usage procedure and the way destinations are managed so that the connection method does not differ from one worker to the next.

Record which user connected to which destination so that it can be investigated later.

What centralized management still assumes

Even with centralized key management, you have to consider the availability of that system and what happens when it stops.

A centralized key management system is not a cure-all either. A device enrolled in a zero trust platform becomes the root of trust. If that device is compromised, an attacker can perform legitimate operations through the legitimate procedure. That is why device management and multi-factor authentication have to be operated separately.

Narrowing the scope of key distribution still leaves the need to protect stored private keys. Retrieval permissions and usage history have to be checked continuously.

Where the standard procedure cannot be applied, record the reason and the date for review, and manage it there.

Records that explain usage

Record when, who, and where someone connected. Decide which items can be checked during an investigation and how they are stored.

Make both the key retrieval history and the connection history available, as material for explaining usage.

Audit logs exist less for deterrence than for explaining events after the fact. Operations that cannot be explained are not trusted, however strict the rules.

Rather than adding more prohibitions, consider work procedures and permission management together.

Operations design also includes the records that show whether the agreed procedures are being followed.

Manage key distribution, storage, use, and revocation through procedures and records.

How RHEMS Japan can help

RHEMS Japan helps organizations organize key management and connection operations. The scope covers storage and usage permission design, audit logs, and migration procedures.

Start from whether you can avoid distributing keys at all, rather than from how to distribute them. If you are unsure how to handle keys entrusted to you, contact us.

References

OpenSSH ssh(1) manual (public key authentication and private key files)

This article explains approaches to SSH key management and operations design.

  • SSH
  • Zero trust
  • Key management

Was this article useful?

Talk to us about operations for this topic.

Contact