Skip to content

feat(ssh): include client IP in connection log#31

Merged
arcaven merged 1 commit intomainfrom
feat/ssh-log-client-ip
Apr 19, 2026
Merged

feat(ssh): include client IP in connection log#31
arcaven merged 1 commit intomainfrom
feat/ssh-log-client-ip

Conversation

@arcaven
Copy link
Copy Markdown
Collaborator

@arcaven arcaven commented Apr 19, 2026

Summary

  • ssh: client connected log line now reads user@ip (fingerprint) instead of user (fingerprint)
  • Ephemeral source port is intentionally dropped — would defeat logbuf dedup for every connection burst and provides no useful operator signal
  • Falls back to raw RemoteAddr().String() if net.SplitHostPort fails (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)
  • Verify against live daemon after deploy — log line reads 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-1d2 scenario — Go's log.Printf timestamp prefix (second granularity) is part of the deduplicated string, so identical lines logged in different seconds never match. Filing separately.

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).
@arcaven arcaven merged commit 8f542ca into main Apr 19, 2026
7 checks passed
@arcaven arcaven added type.feature Net-new capability agent.worker PR created by a Claude Code worker agent area.daemon Daemon lifecycle labels Apr 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent.worker PR created by a Claude Code worker agent area.daemon Daemon lifecycle type.feature Net-new capability

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant