-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
:PATH
in access logs without query string
#7583
Comments
Currently, we have Do you have a suggestion on how we express that (remove qs)? Probably it is good to have a "special operator" for PATH e.g. |
something like I think my preference would be for a blunt tool - removing the entire query string. Denylists of fields to remove from the query string are very brittle - its too easy for clients (either internal clients developed by other teams or external users) to purposefully or accidentally change field names and break denylist-based redaction. |
@bobby-stripe thanks!
I agree. That makes sense. @zuercher do you have advice here? |
The current code won't automatically handle nesting afaik, though I imagine you could make that work. Would it be easier to just have a Relevant formatting code: https://github.com/envoyproxy/envoy/blob/master/source/common/access_log/access_log_formatter.cc#L226 |
Referring to the following section of the RFC for URIs:
Shouldn't the path not include the query string in the first place? I suppose since the current way to log this information is by the macro
Are there concerns over creating more macros like this? I don't want to break anyone's logs, but I also wish to log the path and query separately. Thoughts? |
@cetanu the
|
@cetanu how about I made an attempt with And I also feel like probably |
A lot of requests don't have a referer in my experience, plus it can be somewhat falsified. The |
This issue has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in the next 7 days unless it is tagged "help wanted" or other activity occurs. Thank you for your contributions. |
This issue has been automatically closed because it has not had activity in the last 37 days. If this issue is still valid, please ping a maintainer and ask them to label it as "help wanted". Thank you for your contributions. |
Any Plan as when this will be available i.e. access log Path without Query Param? |
We just got hit with this during our last upgrade of istio. Where the latest log format had great information about the path but was leaking information in our logs that we didn't want (I know GET shouldn't send any sensitive information, but 3rd party SDK are not always clean). Would have been perfect to be able to keep the path without the query string. |
Can we please reopen this :) |
@zuercher do you think we can add another one to the rules in substitution formatter for this? |
We'd like to have this feature too. I'd be glad to work on this if nobody is working on it, or to collaborate in any way needed to make it go faster. |
Relevant: #12991 (comment) cc. @zuercher @rgs1 |
Hello Everyone. Is there any development in this issue? Any workaround that helps keep the path without the query? |
I ended up separating this with my logging agent |
Hi @cetanu Could you elaborate on that solution? |
Sure.
For example, we have a field The particular log agent we use is called vector. |
Hi @cetanu |
In my opinion to natively support logging the path without the query is an important feature, and missing it poses a certain security risk. |
I don't think anyone is currently working on this, so we just need someone willing to pick this up. |
I might be able to help implement this. I was checking #14512 for the new command formatter extension API. I don't find any examples on custom formatters in the code base yet (outside the test case) but if I understood correctly, a custom formatter would be first (a) registered with Where in the code base one should place new custom formatter implementations? I suppose some will naturally belong to e.g. specific filters, but I think this one is more general. I suppose (b) is necessary when taking the custom formatter approach? When Envoy is configured via xDS, it seems to me that each custom formatter has small impact on the control plane as well? |
@tsaarni Extensions would go in source/extensions/formatters or something like that (maybe source/extensions/access_log_formatters if this is limited to access logging?). For b) yea it needs to be listed next to the access log string that uses it: presumably this is a small cost since the access log string would also need to be updated to make use of the new formatter. |
While implementing proposal #15711 I have became bit suspicious if the approach is the best:
Regarding (2): Control plane may already provide means for user to configure access log format string. User cannot use the new command in the format string before control plane has activated the formatter extension (xref projectcontour/contour#3576). This is of course how the formatter extensions work in Envoy, but maybe it could be avoided in this specific case. Alternative proposal: Stripping the query string is a common need, rather than being an exception. In other proxies one approach seems to be having sanitized variable Could we redefine Was there conclusion for this @dio #7583 (comment) |
The Envoy
access_log
documentation has an example withREQ(X-ENVOY-ORIGINAL-PATH?:PATH)
for logging the request's path, but both the:PATH
andX-ENVOY-ORIGINAL-PATH
header contain the query string.Query strings can sometimes contain sensitive details like access tokens - it would be great to be able to log the path without the query string, but I don't see a way to do this in Envoy currently. Opening this to either see if I'm missing something, or track adding this (small, I think) feature.
The text was updated successfully, but these errors were encountered: