Add debug log to ssh connection init

This commit is contained in:
Torjus Håkestad 2022-09-28 12:36:16 +02:00
parent 8084362d22
commit e9d2f3581c
No known key found for this signature in database
GPG Key ID: C6FD38B820D295FC

View File

@ -115,6 +115,9 @@ func (hs *HoneypotServer) passwordHandler(ctx sshlib.Context, password string) b
} }
func (s *HoneypotServer) connCallback(ctx sshlib.Context, conn net.Conn) net.Conn { func (s *HoneypotServer) connCallback(ctx sshlib.Context, conn net.Conn) net.Conn {
s.Logger.Debugw("Connection received.", "remote_addr", conn.RemoteAddr())
conn.RemoteAddr()
throttledConn := newThrottledConn(conn) throttledConn := newThrottledConn(conn)
throttledConn.SetSpeed(s.throttleSpeed) throttledConn.SetSpeed(s.throttleSpeed)
ctx.SetValue("uuid", throttledConn.ID) ctx.SetValue("uuid", throttledConn.ID)