-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove or Redact the user and password from the url.full opentelemetry field. #8437
Comments
Hi @zitzerd , sorry for the late reply. May I ask how you specify the basic-auth username/password? var settings = new ElasticsearchClientSettings(new Uri("https://..."))
.Authentication(new BasicAuthentication("elastic", "my_password")) creates a HTTP Basic-Auth header which should never end up in the url. If you explicitly use |
Hi @flobernd, thanks for the reply! Im using the aspire integration and specifying a password on the host side. They are actually sending the u/p in the url as a connectionstring env var, after your mail i debugged the integration and they are passing the full url in the method CreateElasticSearchClientSettings that use a ElasticSearchClientSettings default constructor. Ill talk with them, and in the mean time ill send my own ElasticSearchClientSettings on the client side. and see if the aspire team so they can improve the client integration. private static ElasticsearchClientSettings CreateElasticsearchClientSettings(
ElasticClientsElasticsearchSettings settings,
string connectionName,
string configurationSectionName)
{
if (settings.Endpoint is not null)
{
return new ElasticsearchClientSettings(settings.Endpoint);
}
else if (settings.CloudId is not null && settings.ApiKey is not null)
{
return new(settings.CloudId, new ApiKey(settings.ApiKey));
}
throw new InvalidOperationException(
$"A ElasticsearchClient could not be configured. Ensure valid connection information was provided in 'ConnectionStrings:{connectionName}' or either " +
$"{nameof(settings.Endpoint)} must be provided " +
$"in the '{configurationSectionName}' configuration section.");
} |
Thanks for checking! This indeed looks like something that should be fixed in the Elasticsearch Aspire package 🙂 Please let me know, if there is anything else I can do; otherwise I'm going to close this issue for now. |
This issue is stale because it has been open 5 days with no activity. Remove stale label or comment or this will be closed in 2 days. |
This issue was closed because it has been stalled for 2 days with no activity. |
When testing Elasticsearch cliente 8.15.x with aspire, i notice that the trace includes the username and password of the connection when using basic auth,
Is it possible to redact or remove the user password? or as a workaround remove the field, till its redacted.
Thanks
The text was updated successfully, but these errors were encountered: