Use it when handling automation credentials around SSH Keys. Keep credential owner/purpose, secret value custody, retrieval identity, target privilege, runtime exposure, rotation/revocation and verified rejection as separate proof boundaries.
SSH Keys
SSH Keys used by automation are asymmetric credentials whose safety depends on private-key custody, public-key placement, host trust, algorithm strength, principals/options, rotation and provable removal of obsolete keys.
1. SSH keys for automation: ed25519, per purpose, protected.
2. Prefer SSH certificates with short validity.
3. Restrict with from= and command= where possible.
4. Inventory and remove old keys.
5. Store private keys in vault.
private key/cert → SSH → target authorized
Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
Verification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 Operational evidence path Verify boundary
automation SSH identity → key/certificate issuance → private-key custody → host trust → authorized key/principal restrictions → SSH authentication → command privilege → audit/session evidence → key replacement → old-key removal → rejection test
Healthy evidence: keys are dedicated and fingerprint-inventoried, host identity is verified, private material is tightly protected and obsolete keys are removed and rejected.
Step 2 Failure modes and next checks Narrow the fault
Suspicious evidence: one private key is copied widely, host verification is disabled, authorized_keys contains unknown keys or old fingerprints remain valid after rotation.
SSH-key evidence shows the tested identity/trust path and key lifecycle, but it does not show remote command authorization or host compromise absence.
Step 3 Common mistakes Narrow the fault
- Shared SSH keys.
Step 4 Where it fails Narrow the fault
Where SSH Keys usually goes wrong: host-key identity, authentication, channel/command exit semantics, timeout ambiguity and target verification.
Evidence · 1 on this Topic
Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.
- Private key encrypted ≠ private key access appropriately restricted.
- Public key present ≠ correct account or restrictions applied.
- SSH connection succeeds ≠ host identity verified.
- New key added ≠ old key removed.
ssh-keygen -l -f key.pub— fingerprint/type- SSH CA-signed certificates (ssh-keygen -s) — short-lived certs
- authorized_keys inventory — cleanup
ReferenceWhat it is1 section · depth on demand
Core model
Generate a dedicated keypair or SSH certificate identity for a named automation purpose, protect the private key or signing capability, restrict authorized principals/commands/source where supported, verify host identity, use an agent or ephemeral injection rather than files when possible, and rotate by proving both new access and old-key removal.
ReferenceImportant terms & boundaries2 sections · depth on demand
What this shows and what it does not
SSH Keys owns raw SSH credential handling. Automation Security → SSH Key Management owns governance/hardening across fleets; Security/IAM and platform SSH branches own deeper protocol and host configuration.
In depth
SSH keys authenticate automation to Linux hosts and network devices. Ed25519 keys are the modern default; the private key must be protected and the public key distributed only where needed.
ssh-keygen -t ed25519 -C 'ansible@ctl01' -f ~/.ssh/ansible
# restrict a key on the target
from="10.0.0.5",no-agent-forwarding,no-port-forwarding ssh-ed25519 AAAA... ansible@ctl01
| Practice | Reason |
|---|---|
| Separate keys per automation system | Revocation |
from= restrictions in authorized_keys | Only from the control node |
| SSH certificates (CA-signed, short validity) | Scales better than key lists |
| Inventory of authorised keys | Remove stale access |
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in Secrets & Credentials > SSH Keys. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://cheatsheetseries.owasp.org/cheatsheets/Secrets_Management_Cheat_Sheet.html · confidence 94%Terms & aliases
Hover a linked term for a quick definition; click it to open its glossary entry. Aliases are other names that find this Topic in search.
Quick lookup tables
SSH Keys credential proof-boundary map
Fast identity, handling/execution, effective-outcome and closure proof boundaries for SSH Keys.
| Boundary | Healthy evidence | Suspicious evidence |
|---|---|---|
| Ownership / source | Credential owner, purpose, consumers and authoritative store/issuer are explicit | Shared or orphaned credentials exist outside a controlled source with unclear consumers |
| Retrieval / exposure | Workload retrieves only required material and plaintext exposure is transient and bounded | Secrets leak to source, logs, command lines, artifacts, caches, child processes or unrelated jobs |
| Effective outcome | Target-side authentication/authorization or secure control outcome is independently observed | Tool/job success substitutes for target authorization, effective state or workload proof |
| Closure / next action | Rotation/revocation, denied-path tests, audit evidence and residual exceptions are explicit | Old credentials remain valid, policy bypass exists, audit gaps are unknown or broad success is inferred from one signal |