fix(snowflake): avoid extraneous attempts (#2057)

Co-authored-by: Dustin Decker <dustin@trufflesec.com>
This commit is contained in:
Richard Gomez 2023-12-19 19:04:08 -05:00 committed by GitHub
parent 97afd570ae
commit 69d5e0c993
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -116,6 +116,10 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
ctx = context.Background()
}
// Disable pool + retries to prevent flooding the server with failed login attemps.
db.SetConnMaxLifetime(time.Second)
db.SetMaxOpenConns(1)
err = db.PingContext(ctx)
if err != nil {
if strings.Contains(err.Error(), "Incorrect username or password was specified") {