mod_c2s_conn_throttle: Reduce log level from error->info
Our general policy is that "error" should never be triggerable by remote
entities, and that it is always about something that requires admin
intervention. This satisfies neither condition.
The "warn" level can be used for unexpected events/behaviour triggered by
remote entities, and this could qualify. However I don't think failed auth
attempts are unexpected enough.
I selected "info" because it is what is also used for other notable session
lifecycle events.
--- a/mod_c2s_conn_throttle/mod_c2s_conn_throttle.lua Thu Dec 07 15:43:47 2023 +0000
+++ b/mod_c2s_conn_throttle/mod_c2s_conn_throttle.lua Thu Dec 07 15:46:50 2023 +0000
@@ -15,7 +15,7 @@
if in_count[session.ip].starttls_c then in_count[session.ip].c = in_count[session.ip].starttls_c else in_count[session.ip].c = in_count[session.ip].c + 1 end
if in_count[session.ip].c > logins_count and time() - in_count[session.ip].t < throttle_time then
- module:log("error", "Exceeded login count for %s, closing connection", session.ip)
+ module:log("info", "Exceeded login count for %s, closing connection", session.ip)
session:close{ condition = "policy-violation", text = "You exceeded the number of connections/logins allowed in "..throttle_time.." seconds, good bye." }
return true
elseif time() - in_count[session.ip].t > throttle_time then