feat(ssh): include client IP in connection log#31
Merged
Conversation
The ssh-connect log now reads `user@ip (fingerprint)` instead of `user (fingerprint)`. When multiple hosts share a key (e.g., fleet bootstrap workflow), the IP disambiguates which machine just connected. Port is intentionally omitted — it's ephemeral source port churn that provides no useful signal and would also defeat logbuf dedup for every connection burst. Uses net.SplitHostPort with a fallback to the raw address string for defensive parsing (mrvl:// is always TCP today, but the code doesn't assume).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ssh: client connectedlog line now readsuser@ip (fingerprint)instead ofuser (fingerprint)RemoteAddr().String()ifnet.SplitHostPortfails (defensive; mrvl:// is always TCP today)Motivation
Multiple hosts in the fleet-bootstrap workflow share the same operator key. When one of them connects to a daemon, the log line currently reveals nothing beyond
michael.pursifull (SHA256:...). Adding the IP lets the operator correlate a connection to the machine it came from.Test plan
go build ./...go test ./internal/daemon/...golangci-lint run ./internal/daemon/...(0 issues)go test -race ./...(pre-push hook)user@10.x.x.x (SHA256:...)Observed during testing
While polling Skippy's desk daemon, noticed that PR #26 logbuf dedup doesn't actually collapse Skippy's original
aae-orc-1d2scenario — Go'slog.Printftimestamp prefix (second granularity) is part of the deduplicated string, so identical lines logged in different seconds never match. Filing separately.