bobhan1 opened a new pull request, #66618:
URL: https://github.com/apache/doris/pull/66618

   ### What problem does this PR solve?
   
   Issue Number: close #xxx
   
   Related PR: #xxx
   
   Problem Summary: A failed HTTP authentication request caused the BE warning 
log to print the complete `TCheckAuthRequest`, including its plaintext 
password. The FE `checkAuth` debug log exposed the same field. This PR copies 
the request before logging and replaces only the password with the standard 
`***MASKED***` marker, preserving the user, client IP, privilege, and other 
non-secret diagnostic fields. The existing HTTP request formatter continues to 
mask authentication tokens and Authorization headers.
   
   ### Release note
   
   Mask passwords in BE and FE HTTP authentication logs while retaining 
non-sensitive request context.
   
   ### Check List (For Author)
   
   - Test
       - [ ] Regression test
       - [x] Unit Test
           - `./run-be-ut.sh --clean --run --filter=HttpAuthTest.* -j100` 
(clean build was resumed without `--clean` after a concurrent generated-source 
rebuild; final result: 7 tests passed)
           - `./run-fe-ut.sh --run 
org.apache.doris.service.FrontendServiceImplTest#testCheckAuthDoesNotLogPassword`
 (1 test passed)
           - `build-support/check-format.sh`
           - `git diff --check`
       - [ ] Manual test (add detailed scripts or steps below)
       - [ ] No need to test or manual test. Explain why:
           - [ ] This is a refactor/code format and no logic has been changed.
           - [ ] Previous test can cover this change.
           - [ ] No code files have been changed.
           - [ ] Other reason
   
   - Behavior changed:
       - [ ] No.
       - [x] Yes. Password values are replaced with `***MASKED***` in 
authentication logs; other request fields are unchanged.
   
   - Does this need documentation?
       - [x] No.
       - [ ] Yes.
   
   ### Implementation notes
   
   - BE warning logs use a copied `TCheckAuthRequest` with only `passwd` 
replaced.
   - FE debug logs use `deepCopy()` and replace only `passwd` before formatting.
   - Added regression coverage for failed-password logging and retained token 
masking.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to