Subscribe to the Non-Human & AI Identity Journal

SSH key lifecycle

The full governance path for an SSH key from creation to revocation. It includes ownership, deployment, rotation, backup handling, and removal from every host that trusts it. In practice, lifecycle control is what makes SSH credentials auditable rather than merely functional.

Expanded Definition

ssh key lifecycle is the governed sequence of generating, approving, distributing, using, rotating, backing up, and revoking an SSH public key and its private counterpart across every system that trusts it. In NHI operations, the lifecycle is what turns a working key into a controlled credential with an owner, purpose, expiry expectation, and removal path. That distinction matters because an SSH key can remain technically valid long after the original use case has changed.

Definitions vary across vendors on whether lifecycle control starts at key creation or earlier at registration and policy assignment, but the practical standard is consistent: if the key cannot be traced to an accountable owner and retired everywhere it was installed, it is not lifecycle-managed. This aligns with the broader NHI governance approach described in the NHI Lifecycle Management Guide and the risk patterns in the OWASP Non-Human Identity Top 10.

The most common misapplication is treating SSH key issuance as lifecycle management, which occurs when teams generate a key pair but never inventory where the private key was copied or where the public key was authorized.

Examples and Use Cases

Implementing SSH key lifecycle rigorously often introduces operational friction, requiring organisations to weigh administrative overhead against a much lower risk of orphaned access and unmanaged privilege.

  • A platform team issues a short-lived SSH key for a maintenance window, records the owner, and removes the key from bastion hosts once the task is complete.
  • An SRE group rotates deploy keys after a pipeline compromise, then confirms the old public key has been removed from all servers and automation accounts.
  • A merger integration team inventories inherited SSH authorized_keys files and maps each key to a business owner before deciding whether it should be retained or revoked.
  • A security team uses the Ultimate Guide to NHIs – Lifecycle Processes for Managing NHIs to align review, rotation, and offboarding steps with the access patterns described in Guide to NHI Rotation Challenges.
  • An engineering org standardises key storage and distribution with guidance from SSH-related controls in the OWASP Non-Human Identity Top 10, then audits for duplicate or stale key material.

In practice, lifecycle discipline is most valuable when keys are embedded in automation, because the blast radius of one forgotten key scales with every host and pipeline that still trusts it.

Why It Matters in NHI Security

SSH keys are often overlooked because they do not trigger interactive login prompts, yet they can function as durable, high-trust credentials across production systems. When lifecycle is weak, a key copied into scripts, jump hosts, or legacy administrative paths can survive personnel changes, project shutdowns, and incident response actions. That is why lifecycle management is central to NHI governance and not merely an inventory exercise.

NHIMG research shows that 71% of NHIs are not rotated within recommended time frames, and 91.6% of secrets remain valid five days after notification, which illustrates how remediation often lags behind discovery. The same pattern applies to SSH keys when removal requires manual cleanup across many hosts. The Top 10 NHI Issues and the Guide to the Secret Sprawl Challenge both point to the same failure mode: credentials spread faster than they are retired.

Organisations typically encounter the business impact only after a compromise, audit finding, or access dispute, at which point SSH key lifecycle becomes operationally unavoidable to address.

Standards & Framework Alignment

This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.

OWASP Non-Human Identity Top 10 address the attack and risk surface, while NIST CSF 2.0 and NIST Zero Trust (SP 800-207) set the governance and control requirements practitioners need to meet.

Framework Control / Reference Relevance
OWASP Non-Human Identity Top 10 NHI-02 Covers secret exposure, rotation, and lifecycle failures for non-human credentials.
NIST CSF 2.0 PR.AC-1 Access control requires credentials to be issued, managed, and removed under policy.
NIST Zero Trust (SP 800-207) MAP Zero trust depends on knowing every credential and its trust relationships.

Inventory SSH keys, remove stale copies, and enforce rotation and revocation across all hosts.