Skip to content

Conversation

@gagik
Copy link
Collaborator

@gagik gagik commented Nov 17, 2025

Introduces a negative condition regex for the taking care of secrets.
I think we might need to update the URI regex too.

@gagik gagik marked this pull request as draft November 17, 2025 12:16
@gagik gagik requested a review from addaleax November 18, 2025 11:21
@gagik gagik marked this pull request as ready for review November 18, 2025 11:21
],

// MongoDB connection strings
[/mongodb(?:\+srv)?:\/\/\S+/gim, '<mongodb uri>'],
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I figured we might as well be very liberal and match any mongodb(+srv):// until we see a whitespace.

Alternatively, we can just redact the credentials by using mongodb-connection-url? I'm currently sticking to this as I guess the idea here is that URI itself is sensitive.

@gagik gagik changed the title chore(mongodb-redact): redact special character cases for password MONGOSH-2991 fix(mongodb-redact): redact special character cases for password MONGOSH-2991 Nov 18, 2025
@gagik gagik merged commit 4e305dd into main Nov 18, 2025
6 of 7 checks passed
@gagik gagik deleted the gagik/fix-redact branch November 18, 2025 15:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants