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 de36c512d45..c8cf6e7e8ec 100644 --- a/tools/test-proxy/Azure.Sdk.Tools.TestProxy/Common/SanitizerDictionary.cs +++ b/tools/test-proxy/Azure.Sdk.Tools.TestProxy/Common/SanitizerDictionary.cs @@ -97,131 +97,128 @@ public SanitizerDictionary() { "AZSDK1006", "ACS Identity leverages these strings to store identity information." ), + new RegisteredSanitizer( + new GeneralRegexSanitizer(regex: "(?:[?&](sv|sig|se|srt|ss|sp)=)(?[^&\\\"\\s]*)", groupForReplace: "secret"), + "AZSDK1007", + "Common SAS URL Sanitizer. Applies to all headers, URIs, and text bodies." + ), #endregion #region HeaderRegex new RegisteredSanitizer( new HeaderRegexSanitizer("api-key"), "AZSDK2001" ), - new RegisteredSanitizer( - new HeaderRegexSanitizer("ServiceBusDlqSupplementaryAuthorization", regex: "(?:(sv|sig|se|srt|ss|sp)=)(?[^&\\\"]+)", groupForReplace: "secret"), - "AZSDK2002" - ), - new RegisteredSanitizer( - new HeaderRegexSanitizer("ServiceBusSupplementaryAuthorization", regex: "(?:(sv|sig|se|srt|ss|sp)=)(?[^&\\\"]+)", groupForReplace: "secret"), - "AZSDK2003" - ), new RegisteredSanitizer( new HeaderRegexSanitizer("x-ms-encryption-key"), - "AZSDK2004" + "AZSDK2002" ), new RegisteredSanitizer( new HeaderRegexSanitizer("Location", value: "https://example.com"), - "AZSDK2005" + "AZSDK2003" ), new RegisteredSanitizer( new HeaderRegexSanitizer("subscription-key"), - "AZSDK2006" + "AZSDK2004" ), new RegisteredSanitizer( new HeaderRegexSanitizer("SupplementaryAuthorization"), - "AZSDK2007" + "AZSDK2005" ), new RegisteredSanitizer( new HeaderRegexSanitizer("x-ms-rename-source"), - "AZSDK2008" + "AZSDK2006" ), new RegisteredSanitizer( new HeaderRegexSanitizer("x-ms-file-rename-source"), - "AZSDK2009" + "AZSDK2007" ), new RegisteredSanitizer( new HeaderRegexSanitizer("x-ms-copy-source"), - "AZSDK2010" + "AZSDK2008" ), new RegisteredSanitizer( new HeaderRegexSanitizer("x-ms-copy-source-authorization"), - "AZSDK2011" + "AZSDK2009" ), new RegisteredSanitizer( new HeaderRegexSanitizer("x-ms-file-rename-source-authorization"), - "AZSDK2012" + "AZSDK2010" ), new RegisteredSanitizer( new HeaderRegexSanitizer("x-ms-encryption-key-sha256"), - "AZSDK2013" + "AZSDK2011" ), new RegisteredSanitizer( new HeaderRegexSanitizer("aeg-sas-token"), - "AZSDK2014" + "AZSDK2012" ), new RegisteredSanitizer( new HeaderRegexSanitizer("aeg-sas-key"), - "AZSDK2015" + "AZSDK2013" ), new RegisteredSanitizer( new HeaderRegexSanitizer("aeg-channel-name"), - "AZSDK2016" + "AZSDK2014" ), new RegisteredSanitizer( new HeaderRegexSanitizer("Set-Cookie"), - "AZSDK2017" + "AZSDK2015" ), new RegisteredSanitizer( new HeaderRegexSanitizer("Cookie"), - "AZSDK2018" + "AZSDK2016" ), new RegisteredSanitizer( new HeaderRegexSanitizer("client-request-id"), - "AZSDK2019" + "AZSDK2017" ), new RegisteredSanitizer( new HeaderRegexSanitizer("MS-CV"), - "AZSDK2020" + "AZSDK2018" ), new RegisteredSanitizer( new HeaderRegexSanitizer("X-Azure-Ref"), - "AZSDK2021" + "AZSDK2019" ), new RegisteredSanitizer( new HeaderRegexSanitizer("x-ms-request-id"), - "AZSDK2022" + "AZSDK2020" ), new RegisteredSanitizer( new HeaderRegexSanitizer("x-ms-client-request-id"), - "AZSDK2023" + "AZSDK2021" ), new RegisteredSanitizer( new HeaderRegexSanitizer("x-ms-content-sha256"), - "AZSDK2024" + "AZSDK2022" ), new RegisteredSanitizer( new HeaderRegexSanitizer("Content-Security-Policy-Report-Only"), - "AZSDK2025" + "AZSDK2023" ), new RegisteredSanitizer( new HeaderRegexSanitizer("Repeatability-First-Sent"), - "AZSDK2026" + "AZSDK2024" ), new RegisteredSanitizer( new HeaderRegexSanitizer("Repeatability-Request-ID"), - "AZSDK2027" + "AZSDK2025" ), new RegisteredSanitizer( new HeaderRegexSanitizer("repeatability-request-id"), - "AZSDK2028" + "AZSDK2026" ), new RegisteredSanitizer( new HeaderRegexSanitizer("repeatability-first-sent"), - "AZSDK2029" + "AZSDK2027" ), new RegisteredSanitizer( new HeaderRegexSanitizer("P3P"), - "AZSDK2030" + "AZSDK2028" ), new RegisteredSanitizer( new HeaderRegexSanitizer("x-ms-ests-server"), - "AZSDK2031" + "AZSDK2029" ), #endregion #region BodyRegex @@ -237,49 +234,45 @@ public SanitizerDictionary() { new BodyRegexSanitizer(regex: "client_assertion=(?[^&\\\"]+)", groupForReplace: "secret"), "AZSDK3002" ), - new RegisteredSanitizer( - new BodyRegexSanitizer(regex: "(?:(sv|sig|se|srt|ss|sp)=)(?[^&\\\"\\s]*)", groupForReplace: "secret"), - "AZSDK3003" - ), new RegisteredSanitizer( new BodyRegexSanitizer(regex: "token=(?[^&\\\"]+)($|&)", groupForReplace: "token"), - "AZSDK3004" + "AZSDK3003" ), new RegisteredSanitizer( new BodyRegexSanitizer(regex: "-----BEGIN PRIVATE KEY-----\\n(?.+\\n)*-----END PRIVATE KEY-----\\n", groupForReplace: "cert"), - "AZSDK3005" + "AZSDK3004" ), new RegisteredSanitizer( new BodyRegexSanitizer(regex: "(?<=).*?(?:)(?.*)(?:)", groupForReplace: "group"), - "AZSDK3006" + "AZSDK3005" ), new RegisteredSanitizer( new BodyRegexSanitizer(regex: "(?<=).*?(?:)(?.*)(?:)", groupForReplace: "group"), - "AZSDK3007" + "AZSDK3006" ), new RegisteredSanitizer( new BodyRegexSanitizer(regex: "(?<=).*?(?:)(?.*)(?:)", groupForReplace: "group"), - "AZSDK3008" + "AZSDK3007" ), new RegisteredSanitizer( new BodyRegexSanitizer(regex: "(?:Password=)(?.*?)(?:;)", groupForReplace: "pwd"), - "AZSDK3009" + "AZSDK3008" ), new RegisteredSanitizer( new BodyRegexSanitizer(regex: "(?:User ID=)(?.*?)(?:;)", groupForReplace: "id"), - "AZSDK3010" + "AZSDK3009" ), new RegisteredSanitizer( new BodyRegexSanitizer(regex: "(?:)(?.*)(?:)", groupForReplace: "key"), - "AZSDK3011" + "AZSDK3010" ), new RegisteredSanitizer( new BodyRegexSanitizer(regex: "(?:)(?.*)(?:)", groupForReplace: "key"), - "AZSDK3012" + "AZSDK3011" ), new RegisteredSanitizer( new BodyRegexSanitizer(regex: "(?.+)", groupForReplace: "secret"), - "AZSDK3013" + "AZSDK3012" ), #endregion #region BodyKey @@ -677,10 +670,6 @@ public SanitizerDictionary() { new UriRegexSanitizer("REDACTED", regex: "(?<=http://|https://)(?[^/?\\.]+)", groupForReplace: "host"), "AZSDK4001" ), - new RegisteredSanitizer( - new UriRegexSanitizer(regex: "(?:(sv|sig|se|srt|ss|sp)=)(?[^&\\\"\\s]*)", groupForReplace: "secret"), - "AZSDK4002" - ), #endregion #region RemoveHeader new RegisteredSanitizer(