From ba8a1b7caf833014bcd604fa61221ec7708bb7e3 Mon Sep 17 00:00:00 2001 From: Xe Iaso Date: Tue, 16 Dec 2025 04:44:59 -0500 Subject: [PATCH] fix(honeypot/naive): right, we want the client IP, not the load balancer IP Signed-off-by: Xe Iaso --- internal/honeypot/naive/naive.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/internal/honeypot/naive/naive.go b/internal/honeypot/naive/naive.go index c6cf242..f62f4ef 100644 --- a/internal/honeypot/naive/naive.go +++ b/internal/honeypot/naive/naive.go @@ -6,7 +6,6 @@ import ( "fmt" "log/slog" "math/rand/v2" - "net" "net/http" "net/netip" "time" @@ -154,8 +153,7 @@ func (i *Impl) ServeHTTP(w http.ResponseWriter, r *http.Request) { realIP, _ := internal.RealIP(r) if !realIP.IsValid() { - host, _, _ := net.SplitHostPort(r.RemoteAddr) - realIP = netip.MustParseAddr(host) + realIP = netip.MustParseAddr(r.Header.Get("X-Real-Ip")) } network, ok := internal.ClampIP(realIP)