From 3da60f4e68f349dc38819824671f63bfb1385cab Mon Sep 17 00:00:00 2001 From: Scott Beddall <45376673+scbedd@users.noreply.github.com> Date: Tue, 30 Apr 2024 16:03:42 -0700 Subject: [PATCH 1/3] Update tools/test-proxy/Azure.Sdk.Tools.TestProxy/Common/SanitizerDictionary.cs Co-authored-by: Paul Van Eck --- .../Azure.Sdk.Tools.TestProxy/Common/SanitizerDictionary.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/test-proxy/Azure.Sdk.Tools.TestProxy/Common/SanitizerDictionary.cs b/tools/test-proxy/Azure.Sdk.Tools.TestProxy/Common/SanitizerDictionary.cs index d64fd32bc5a..3ced9a62729 100644 --- a/tools/test-proxy/Azure.Sdk.Tools.TestProxy/Common/SanitizerDictionary.cs +++ b/tools/test-proxy/Azure.Sdk.Tools.TestProxy/Common/SanitizerDictionary.cs @@ -98,7 +98,7 @@ public SanitizerDictionary() { "ACS Identity leverages these strings to store identity information." ), new RegisteredSanitizer( - new GeneralRegexSanitizer(regex: "(?:[?&](sv|sig|se|srt|ss|sp)=)(?[^&\\\"\\s]*)", groupForReplace: "secret"), + new GeneralRegexSanitizer(regex: "(?:[?&](sv|sig|se|srt|ss|sp|st)=)(?[^&\\\"\\s]*)", groupForReplace: "secret"), "AZSDK1007", "Common SAS URL Sanitizer. Applies to all headers, URIs, and text bodies." ), From eecb65ad31d4e37d5af9c973ca520955465af845 Mon Sep 17 00:00:00 2001 From: "Scott Beddall (from Dev Box)" Date: Wed, 1 May 2024 14:29:38 -0700 Subject: [PATCH 2/3] adjust default sanitizers --- .../Common/SanitizerDictionary.cs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tools/test-proxy/Azure.Sdk.Tools.TestProxy/Common/SanitizerDictionary.cs b/tools/test-proxy/Azure.Sdk.Tools.TestProxy/Common/SanitizerDictionary.cs index 3ced9a62729..1bf01cd3024 100644 --- a/tools/test-proxy/Azure.Sdk.Tools.TestProxy/Common/SanitizerDictionary.cs +++ b/tools/test-proxy/Azure.Sdk.Tools.TestProxy/Common/SanitizerDictionary.cs @@ -58,6 +58,7 @@ public SanitizerDictionary() { * */ private const string EMPTYGUID = "00000000-0000-0000-0000-000000000000"; + private const string BASE64ZERO = "MA=="; public List DefaultSanitizerList = new List { @@ -98,7 +99,7 @@ public SanitizerDictionary() { "ACS Identity leverages these strings to store identity information." ), new RegisteredSanitizer( - new GeneralRegexSanitizer(regex: "(?:[?&](sv|sig|se|srt|ss|sp|st)=)(?[^&\\\"\\s]*)", groupForReplace: "secret"), + new GeneralRegexSanitizer(regex: "(?:[?&](sig)=)(?[^&\\\"\\s]*)", groupForReplace: "secret"), "AZSDK1007", "Common SAS URL Sanitizer. Applies to all headers, URIs, and text bodies." ), @@ -243,15 +244,15 @@ public SanitizerDictionary() { "AZSDK3004" ), new RegisteredSanitizer( - new BodyRegexSanitizer(regex: "(?<=).*?(?:)(?.*)(?:)", groupForReplace: "group"), + new BodyRegexSanitizer(regex: "(?<=).*?(?:)(?.*)(?:)", groupForReplace: "group", value: BASE64ZERO), "AZSDK3005" ), new RegisteredSanitizer( - new BodyRegexSanitizer(regex: "(?<=).*?(?:)(?.*)(?:)", groupForReplace: "group"), + new BodyRegexSanitizer(regex: "(?<=).*?(?:)(?.*)(?:)", groupForReplace: "group", value: EMPTYGUID), "AZSDK3006" ), new RegisteredSanitizer( - new BodyRegexSanitizer(regex: "(?<=).*?(?:)(?.*)(?:)", groupForReplace: "group"), + new BodyRegexSanitizer(regex: "(?<=).*?(?:)(?.*)(?:)", groupForReplace: "group", value: EMPTYGUID), "AZSDK3007" ), new RegisteredSanitizer( From 6b051611c681de4fa84836cfad5d472021b6d6d2 Mon Sep 17 00:00:00 2001 From: "Scott Beddall (from Dev Box)" Date: Wed, 1 May 2024 16:39:56 -0700 Subject: [PATCH 3/3] new sanitizer added pre feedback from joshlove --- .../Azure.Sdk.Tools.TestProxy/Common/SanitizerDictionary.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/test-proxy/Azure.Sdk.Tools.TestProxy/Common/SanitizerDictionary.cs b/tools/test-proxy/Azure.Sdk.Tools.TestProxy/Common/SanitizerDictionary.cs index 1bf01cd3024..66a606a8d44 100644 --- a/tools/test-proxy/Azure.Sdk.Tools.TestProxy/Common/SanitizerDictionary.cs +++ b/tools/test-proxy/Azure.Sdk.Tools.TestProxy/Common/SanitizerDictionary.cs @@ -661,6 +661,10 @@ public SanitizerDictionary() { new BodyKeySanitizer("$..resourceLocation"), "AZSDK3496" ), + new RegisteredSanitizer( + new BodyKeySanitizer("$..keyVaultClientId", value: EMPTYGUID), + "AZSDK3497" + ), #endregion #region UriRegex new RegisteredSanitizer(