Mongodb
Detects Mongodb patterns.
- Type
- regex
- Engine
- universal
- Confidence
- high
- Confidence justification
- High confidence: structurally constrained pattern with corroborative keyword support reduces false positive rates significantly. Added context gating and exclusion rules improve precision and reduce incidental matches.
- Detection quality
- Verified
- Jurisdictions
- global
- Regulations
- Criminal Code Act 1995 (Cth)
- Frameworks
- CIS Controls, ISO 27001, NIST CSF, PCI-DSS, SOC 2
- Data categories
- credentials, security
- Scope
- specific
- Risk rating
- 8
- Platform compatibility
- Purview: Compatible, GCP DLP: Compatible, Macie: Compatible, Zscaler: Compatible, Palo Alto: Compatible, Netskope: Compatible
Pattern
mongodb(\+srv)?://[^:]+:[^@]+@[^/]+
Corroborative evidence keywords
api key, api_key, apikey, access key, secret key, private key, auth token, authorization, access token, bearer, conn str, connection string, connectionstring, cookie, credential, database, host, [object Object], oauth, passphrase (+33 more)
Proximity: 300 characters
Should match
mongodb://user:pass@localhost— Exact 65 probe - complete credential URI without independent config labelingMONGODB_URI=mongodb://app:S3cretValue@db.internal— Exact 75 probe - credential URI in a MongoDB-specific config fieldMongoDB Atlas production MONGODB_URI=mongodb+srv://admin:S3cretValue@cluster.mongodb.net/prod?retryWrites=true— Exact 85 probe - provider config label plus Atlas/topology evidence
Should not match
mongodb://localhost/mydb— Missing credentials (no user:pass@ section)mongo://user:pass@localhost— Wrong scheme (mongo instead of mongodb)mongodb://user@localhost— Missing password in credentialsPOSTGRES_URL=mongodb://user:pass@localhost— Sibling database config label does not corroborate a MongoDB URImongodb://:pass@localhost— Malformed MongoDB URI is missing the usernameDocumentation example: MongoDB Atlas MONGODB_URI=mongodb+srv://admin:changeme@cluster.mongodb.net/example?retryWrites=true— Documentation placeholder with Atlas topology is excludedtemplate example placeholder record identifier— Template/sample context should be excluded even when anchor words are present
Known false positives
- Authentication-related terminology in software documentation, security training materials, or system architecture descriptions without actual credentials. Mitigation: Require proximity to credential-specific patterns (API keys, connection strings, tokens) rather than general security terminology.
- Code snippets and configuration examples containing credential-related keywords or placeholder values in developer documentation. Mitigation: Check for common placeholder patterns (example.com, localhost, 0000) and documentation file types to reduce false positives from technical writing.