An SSH key inventory is a complete record of keys that exist, where they are used, and who or what owns them. It gives security teams the baseline needed to find orphaned, shared, or stale keys. Without that inventory, access reviews and rotation efforts are usually incomplete and unreliable.
What SSH key inventory actually covers
SSH key inventory is not just a list of files or fingerprints. It is an ownership and exposure record for every SSH key in circulation, including where it lives, which systems trust it, and whether it is tied to a person, an automation account, or a host. That makes the inventory the foundation for answering a simple but critical question: which keys should still exist at all?
A useful inventory distinguishes private keys from public keys, user access keys from host keys, and interactive access from automation use. It also records whether a key is approved, shared, embedded in tooling, or already superseded. That separation matters because SSH access often persists long after the original reason for access has disappeared.
Why SSH key inventory matters for access control
SSH keys are powerful authenticators because possession of the private key can grant direct system access without a password prompt. SSH Key and SSH Certificate Management Guide is the most direct companion for understanding how inventories support rotation, orphan cleanup, and SSH certificate adoption.
Without inventory, teams cannot reliably tell whether a key belongs to a current employee, a contractor, a service, or a forgotten deployment path. That creates blind spots in access reviews, offboarding, and emergency response. It also makes it easy to miss shared keys, stale keys that survived role changes, or keys that were copied into scripts, build systems, and admin workstations.
For environments that rely on certificates rather than static keys, inventory still matters because the organisation must know which trusted users, hosts, and automation flows are covered by certificate-based trust. SSH Protocol and Certificate Authority Guide helps frame how certificate authorities, revocation, and rollout planning fit into the broader SSH trust model.
How organisations build and validate an SSH key inventory
A credible inventory starts with discovery across endpoint, server, cloud, and code repository estates. Teams usually combine host-based checks, platform APIs, configuration review, and repository scanning to find keys that are actually in use rather than only those recorded in a ticketing system. osquery Guide is a practical example of using fleet queries to find SSH keys and other credential material on hosts.
The inventory should then be reconciled against ownership, last use, and business purpose. That means proving whether a key still maps to a real user, a managed automation job, or a system that has not yet been migrated. In cloud environments, it also means checking whether platform defaults have quietly introduced key-based access paths that were never intended. Compute Engine Security Guide shows why metadata SSH keys and project-wide access paths need deliberate governance.
Validation is not a one-time task. SSH key inventory becomes reliable only when it is refreshed after joiner-mover-leaver events, pipeline changes, host rebuilds, and access recertification. That is why GitHub deploy keys, bastion keys, and automation keys should all be treated as inventory items with explicit ownership and review dates. How to find unused GitHub deploy keys and SSH keys is useful for the review-and-removal side of that workflow.
Remediation and lifecycle controls for stale or orphaned keys
Once the inventory exposes stale or orphaned keys, remediation is usually a mix of revocation, replacement, and access redesign. In many cases, the best fix is not simply rotating one key, but moving the use case to a more governable pattern such as short-lived certificates, scoped sudo, or a managed access broker. Unix and Linux Privileged Access Guide connects SSH key governance to broader privileged access control on Unix-like systems.
Lifecycle control also means knowing where SSH keys are reused. A single private key copied across multiple hosts or repositories can turn one compromise into broad lateral movement. Inventory makes reuse visible, and visibility is what allows teams to decide whether to retire the key, split the trust boundary, or replace the access pattern entirely.
When keys are discovered in repositories or images, response should include both revocation and exposure review because the same key may already have been extracted by an attacker or indexed in a build artifact. Private Keys in Repositories Guide is directly relevant to the discovery and response side of that problem.
Detection, review, and monitoring after inventory is established
An inventory only stays useful if it is paired with monitoring for new keys, unusual reuse, and access that no longer matches the recorded owner or purpose. That can include log review, key registration events, access audit trails, and detection of SSH authentication from systems that should not be using keys at all. MITRE ATT&CK T1098 Account Manipulation Guide is relevant because added SSH keys are a common persistence mechanism.
Post-patch or post-incident review should ask whether the inventory missed any keys, whether any compromised systems still trusted old keys, and whether service credentials were rotated where SSH access may have been abused. That is especially important after supply-chain incidents or credential theft events in which keys may have been copied long before detection. CI/CD pipeline exploitation case study and GhostAction returns 2026 both illustrate how stolen credentials and embedded keys can survive until they are actively found and removed.
At the policy level, the inventory should also make it possible to distinguish human use from automation use, because those populations usually need different review cadence, controls, and replacement strategies. When organisations cannot make that distinction, rotation programs tend to fail silently, while access reviews remain incomplete.
Standards & Framework Alignment
This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.
NIST SP 800-53 Rev 5 and CIS Controls v8 set the governance and control requirements practitioners need to meet.
| Framework | Control / Reference | Relevance |
|---|---|---|
| NIST SP 800-53 Rev 5 | IA-5 — Authenticator Management | SSH key inventory tracks SSH authenticators across their lifecycle and ownership. |
| IA-9 — Service Identification and Authentication | SSH inventories must cover service, automation, and host-key trust relationships. | |
| AC-2 — Account Management | SSH key ownership and orphan cleanup depend on accurate account lifecycle records. | |
| Recommendation — Maintain and rotate SSH authenticators with defined ownership and revocation records. Inventory and govern non-human SSH authenticators used by services and automation. Reconcile SSH key ownership to active accounts and remove stale access promptly. | ||
| CIS Controls v8 | CIS-5 — Account Management | SSH key inventories support finding unmanaged accounts and access paths. |
| CIS-6 — Access Control Management | SSH key governance is an access control problem requiring authorised use and review. | |
| Recommendation — Inventory and remove unused SSH access paths tied to dormant or unknown accounts. Enforce access reviews and revocation for SSH keys that no longer have a valid purpose. | ||
Related resources from NHI Mgmt Group
Deepen Your Knowledge
Free weekly newsletter
Subscribe to the NHI & AI Identity Journal
The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.
Bonus 33% off our NHI Course when you subscribe.
Reviewed and updated by the NHIMG editorial team on October 30, 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org