Skip to content

Commit

Permalink
[FIX] sanitize connection.uri for mongo
Browse files Browse the repository at this point in the history
  • Loading branch information
GauravM committed Feb 26, 2024
1 parent 53a6553 commit 8e12da6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ class KafkaConfigSanitizer {
.add(
"basic.auth.user.info", /* For Schema Registry credentials */
"password", "secret", "token", "key", ".*credentials.*", /* General credential patterns */
"aws.access.*", "aws.secret.*", "aws.session.*" /* AWS-related credential patterns */
"aws.access.*", "aws.secret.*", "aws.session.*", /* AWS-related credential patterns */
"connection.uri" /* mongo credential patterns */
)
.build();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ void obfuscateCredentials() {
assertThat(sanitizer.sanitize("aws.secret.access.key", "secret")).isEqualTo("******");
assertThat(sanitizer.sanitize("aws.secretAccessKey", "secret")).isEqualTo("******");
assertThat(sanitizer.sanitize("aws.sessionToken", "secret")).isEqualTo("******");

//Mongo var sanitizing
assertThat(sanitizer.sanitize("connection.uri", "secret")).isEqualTo("******");
}

@Test
Expand Down

0 comments on commit 8e12da6

Please sign in to comment.