Repository navigation
Router no longer logs request credentials or query strings - #2206
Merged
Jeff Luo (JeffLuoo) merged 1 commit intoOct 6, 2026
Merged
Jeff Luo (JeffLuoo) merged 1 commit into
Jeff Luo (JeffLuoo) merged 1 commit into
Conversation
The router's Envoy ran with upstream, router and ext_proc at debug level in the base install manifest, so every proxied request had its full header map written to the container log, including Authorization and Cookie. The access logs used Envoy's default format, which logs the request path with its query string, so API keys and tokens passed as query parameters were logged too, even without debug. Drop the debug component levels and give the router's HCMs an explicit access log format: Envoy's default with %PATH(NQ:ORIG_OR_PATH)% in place of the path, so the query is never written. A test asserts every HCM in the snapshot uses it.
Da Huang (git286)
requested review from
Jeff Luo (JeffLuoo),
Bowei Du (bowei) and
haiyanmeng
October 5, 2026 17:54
Jeff Luo (JeffLuoo)
approved these changes
Oct 5, 2026
| GenerateRequestId: &wrapperspb.BoolValue{Value: true}, | ||
| Tracing: x.buildTracing(), | ||
| // TODO: Envoy's default access log format is not very useful for CONNECT requests. | ||
| // TODO: this format is not very useful for CONNECT requests. |
Collaborator
There was a problem hiding this comment.
nit - is it still a TODO after this PR?
Collaborator
Author
There was a problem hiding this comment.
Yes, I think it is still a TODO. The new format is Envoy's default minus the query, so CONNECT lines are as thin as before: no path, just authority and upstream IP, and nothing says which actor it was. I'd rather fix that in a follow-up with a structured format that includes the actor (and trace id).
github-merge-queue
Bot
removed this pull request from the merge queue due to no response for status checks
Oct 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The router's Envoy wrote request secrets to its log. The base manifest ran it with
upstream,routerandext_procat debug, which dumps every request header, soAuthorizationandCookiewere logged as-is. The access log used Envoy's default format, which logs the query string, so tokens like?api_key=...were logged even without debug.This drops the debug flag (Envoy goes back to
info) and gives the router's access log an explicit format: Envoy's default, but with%PATH(NQ:ORIG_OR_PATH)%so the query is never written. A new test checks that every router HCM uses it.Nothing in the repo reads those debug lines. If you need them, turn them on for a while with
POST /logging?router=debugon the Envoy admin port.Tested the format on the same Envoy image (v1.39):
/foo?api_key=SECRETis logged as/foo. Rendered every kustomize overlay before and after; only the two flag lines change.Fixes #2205