Source Code Database Credentials

Detects database connection credentials embedded in source code across Java (JDBC), PHP, Perl, Ruby, and Python. Matches database driver connect() calls containing credentials inline. Mirrors Snaffler rules KeepJavaDbConnStrings, KeepPhpDbConnStrings, KeepPerlDbConnStrings, KeepRubyDbConnStrings, KeepPyDbConnStrings.

Type
regex
Engine
boost_regex
Confidence
medium
Confidence justification
Medium confidence: database connect-string patterns are specific but bare connect calls without evidence of inline credentials generate false positives in config scaffolding and unit test mocks. Tiered gating with evidence requirements at 75/85 significantly improves precision.
Jurisdictions
global
Regulations
Criminal Code Act 1995 (Cth)
Frameworks
CIS Controls, ISO 27001, NIST CSF, PCI-DSS
Data categories
credentials, security
Scope
specific
Platform compatibility
Purview: Compatible, GCP DLP: Compatible, Macie: Compatible, Zscaler: Compatible, Palo Alto: Compatible, Netskope: Compatible

Pattern

\.getConnection\("jdbc:[A-Za-z0-9:+.\-]{2,30}

Corroborative evidence keywords

password, passwd, pwd, user, host, dbname, database

Proximity: 300 characters

Should match

Should not match

Known false positives

Collections