hello good day.
i have already setup the connection_throttle parameters in my environment, but it does not work as expected.
I did a test to simulate concurrent login attempts from the same IP address. I created a script that performs 16 failed login attempts and executed it simultaneously in 5 different PowerShell windows (with slight delays between them).
my configuration:
connection_throttle.bucket_limit = 3
connection_throttle.enable = ON
connection_throttle.factor_bias = 0.1
connection_throttle.hash_entries_max = 10
connection_throttle.reset_time = 5000
connection_throttle.restore_factor = 1
connection_throttle.update_time = 1000
Despite the simulation, I did not observe the expected error: connection throttled from IP address "%s": too many login attempts
log output:
Failed Attempt 3: Failed
psql: error: connection to server at "ys-testing.postgres.database.azure.com" (XXX.XXX.XXX.200), port 5432 failed: FATAL: password authentication failed for user "XXXXXXXeah@ys-testing"
Failed Attempt 5: Failed
psql: error: connection to server at "ys-testing.postgres.database.azure.com" (XXX.XXX.XXX.200), port 5432 failed: FATAL: password authentication failed for user "XXXXXXXeah@ys-testing"
Failed Attempt 7: Failed
psql: error: connection to server at "ys-testing.postgres.database.azure.com" (XXX.XXX.XXX.200), port 5432 failed: FATAL: password authentication failed for user "XXXXXXXeah@ys-testing"
Successful Attempt 1: Failed
psql: error: connection to server at "ys-testing.postgres.database.azure.com" (XXX.XXX.XXX.200), port 5432 failed: FATAL: password authentication failed for user "XXXXXXXeah@ys-testing"
Failed Attempt 2: Failed
psql: error: connection to server at "ys-testing.postgres.database.azure.com" (XXX.XXX.XXX.200), port 5432 failed: FATAL: password authentication failed for user "XXXXXXXeah@ys-testing"
Failed Attempt 4: Failed
psql: error: connection to server at "ys-testing.postgres.database.azure.com" (XXX.XXX.XXX.200), port 5432 failed: FATAL: password authentication failed for user "XXXXXXXeah@ys-testing"
Failed Attempt 1: Failed
psql: error: connection to server at "ys-testing.postgres.database.azure.com" (XXX.XXX.XXX.200), port 5432 failed: FATAL: password authentication failed for user "XXXXXXXeah@ys-testing"
Failed Attempt 6: Failed
psql: error: connection to server at "ys-testing.postgres.database.azure.com" (XXX.XXX.XXX.200), port 5432 failed: FATAL: password authentication failed for user "XXXXXXXeah@ys-testing"
Failed Attempt 8: Failed
psql: error: connection to server at "ys-testing.postgres.database.azure.com" (XXX.XXX.XXX.200), port 5432 failed: FATAL: password authentication failed for user "XXXXXXXeah@ys-testing"
Failed Attempt 3: Failed
psql: error: connection to server at "ys-testing.postgres.database.azure.com" (XXX.XXX.XXX.200), port 5432 failed: FATAL: password authentication failed for user "XXXXXXXeah@ys-testing"
Failed Attempt 5: Failed
psql: error: connection to server at "ys-testing.postgres.database.azure.com" (XXX.XXX.XXX.200), port 5432 failed: FATAL: password authentication failed for user "XXXXXXXeah@ys-testing"
Failed Attempt 2: Failed
psql: error: connection to server at "ys-testing.postgres.database.azure.com" (XXX.XXX.XXX.200), port 5432 failed: FATAL: password authentication failed for user "XXXXXXXeah@ys-testing"
Failed Attempt 7: Failed
psql: error: connection to server at "ys-testing.postgres.database.azure.com" (XXX.XXX.XXX.200), port 5432 failed: FATAL: password authentication failed for user "XXXXXXXeah@ys-testing"
Failed Attempt 9: Failed
psql: error: connection to server at "ys-testing.postgres.database.azure.com" (XXX.XXX.XXX.200), port 5432 failed: FATAL: password authentication failed for user "XXXXXXXeah@ys-testing"
Failed Attempt 4: Failed
psql: error: connection to server at "ys-testing.postgres.database.azure.com" (XXX.XXX.XXX.200), port 5432 failed: FATAL: password authentication failed for user "XXXXXXXeah@ys-testing"
Failed Attempt 6: Failed
psql: error: connection to server at "ys-testing.postgres.database.azure.com" (XXX.XXX.XXX.200), port 5432 failed: FATAL: password authentication failed for user "XXXXXXXeah@ys-testing"
Failed Attempt 3: Failed
psql: error: connection to server at "ys-testing.postgres.database.azure.com" (XXX.XXX.XXX.200), port 5432 failed: FATAL: password authentication failed for user "XXXXXXXeah@ys-testing"
Failed Attempt 8: Failed
psql: error: connection to server at "ys-testing.postgres.database.azure.com" (XXX.XXX.XXX.200), port 5432 failed: FATAL: password authentication failed for user "XXXXXXXeah@ys-testing"
Failed Attempt 10: Failed
psql: error: connection to server at "ys-testing.postgres.database.azure.com" (XXX.XXX.XXX.200), port 5432 failed: FATAL: password authentication failed for user "XXXXXXXeah@ys-testing"
Failed Attempt 5: Failed
psql: error: connection to server at "ys-testing.postgres.database.azure.com" (XXX.XXX.XXX.200), port 5432 failed: FATAL: password authentication failed for user "XXXXXXXeah@ys-testing"
Failed Attempt 7: Failed
psql: error: connection to server at "ys-testing.postgres.database.azure.com" (XXX.XXX.XXX.200), port 5432 failed: FATAL: password authentication failed for user "XXXXXXXeah@ys-testing"
Failed Attempt 4: Failed
psql: error: connection to server at "ys-testing.postgres.database.azure.com" (XXX.XXX.XXX.200), port 5432 failed: FATAL: password authentication failed for user "XXXXXXXeah@ys-testing"
Failed Attempt 9: Failed
psql: error: connection to server at "ys-testing.postgres.database.azure.com" (XXX.XXX.XXX.200), port 5432 failed: FATAL: password authentication failed for user "XXXXXXXeah@ys-testing"
Failed Attempt 11: Failed
psql: error: connection to server at "ys-testing.postgres.database.azure.com" (XXX.XXX.XXX.200), port 5432 failed: FATAL: password authentication failed for user "XXXXXXXeah@ys-testing"
Failed Attempt 6: Failed
psql: error: connection to server at "ys-testing.postgres.database.azure.com" (XXX.XXX.XXX.200), port 5432 failed: FATAL: password authentication failed for user "XXXXXXXeah@ys-testing"
Failed Attempt 8: Failed
psql: error: connection to server at "ys-testing.postgres.database.azure.com" (XXX.XXX.XXX.200), port 5432 failed: FATAL: password authentication failed for user "XXXXXXXeah@ys-testing"
Failed Attempt 5: Failed
psql: error: connection to server at "ys-testing.postgres.database.azure.com" (XXX.XXX.XXX.200), port 5432 failed: FATAL: password authentication failed for user "XXXXXXXeah@ys-testing"
Failed Attempt 10: Failed
psql: error: connection to server at "ys-testing.postgres.database.azure.com" (XXX.XXX.XXX.200), port 5432 failed: FATAL: password authentication failed for user "XXXXXXXeah@ys-testing"
Failed Attempt 12: Failed
psql: error: connection to server at "ys-testing.postgres.database.azure.com" (XXX.XXX.XXX.200), port 5432 failed: FATAL: password authentication failed for user "XXXXXXXeah@ys-testing"
Failed Attempt 7: Failed
psql: error: connection to server at "ys-testing.postgres.database.azure.com" (XXX.XXX.XXX.200), port 5432 failed: FATAL: password authentication failed for user "XXXXXXXeah@ys-testing"
Failed Attempt 9: Failed
psql: error: connection to server at "ys-testing.postgres.database.azure.com" (XXX.XXX.XXX.200), port 5432 failed: FATAL: password authentication failed for user "XXXXXXXeah@ys-testing"
Failed Attempt 6: Failed
psql: error: connection to server at "ys-testing.postgres.database.azure.com" (XXX.XXX.XXX.200), port 5432 failed: FATAL: password authentication failed for user "XXXXXXXeah@ys-testing"
Failed Attempt 11: Failed
psql: error: connection to server at "ys-testing.postgres.database.azure.com" (XXX.XXX.XXX.200), port 5432 failed: FATAL: password authentication failed for user "XXXXXXXeah@ys-testing"
Failed Attempt 13: Failed
psql: error: connection to server at "ys-testing.postgres.database.azure.com" (XXX.XXX.XXX.200), port 5432 failed: FATAL: password authentication failed for user "XXXXXXXeah@ys-testing"
Failed Attempt 8: Failed
psql: error: connection to server at "ys-testing.postgres.database.azure.com" (XXX.XXX.XXX.200), port 5432 failed: FATAL: password authentication failed for user "XXXXXXXeah@ys-testing"
Failed Attempt 10: Failed
psql: error: connection to server at "ys-testing.postgres.database.azure.com" (XXX.XXX.XXX.200), port 5432 failed: FATAL: password authentication failed for user "XXXXXXXeah@ys-testing"
Failed Attempt 7: Failed
psql: error: connection to server at "ys-testing.postgres.database.azure.com" (XXX.XXX.XXX.200), port 5432 failed: FATAL: password authentication failed for user "XXXXXXXeah@ys-testing"
Failed Attempt 12: Failed
psql: error: connection to server at "ys-testing.postgres.database.azure.com" (XXX.XXX.XXX.200), port 5432 failed: FATAL: password authentication failed for user "XXXXXXXeah@ys-testing"
Failed Attempt 14: Failed
psql: error: connection to server at "ys-testing.postgres.database.azure.com" (XXX.XXX.XXX.200), port 5432 failed: FATAL: password authentication failed for user "XXXXXXXeah@ys-testing"
Failed Attempt 9: Failed
psql: error: connection to server at "ys-testing.postgres.database.azure.com" (XXX.XXX.XXX.200), port 5432 failed: FATAL: password authentication failed for user "XXXXXXXeah@ys-testing"
Failed Attempt 11: Failed
psql: error: connection to server at "ys-testing.postgres.database.azure.com" (XXX.XXX.XXX.200), port 5432 failed: FATAL: password authentication failed for user "XXXXXXXeah@ys-testing"
Failed Attempt 8: Failed
psql: error: connection to server at "ys-testing.postgres.database.azure.com" (XXX.XXX.XXX.200), port 5432 failed: FATAL: password authentication failed for user "XXXXXXXeah@ys-testing"
Failed Attempt 13: Failed
psql: error: connection to server at "ys-testing.postgres.database.azure.com" (XXX.XXX.XXX.200), port 5432 failed: FATAL: password authentication failed for user "XXXXXXXeah@ys-testing"
Failed Attempt 15: Failed
psql: error: connection to server at "ys-testing.postgres.database.azure.com" (XXX.XXX.XXX.200), port 5432 failed: FATAL: password authentication failed for user "XXXXXXXeah@ys-testing"
Failed Attempt 10: Failed
psql: error: connection to server at "ys-testing.postgres.database.azure.com" (XXX.XXX.XXX.200), port 5432 failed: FATAL: password authentication failed for user "XXXXXXXeah@ys-testing"
Failed Attempt 12: Failed
psql: error: connection to server at "ys-testing.postgres.database.azure.com" (XXX.XXX.XXX.200), port 5432 failed: FATAL: password authentication failed for user "XXXXXXXeah@ys-testing"
Failed Attempt 9: Failed
psql: error: connection to server at "ys-testing.postgres.database.azure.com" (XXX.XXX.XXX.200), port 5432 failed: FATAL: password authentication failed for user "XXXXXXXeah@ys-testing"
Failed Attempt 14: Failed
psql: error: connection to server at "ys-testing.postgres.database.azure.com" (XXX.XXX.XXX.200), port 5432 failed: FATAL: password authentication failed for user "XXXXXXXeah@ys-testing"
Failed Attempt 16: Failed
psql: error: connection to server at "ys-testing.postgres.database.azure.com" (XXX.XXX.XXX.200), port 5432 failed: FATAL: password authentication failed for user "XXXXXXXeah@ys-testing"
Failed Attempt 11: Failed
psql: error: connection to server at "ys-testing.postgres.database.azure.com" (XXX.XXX.XXX.200), port 5432 failed: FATAL: password authentication failed for user "XXXXXXXeah@ys-testing"
Failed Attempt 13: Failed
psql: error: connection to server at "ys-testing.postgres.database.azure.com" (XXX.XXX.XXX.200), port 5432 failed: FATAL: password authentication failed for user "XXXXXXXeah@ys-testing"
Failed Attempt 10: Failed
psql: error: connection to server at "ys-testing.postgres.database.azure.com" (XXX.XXX.XXX.200), port 5432 failed: FATAL: password authentication failed for user "XXXXXXXeah@ys-testing"
Failed Attempt 15: Failed
psql: error: connection to server at "ys-testing.postgres.database.azure.com" (XXX.XXX.XXX.200), port 5432 failed: FATAL: password authentication failed for user "XXXXXXXeah@ys-testing"
Failed Attempt 12: Failed
psql: error: connection to server at "ys-testing.postgres.database.azure.com" (XXX.XXX.XXX.200), port 5432 failed: FATAL: password authentication failed for user "XXXXXXXeah@ys-testing"
Failed Attempt 14: Failed
psql: error: connection to server at "ys-testing.postgres.database.azure.com" (XXX.XXX.XXX.200), port 5432 failed: FATAL: password authentication failed for user "XXXXXXXeah@ys-testing"
Failed Attempt 11: Failed
psql: error: connection to server at "ys-testing.postgres.database.azure.com" (XXX.XXX.XXX.200), port 5432 failed: FATAL: password authentication failed for user "XXXXXXXeah@ys-testing"
Failed Attempt 16: Failed
psql: error: connection to server at "ys-testing.postgres.database.azure.com" (XXX.XXX.XXX.200), port 5432 failed: FATAL: password authentication failed for user "XXXXXXXeah@ys-testing"
Failed Attempt 13: Failed
psql: error: connection to server at "ys-testing.postgres.database.azure.com" (XXX.XXX.XXX.200), port 5432 failed: FATAL: password authentication failed for user "XXXXXXXeah@ys-testing"
Failed Attempt 15: Failed
psql: error: connection to server at "ys-testing.postgres.database.azure.com" (XXX.XXX.XXX.200), port 5432 failed: FATAL: password authentication failed for user "XXXXXXXeah@ys-testing"
Failed Attempt 12: Failed
psql: error: connection to server at "ys-testing.postgres.database.azure.com" (XXX.XXX.XXX.200), port 5432 failed: FATAL: password authentication failed for user "XXXXXXXeah@ys-testing"
Failed Attempt 14: Failed
psql: error: connection to server at "ys-testing.postgres.database.azure.com" (XXX.XXX.XXX.200), port 5432 failed: FATAL: password authentication failed for user "XXXXXXXeah@ys-testing"
Failed Attempt 16: Failed
psql: error: connection to server at "ys-testing.postgres.database.azure.com" (XXX.XXX.XXX.200), port 5432 failed: FATAL: password authentication failed for user "XXXXXXXeah@ys-testing"
Failed Attempt 13: Failed
psql: error: connection to server at "ys-testing.postgres.database.azure.com" (XXX.XXX.XXX.200), port 5432 failed: FATAL: password authentication failed for user "XXXXXXXeah@ys-testing"
Failed Attempt 15: Failed
psql: error: connection to server at "ys-testing.postgres.database.azure.com" (XXX.XXX.XXX.200), port 5432 failed: FATAL: password authentication failed for user "XXXXXXXeah@ys-testing"
Failed Attempt 14: Failed
psql: error: connection to server at "ys-testing.postgres.database.azure.com" (XXX.XXX.XXX.200), port 5432 failed: FATAL: password authentication failed for user "XXXXXXXeah@ys-testing"
Failed Attempt 16: Failed
psql: error: connection to server at "ys-testing.postgres.database.azure.com" (XXX.XXX.XXX.200), port 5432 failed: FATAL: password authentication failed for user "XXXXXXXeah@ys-testing"
Failed Attempt 15: Failed
psql: error: connection to server at "ys-testing.postgres.database.azure.com" (XXX.XXX.XXX.200), port 5432 failed: FATAL: password authentication failed for user "XXXXXXXeah@ys-testing"
Failed Attempt 16: Failed
psql: error: connection to server at "ys-testing.postgres.database.azure.com" (XXX.XXX.XXX.200), port 5432 failed: FATAL: password authentication failed for user "XXXXXXXeah@ys-testing"
After running the script, I manually attempted to log in using psql in one of the PowerShell windows and received the following output:
PS C:\Users\XXXXXXXeah\downloads> C:\Users\XXXXXXXeah\Downloads\Test-ConnectionThrottle.ps1
Test completed. Results saved in ConnectionThrottleTest.log
PS C:\Users\XXXXXXXeah\downloads> psql -h ys-testing.postgres.database.azure.com -p 5432 -U XXXXXXXeah -d postgres
psql: error: connection to server at "ys-testing.postgres.database.azure.com" (XXX.XXX.XXX.200), port 5432 failed: FATAL: password authentication failed for user "XXXXXXXeah"
connection to server at "ys-testing.postgres.database.azure.com" (XXX.XXX.XXX.200), port 5432 failed: FATAL: no pg_hba.conf entry for host "XX.XXX.X.62", user "XXXXXXXeah", database "postgres", no encryption
Microsoft Moderators: Removed PII information from the question
However, when I tried logging manually from a new PowerShell window, the connection was successful:
i can see there are a lot of failed connections in my server on the metrics dashboard and also received a suspected security threat email from Microsoft Defender
ASK: may i know if this is the expected behavior of connection_throttle?
i want to understand how long the temporary throttling lasts. Specifically, will it block all login attempts from that IP address until the bucket is refilled with tokens?
lastly, may i know any recommendations for setting the parameter values, for example in a banking industry. is there any documentation i can refer?
Kindly share your ideas on this. thank you