Ssh Key Inventory
Inventory, assess and safely replace SSH private keys across every host your control account can reach, with an HTML report and per-key remediation advice. WHAT IT DOES
Finds private key files and authorized_keys entries on remote hosts over SSH, fingerprints and deduplicates them, scores each unique key for algorithm, size, age, encryption, permissions and reuse, and renders an HTML report showing where each key lives and where it is authorized. It also upgrades a set of hosts to a specified key by adding, testing, then (only after success) removing the old authorized key, with per-host backup and rollback. Host targets accumulate across runs.
INSTALL
swamp extension pull @svendowideit/ssh-key-inventoryDEPENDENCIES
An OpenSSH client (ssh, ssh-keygen) on the machine running swamp, and SSH access (keys or agent) to the target hosts. No other extension.
RUN
# Register hosts (additive across runs).
swamp model @svendowideit/ssh-key-inventory method run add-hosts ssh-keys \
--input 'hosts:json=["alice@host1.example", "bob@host2.example"]'
# Inventory private keys and authorized keys over SSH.
swamp model @svendowideit/ssh-key-inventory method run inventory ssh-keys
# Write the HTML report.
swamp model @svendowideit/ssh-key-inventory method run report ssh-keys
# Or run the whole sweep workflow.
swamp workflow run @svendowideit/ssh-key-inventory-sweep
# Upgrade selected hosts to a new key (test before removing the old one).
swamp workflow run @svendowideit/ssh-key-upgrade \
--input 'hosts:json=["alice@host1.example"]' \
--input newKey=~/.ssh/id_ed25519_newCONFIGURE
Global arguments (set at creation with --global-arg, or per call with --input):
sshUser Default user for bare host entries (default: current user)
outputDir Where the HTML report is written
connectTimeoutSec SSH connect timeout in seconds (default: 10)
keyPaths Remote directories searched for private keysWHAT IT INSTALLS
Nothing on remote hosts except timestamped authorized_keys backups during upgrade. It writes swamp resources (hosts, inventory, upgrade) and an HTML report locally.
Global Arguments
| Argument | Type | Description |
|---|---|---|
| sshUser? | string | |
| outputDir? | string | |
| connectTimeoutSec? | number | |
| keyPaths? | array | |
| includeLocal? | boolean |
| Argument | Type | Description |
|---|---|---|
| hosts | array |
| Argument | Type | Description |
|---|---|---|
| hosts? | array | |
| includeLocal? | boolean |
| Argument | Type | Description |
|---|---|---|
| outputPath? | string |
| Argument | Type | Description |
|---|---|---|
| hosts | union | |
| newPrivateKeyPath | string | |
| oldFingerprint? | string | |
| testCommand? | string | |
| removeOld? | boolean |
Resources
Inventory SSH keys across known hosts and write an HTML report.
Upgrade selected hosts to a specified SSH key with tested replacement.
Format SSH key inventory results as a human-friendly summary
- Has README or module doc2/2earned
- README has a code example1/1earned
- README is substantive1/1earned
- Most symbols documented1/1earned
- No slow types (deprecated)1/1earned
- Dependencies pass trust audit2/2earned
- Docs keep secrets in a vault1/1earned
- Has description1/1earned
- Platform support declared (or universal)2/2earned
- License2/2earned
- Verified public repository2/2earned