diff --git a/honeypot/store/postgres.go b/honeypot/store/postgres.go index 5876f26..4a33e4c 100644 --- a/honeypot/store/postgres.go +++ b/honeypot/store/postgres.go @@ -73,9 +73,11 @@ func (s *PostgresStore) All() ([]models.LoginAttempt, error) { var attempts []models.LoginAttempt for rows.Next() { var a models.LoginAttempt - if err := rows.Scan(&a.Date, &a.RemoteIP, &a.Username, &a.Password, &a.SSHClientVersion, &a.SSHClientVersion, &a.Country); err != nil { + var ip string + if err := rows.Scan(&a.Date, &ip, &a.Username, &a.Password, &a.SSHClientVersion, &a.SSHClientVersion, &a.Country); err != nil { return nil, err } + a.RemoteIP = net.ParseIP(ip) attempts = append(attempts, a) }