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] 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(