kingfisher/data/rules/jdbc.yml
Mick Grove 8d77f9d298 - Skip reporting MongoDB and Postgres findings when their connection strings cannot be parsed, even when validation is disabled.
- Improve MySQL detection by broadening URI coverage and adding live validation that skips clearly invalid connection strings.
2025-11-15 08:43:54 -08:00

28 lines
884 B
YAML

rules:
- name: JDBC connection string with embedded credentials
id: kingfisher.jdbc.1
pattern: |
(?xi)
(
jdbc:
[a-z][a-z0-9+.-]{2,32}
(?:[:][a-z0-9+.-]{1,32})*
:
[^\s"'<>,(){}\[\]]{10,448}
)
pattern_requirements:
ignore_if_contains:
- "*****"
- "xxxxx"
min_entropy: 3.3
confidence: medium
validation:
type: Jdbc
examples:
- jdbc:postgresql://db.example.com:5432/app?user=admin&password=s3cr3t
- jdbc:mysql://admin:s3cr3t@prod.internal:3306/inventory
- jdbc:oracle:thin:@ora.example.net:1521/ORCLPDB1
- jdbc:sqlserver://sql.example.org:1433;databaseName=inventory;user=sa;password=s3cr3t!
references:
- https://docs.oracle.com/javase/8/docs/api/java/sql/DriverManager.html
- https://www.postgresql.org/docs/current/jdbc-use.html