Skip to content

Database Credentials Test Cases

← Back to Test Cases

This page shows 82 test cases that validate Database Credentials patterns.

PolicyTest Case
DATABASE_URLpostgres://user:pass@localhost:5432/mydb
DATABASE_URLmysql://root:password@127.0.0.1:3306/database
DATABASE_URLmongodb://admin:secret123@mongo.example.com:27017/myapp
DATABASE_URLredis://user:pass@redis.example.com:6379/0
DATABASE_URLpostgres://dbuser:complexPass123@db.internal:5432/prod
DATABASE_URLmysql://app:dbpass123@mysql.local:3307/appdb
DATABASE_URLmongodb://user:secret@mongo.local:27017/data
DATABASE_URLredis://cache:token@redis.internal:6380/1
MONGODB_CONNECTION_STRINGmongodb://admin:secret123@mongo.example.com:27017/myapp
MONGODB_CONNECTION_STRINGmongodb+srv://user:pass@cluster0.mongodb.net/test
MONGODB_CONNECTION_STRINGmongodb://dbuser:P@ssw0rd!@mongo.internal:27018/production
MONGODB_CONNECTION_STRINGmongodb+srv://app:token123@cluster1.abcde.mongodb.net/mydb
MONGODB_CONNECTION_STRINGmongodb://root:rootpass@mongo1.example.com:27017,mongo2.example.com:27017/admin
MONGODB_CONNECTION_STRINGmongodb://user:pass@10.0.0.1:27017/database
MONGODB_CONNECTION_STRINGmongodb://readonly:viewer@mongo.example.com:27017/reports?authSource=admin
MONGODB_CONNECTION_STRINGmongodb+srv://analytics:key789@analytics-cluster.mongodb.net/metrics
REDIS_CONNECTION_STRINGredis://user:pass@redis.example.com:6379/0
REDIS_CONNECTION_STRINGrediss://admin:secret@redis.internal:6380/1
REDIS_CONNECTION_STRINGredis://cache:c@cheP@ss@redis.local:6379/2
REDIS_CONNECTION_STRINGrediss://app:token123@redis-cluster.example.com:6380/0
REDIS_CONNECTION_STRINGredis://default:mypassword@10.0.0.5:6379/3
REDIS_CONNECTION_STRINGredis://user:p@ss!word@redis.example.com:6379/0
REDIS_CONNECTION_STRINGrediss://secure:Str0ng!P@ss@secure-redis.internal:6380/1
REDIS_CONNECTION_STRINGredis://session:sess123@session-redis.example.com:6379/5
ELASTICSEARCH_URLhttps://elasticsearch.example.com:9200
ELASTICSEARCH_URLhttp://localhost:9200/index
ELASTICSEARCH_URLhttps://es-cluster.internal:9200/_search
ELASTICSEARCH_URLhttp://10.0.0.10:9200/_cat/indices
ELASTICSEARCH_URLhttps://elastic.example.com:9200/_cluster/health
ELASTICSEARCH_URLhttp://elasticsearch.local:9200/myindex/_doc/1
ELASTICSEARCH_URLhttps://es.prod.example.com:9200/_bulk
ELASTICSEARCH_URLhttp://search.example.com:9200/logs-2024/_search
RABBITMQ_CONNECTION_STRINGamqp://guest:guest@localhost:5672/
RABBITMQ_CONNECTION_STRINGamqps://user:pass@rabbitmq.example.com:5671/vhost
RABBITMQ_CONNECTION_STRINGamqp://admin:P@ssw0rd!@rabbit.internal:5672/production
RABBITMQ_CONNECTION_STRINGamqps://app:secret123@rabbitmq-cluster.example.com:5671/app-vhost
RABBITMQ_CONNECTION_STRINGamqp://mquser:mqpass@10.0.0.20:5672/dev
RABBITMQ_CONNECTION_STRINGamqps://publisher:pub123@rmq.example.com:5671/events
RABBITMQ_CONNECTION_STRINGamqp://consumer:cons456@rabbit.local:5672/tasks
RABBITMQ_CONNECTION_STRINGamqps://service:Str0ng!P@ss@secure-rabbit.internal:5671/services
POSTGRESQL_CONNECTION_STRINGpostgres://user:pass@localhost:5432/mydb
POSTGRESQL_CONNECTION_STRINGpostgresql://admin:u$k9!fR2@qLx2@db:5432/mydb
POSTGRESQL_CONNECTION_STRINGpostgres://dbuser:P@ssw0rd!@pg.internal:5432/production
POSTGRESQL_CONNECTION_STRINGpostgresql://app:dbpass123@postgres.example.com:5433/appdb
POSTGRESQL_CONNECTION_STRINGpostgres://readonly:viewer@10.0.0.30:5432/analytics
POSTGRESQL_CONNECTION_STRINGpostgresql://root:rootpass@pg-primary.local:5432/master
POSTGRESQL_CONNECTION_STRINGpostgres://service:Str0ng!P@ss@postgres-cluster.internal:5432/services
POSTGRESQL_CONNECTION_STRINGpostgresql://analytics:key789@pg.example.com:5432/metrics
MYSQL_CONNECTION_STRINGmysql://root:password@127.0.0.1:3306/database
MYSQL_CONNECTION_STRINGmysql://admin:P@ssw0rd!@mysql.internal:3306/prod
MYSQL_CONNECTION_STRINGmysql://dbuser:dbpass123@mysql.example.com:3307/appdb
MYSQL_CONNECTION_STRINGmysql://app:secret123@mysql-primary.local:3306/application
MYSQL_CONNECTION_STRINGmysql://readonly:viewer@10.0.0.40:3306/analytics
MYSQL_CONNECTION_STRINGmysql://service:Str0ng!P@ss@mysql-cluster.internal:3306/services
MYSQL_CONNECTION_STRINGmysql://webapp:web123@mysql.example.com:3306/webapp_prod
MYSQL_CONNECTION_STRINGmysql://backup:backup789@mysql-replica.local:3306/backupdb
CASSANDRA_CONNECTION_STRINGcassandra://user:pass@cassandra.example.com:9042/keyspace
CASSANDRA_CONNECTION_STRINGcassandra://admin:P@ssw0rd!@cassandra.internal:9042/prod_keyspace
CASSANDRA_CONNECTION_STRINGcassandra://dbuser:secret123@cassandra-cluster.example.com:9042/analytics
CASSANDRA_CONNECTION_STRINGcassandra://app:apppass@10.0.0.50:9042/app_keyspace
CASSANDRA_CONNECTION_STRINGcassandra://readonly:viewer@cassandra.local:9042/metrics
CASSANDRA_CONNECTION_STRINGcassandra://service:Str0ng!P@ss@cassandra-prod.internal:9042/services
CASSANDRA_CONNECTION_STRINGcassandra://webapp:web789@cassandra.example.com:9042/session_store
CASSANDRA_CONNECTION_STRINGcassandra://timeseries:ts123@cassandra-ts.local:9042/timeseries_data
JDBC_CONNECTION_STRINGjdbc:mysql://dbuser:dbpass@localhost:3306/mydb
JDBC_CONNECTION_STRINGjdbc:postgresql://admin:secret123@postgres.example.com:5432/proddb
JDBC_CONNECTION_STRINGjdbc:oracle://oracleuser:oraclepass@oracle.internal:1521/ORCL
JDBC_CONNECTION_STRINGjdbc:sqlserver://sqluser:sqlpass@sqlserver.local:1433/master
JDBC_CONNECTION_STRINGjdbc:mariadb://mariauser:mariapass@mariadb.example.com:3307/webapp
JDBC_CONNECTION_STRINGjdbc:h2://h2user:h2pass@mem:testdb
JDBC_CONNECTION_STRINGjdbc:derby://derbyuser:derbypass@derby.local:1527/sampledb
JDBC_CONNECTION_STRINGjdbc:db2://db2user:db2pass@db2.example.com:50000/testdb
JDBC_CONNECTION_STRINGjdbc:informix://infuser:infpass@informix.local:9088/stores_demo
SMTP_CONNECTION_STRINGsmtp://user:password@smtp.gmail.com:587
SMTP_CONNECTION_STRINGsmtps://admin:secret123@smtp.example.com:465
SMTP_CONNECTION_STRINGsmtp://noreply:mailpass@smtp.sendgrid.net:587
SMTP_CONNECTION_STRINGsmtps://mailuser:mailpass@smtp.office365.com:587
SMTP_CONNECTION_STRINGsmtp://app:apppass123@smtp.mailgun.org:587
SMTP_CONNECTION_STRINGsmtps://service:P@ssw0rd!@smtp.aws.amazon.com:465
SMTP_CONNECTION_STRINGsmtp://contact:contact123@smtp.zoho.com:587
SMTP_CONNECTION_STRINGsmtps://alerts:alert456@smtp.custom.com:465
SMTP_CONNECTION_STRINGsmtp://notifications:n0tify@smtp.internal.local:25