Tools › Entity types

Credentials and secrets

Redact database connection strings from text, JSON, and CSV

Connection strings embed a username and password in the URL itself, which is why they are so often pasted into incident threads. Redactly matches the scheme, the credential pair, and the host together.

Try it on the live API No signup. 2,000 characters, 20 runs per 10 minutes.
Output appears here.

How Redactly detects database connection strings

  • Matched by regex for a supported scheme followed by user:password@host.
  • Covers postgres, postgresql, mysql, mongodb, mongodb+srv, redis, and amqp.
  • The scheme, credentials, and host are replaced together; a trailing path is outside the match.

Why redact database connection strings?

A connection string is usually production access, not a stale sample, and it needs no further exploitation.

Example request

curl -X POST https://api.bitbanger.in/v1/redact \
  -H "X-API-Key: rdct_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{"text": "DATABASE_URL=postgres://app:s3cr3t-pass@db.internal.example.com:5432/prod", "style": "replace"}'

Every hit in the response carries entity, text, start, and end. The offsets index into the text you sent, so you can apply the redactions to your own copy of the document. The full response schema is in the API reference.

Questions

Does Redactly redact database connection strings automatically?

Yes. Send text to the API and every detected type is redacted, including database connection strings. To redact only this type, pass the value credential.connection_string in the entities filter. No training or configuration is required.

What happens to database connection strings after redaction?

With style set to replace, each match becomes [credential.connection_string] — the entity type in square brackets. Setting style to mask replaces every character with a block character, and remove deletes the span entirely.

Related entity types

Redact database connection strings in production

Get an API key and send your first request in a minute. Plans start at $24/month.

See pricing