Skip to content

Router no longer logs request credentials or query strings - #2206

Merged
Jeff Luo (JeffLuoo) merged 1 commit into
agent-substrate:mainfrom
git286:router-envoy-no-credential-logs
Oct 6, 2026
Merged

Jeff Luo (JeffLuoo) merged 1 commit into
agent-substrate:mainfrom
git286:router-envoy-no-credential-logs

Conversation

@git286

Copy link
Copy Markdown
Collaborator

The router's Envoy wrote request secrets to its log. The base manifest ran it with upstream, router and ext_proc at debug, which dumps every request header, so Authorization and Cookie were 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=debug on the Envoy admin port.

Tested the format on the same Envoy image (v1.39): /foo?api_key=SECRET is logged as /foo. Rendered every kustomize overlay before and after; only the two flag lines change.

Fixes #2205

It's a good idea to open an issue first for discussion.

  • Tests pass
  • Appropriate changes to documentation are included in the PR

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.
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.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit - is it still a TODO after this PR?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

@JeffLuoo
Jeff Luo (JeffLuoo) added this pull request to the merge queue Oct 5, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to no response for status checks Oct 5, 2026
@JeffLuoo
Jeff Luo (JeffLuoo) added this pull request to the merge queue Oct 6, 2026
Merged via the queue into agent-substrate:main with commit 2806695 Oct 6, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Router Envoy logs request credentials

2 participants