Skip to content

feat: dev-only peer IP + continent diagnostic log - #35

Open
mikhail-dcl wants to merge 1 commit into
mainfrom
feat/log-peer-ips-dev
Open

feat: dev-only peer IP + continent diagnostic log#35
mikhail-dcl wants to merge 1 commit into
mainfrom
feat/log-peer-ips-dev

Conversation

@mikhail-dcl

Copy link
Copy Markdown
Collaborator

Summary

Diagnostic for the question "does the client's real source IP survive the AWS ingress?" — each connecting ENet peer's observed IP and geo-resolved continent are logged at connect, on dev only:

Peer IP diagnostic: 203.0.113.7:54321 -> region EUROPE (slot=3, peerIndex=17).

Compare the logged IP against the client's actual public IP: if it shows an AWS address instead, the ingress path (VPN/tunnel/relay) is rewriting sources — which also matters beyond metrics, since the per-IP pre-auth cap assumes source fidelity.

How it's gated

No config boolean — the log lives on a dedicated logger category Pulse.Diagnostics.PeerIp (EventId 9101 PeerIpDiagnostic), controlled entirely by standard logging config (per-EventId filtering isn't supported by MEL; a category is the idiomatic equivalent):

Surface Setting
appsettings.json (prod) "Pulse.Diagnostics": "None" — explicit pin; stays off even if Default is raised during an incident
appsettings.Development.json Information
docker-compose.debug.yml Logging__LogLevel__Pulse.Diagnostics: Information
Manual Deploy workflow Information when deployment-environment == 'dev', else None
Dockerfile.dev-debug baked ENV (image only ever deploys to dev)

The IsEnabled guard skips the native Peer.IP call entirely when the category is off; the log fires only after admission checks (refused peers are never logged). Peer IPs are personal data — hence category-gated, default-off, prod-pinned.

The prefix-rule semantics (Pulse.Diagnostics governs the child category; None beats a raised Default; __ env translation with the dotted segment) were verified empirically against MEL, not assumed.

Testing

  • Full suite 449/449 green; build clean.
  • Known follow-up (pre-existing, out of scope): five hardening log sites already emit peer IPs at Warning level in prod — flagged separately for a hash/keep decision.

🤖 Generated with Claude Code

Logs each connecting peer's observed IP and geo-resolved continent under the
Pulse.Diagnostics.PeerIp category (EventId 9101), to verify client source IPs
survive the AWS ingress. Off by default and pinned to None in prod; dev
surfaces opt in via Logging:LogLevel:Pulse.Diagnostics.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant