Skip to content

fix(proxy): log method and URI instead of the whole request to keep credentials out of logs - #2093

Open
bumarcell wants to merge 1 commit into
dragonflyoss:mainfrom
bumarcell:fix/proxy-log-no-request-headers
Open

bumarcell wants to merge 1 commit into
dragonflyoss:mainfrom
bumarcell:fix/proxy-log-no-request-headers

Conversation

@bumarcell

Copy link
Copy Markdown
Contributor

Description

The proxy logged the whole http::Request with {:?} (INFO on the direct-to-remote path, DEBUG on the non-GET bypass and P2P paths). The Debug output of http::Request includes all headers, so the Authorization header containerd sends (ECR tokens, Harbor/Docker Hub basic auth, bearer tokens) ended up in dfdaemon's logs and in the central log store collecting them.

This change logs only the method and URI in those 13 statements. Nothing else about the messages changes.

Related Issue

Fixes #2091

Motivation and Context

Registry credentials must not land in logs that have long retention and broad read access. Observed with client v1.5.5 in Kubernetes with containerd routed through the proxy. cargo fmt --check clean.

🤖 Generated with Claude Code

@codecov

codecov Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 65.61%. Comparing base (34ea3f1) to head (46dd92d).
⚠️ Report is 12 commits behind head on main.

Files with missing lines Patch % Lines
dragonfly-client/src/proxy/mod.rs 0.00% 5 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2093      +/-   ##
==========================================
+ Coverage   65.29%   65.61%   +0.31%     
==========================================
  Files         103      102       -1     
  Lines       30789    31141     +352     
==========================================
+ Hits        20105    20434     +329     
- Misses      10684    10707      +23     
Files with missing lines Coverage Δ
dragonfly-client/src/proxy/mod.rs 38.00% <0.00%> (ø)

... and 16 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

…redentials out of logs

The proxy logged the full `http::Request` with `{:?}` at INFO level whenever a
request was proxied directly to the remote registry, and at DEBUG level on the
non-GET bypass and the P2P paths. The `Debug` output of `http::Request` includes
every header, so the `Authorization` header that containerd sends (ECR tokens,
Harbor/Docker Hub basic auth, bearer tokens) ended up in dfdaemon's logs and in
whatever central log store collects them.

Log only the method and URI in these 13 statements; nothing else about the
messages changes.

Signed-off-by: Jamal Allogie <jamal.allogie@gmail.com>
@bumarcell
bumarcell force-pushed the fix/proxy-log-no-request-headers branch from 7afcf14 to 46dd92d Compare October 22, 2026 08:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

dfdaemon proxy logs the full HTTP request including the Authorization header at INFO level

1 participant