Skip to content

Find, verify, and analyze leaked credentials

feat(mongodb): increase timeout to 5 seconds (#3620)

Richard Gomez1e16a2939855
diff --git a/pkg/detectors/mongodb/mongodb.go b/pkg/detectors/mongodb/mongodb.go
index f6e77bac1..290e8c373 100644
--- a/pkg/detectors/mongodb/mongodb.go
+++ b/pkg/detectors/mongodb/mongodb.go
@@ -27,7 +27,7 @@ var _ detectors.Detector = (*Scanner)(nil)
var _ detectors.CustomFalsePositiveChecker = (*Scanner)(nil)
var (
- defaultTimeout = 2 * time.Second
+ defaultTimeout = 5 * time.Second
// Make sure that your group is surrounded in boundary characters such as below to reduce false positives.
connStrPat = regexp.MustCompile(`\b(mongodb(?:\+srv)?://(?P<username>\S{3,50}):(?P<password>\S{3,88})@(?P<host>[-.%\w]+(?::\d{1,5})?(?:,[-.%\w]+(?::\d{1,5})?)*)(?:/(?P<authdb>[\w-]+)?(?P<options>\?\w+=[\w@/.$-]+(?:&(?:amp;)?\w+=[\w@/.$-]+)*)?)?)(?:\b|$)`)
// TODO: Add support for sharded cluster, replica set and Atlas Deployment.