-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Description
The current implementation of Microsoft.Extensions.Http logging framework redact headers value based on user input however it does not support redact sensitive information from query parameters, which is kind of security issue.
For customers that are more concerned about this logging risk or have to meet audit requirements for all their integrated services it is important to redact query parameters value based on users input.
The problem lies here -
runtime/src/libraries/Microsoft.Extensions.Http/src/Logging/LoggingScopeHttpMessageHandler.cs
Line 133 in 215b39a
| private static string? GetUriString(Uri? requestUri) |
We could implement this feature same way as we have a extension in IHttpClientBuilder to redact from header.
Line 463 in 215b39a
| public static IHttpClientBuilder RedactLoggedHeaders(this IHttpClientBuilder builder, Func<string, bool> shouldRedactHeaderValue) |
We might name this extension RedactLoggedQueryParameters
Thanks,
Ankit S
