Fix bug with throttlespeed in ssh conn

This commit is contained in:
2022-09-28 12:45:55 +02:00
parent e9d2f3581c
commit ca96115fe2
2 changed files with 3 additions and 2 deletions

View File

@@ -60,6 +60,8 @@ func NewHoneypotServer(cfg config.HoneypotConfig, store store.LoginAttemptStore)
hs.sshServer.AddHostKey(signer)
}
hs.throttleSpeed = 1024 * 1024
return &hs, nil
}
@@ -116,7 +118,6 @@ func (hs *HoneypotServer) passwordHandler(ctx sshlib.Context, password string) b
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.SetSpeed(s.throttleSpeed)