fix: Redact credentials in download task logs#1818
Merged
gaius-qi merged 7 commits intodragonflyoss:mainfrom May 9, 2026
Merged
fix: Redact credentials in download task logs#1818gaius-qi merged 7 commits intodragonflyoss:mainfrom
gaius-qi merged 7 commits intodragonflyoss:mainfrom
Conversation
35090af to
2d7442e
Compare
Signed-off-by: Yiqing Wang <yiqingwang@roblox.com>
2d7442e to
3e3ab4d
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1818 +/- ##
==========================================
+ Coverage 43.59% 44.17% +0.58%
==========================================
Files 92 93 +1
Lines 26933 27229 +296
==========================================
+ Hits 11741 12029 +288
- Misses 15192 15200 +8
🚀 New features to boost your workflow:
|
Signed-off-by: Yiqing Wang <yiqingwang@roblox.com>
…-sensitive-creds-in-download-task-logs
Signed-off-by: Gaius <gaius.qi@gmail.com>
Signed-off-by: Gaius <gaius.qi@gmail.com>
Signed-off-by: Gaius <gaius.qi@gmail.com>
imeoer
approved these changes
May 9, 2026
hhhhsdxxxx
approved these changes
May 9, 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.
Description
This change adds a debug-safe wrapper for
Downloadmessages logged by the dfdaemon gRPC download handlers.DfdaemonDownload::download_taskandDfdaemonUpload::download_taskpreviously logged the fullDownloadpayload with{:?}atinfolevel. That payload can include caller-provided credentials in object storage, HDFS, HuggingFace, ModelScope, and request-header fields.The new
RedactedDownloadwrapper preserves the existing log shape while replacing sensitive values with***REDACTED***.Redacted fields include:
object_storage.access_key_secretobject_storage.session_tokenobject_storage.security_tokenobject_storage.credential_pathhdfs.delegation_tokenhugging_face.tokenmodel_scope.tokenauthorization,proxy-authorization,cookie,x-amz-security-token,x-oss-security-token, and API-key style headersUnit tests cover structured credential redaction, request-header redaction, preservation of non-secret fields, and the final rendered
Debugoutput.Motivation and Context
When
dfgetpasses object storage credentials to dfdaemon, dfdaemon currently logs the fullDownloadmessage atinfolevel. Since the generated protobufDebugimplementation prints all fields verbatim, secret access keys and session tokens can be written to dfdaemon logs.This change keeps the operational value of the existing log message while preventing plaintext credentials from being persisted.
Test Plan
cargo test -p dragonfly-client grpc::debug