mirror of
https://github.com/drakkan/sftpgo.git
synced 2025-12-07 23:00:55 +03:00
add a global whitelist
if defined only the listed IPs/networks can access the configured services, all other client connections will be dropped before they even try to authenticate Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
@@ -411,7 +411,7 @@ func canAcceptConnection(ip string) bool {
|
||||
return false
|
||||
}
|
||||
if !common.Connections.IsNewConnectionAllowed(ip) {
|
||||
logger.Log(logger.LevelDebug, common.ProtocolSSH, "", "connection refused, configured limit reached")
|
||||
logger.Log(logger.LevelDebug, common.ProtocolSSH, "", fmt.Sprintf("connection not allowed from ip %#v", ip))
|
||||
return false
|
||||
}
|
||||
_, err := common.LimitRate(common.ProtocolSSH, ip)
|
||||
|
||||
Reference in New Issue
Block a user