Documentation
¶
Overview ¶
Package keyaudit is the one definition of what "dangling" means for a key.
A key can go wrong in seven ways, and each one used to be either undetected or detected differently by whoever happened to look. doctor called a tree clean while listing orphans; a key file with no .pub - the most dangling artifact possible - was skipped by the orphan check precisely because it had no .pub; nothing at all noticed a key the manifest declared but no host used, or an inventory record pointing at a profile that had been deleted. So doctor, `key list`, `show`, `clean` and the notifier all read their answer from here.
Everything is decided from the manifest, the inventory and os.Lstat. Private key material is never read - only public halves, and only to confirm they are public keys.
Index ¶
Constants ¶
const ( // Untracked: a key file under profiles/ that no manifest profile owns. The // tool made it and then lost track of it, or someone put it there. Untracked = "untracked" // Unwired: owned by a profile, referenced by no host, so it is never // rendered as an IdentityFile and never actually used by ssh. Unwired = "unwired" // Missing: the manifest references it, the filesystem does not have it. Missing = "missing" // HalfPair: a private key with no .pub, or a .pub with no private key. HalfPair = "half-pair" // Unrecorded: file and manifest agree, but no inventory record covers it, so // expiry and rotation are blind to it. Unrecorded = "unrecorded" // StaleInventory: a record whose path no manifest key owns any more - it // tracks the expiry of something that is gone. StaleInventory = "stale-inventory" // Loose: a key-shaped file directly under ~/.ssh that no Host block uses. // Reported and offered to `import`, never touched: the tool did not create // it, which is exactly why it is worth mentioning. Loose = "loose" )
The seven states a key can dangle in.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Finding ¶
type Finding struct {
State string
Subject string // "profile/key", a path relative to ~/.ssh, or a fingerprint
Detail string // what is actually wrong, in one clause
Fix string // the command that resolves it, if there is one
}
Finding is one dangling artifact.
type Report ¶
type Report struct {
Findings []Finding
// Strict escalates every state to blocking, for CI - where a warning nobody
// reads is the same as no check at all.
Strict bool
}
Report is everything the audit found.