Repository navigation
[Telemetry] Mask user info of configured URLs in logs, messages and UI - #305
Merged
Merged
Conversation
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019unkFPP5TCRVosCsDJtYGB
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019unkFPP5TCRVosCsDJtYGB
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019unkFPP5TCRVosCsDJtYGB
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019unkFPP5TCRVosCsDJtYGB
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019unkFPP5TCRVosCsDJtYGB
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019unkFPP5TCRVosCsDJtYGB
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019unkFPP5TCRVosCsDJtYGB
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019unkFPP5TCRVosCsDJtYGB
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019unkFPP5TCRVosCsDJtYGB
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019unkFPP5TCRVosCsDJtYGB
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019unkFPP5TCRVosCsDJtYGB
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019unkFPP5TCRVosCsDJtYGB
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019unkFPP5TCRVosCsDJtYGB
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019unkFPP5TCRVosCsDJtYGB
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019unkFPP5TCRVosCsDJtYGB
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019unkFPP5TCRVosCsDJtYGB
11 tasks
|
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.



Pull Request
📖 Description
Configured base URLs of Docker instances and Portainer could carry credentials (
https://user:secret@host) that reached logs, exception and scan-run error messages, the database and the Docker Instances pages. A new helper,UrlRedaction.RedactUserInfo, now replaces the user info with***at every such output site, including the retry handler's request target, the named-pipe exception message and the storedEndpointUri/PortainerEndpoint.BaseUrl; the UI masks again on display so older rows never show credentials. The helper rebuilds a URL only when it has exactly one@, parses and has non-empty user info, and masks every other value containing@up to its last@, so unusual passwords (starting with#,?or/) cannot leak. Connecting still uses the configured URL, and event IDs and template parameter names are unchanged. This is a security fix.🎫 Issues
Closes #295
Decision record: 0005
💬 Reviewer Notes
Focus on
Infrastructure/UrlRedaction.cs(fail-closed rule) and the call sites inTransientHttpRetryHandler,PortainerClient,DockerInstanceClient,InstanceDiscoveryServiceandApplicationViewService. HTTP client spanurl.fullcarries no user info (checked in the OpenTelemetry and .NET runtime sources, so no extra test). The Docker Engine client has no retry handler, so the Docker retry example in the issue cannot occur.📑 Test Plan
New
UrlRedactionTests(all forms, each asserting that neither user name nor password appears) plus tests inTransientHttpRetryHandlerTests,PortainerClientTests,DockerInstanceClientTests,InstanceDiscoveryServiceTestsandApplicationViewServiceTests. Format, build, 570 + 21 tests, Coverage gate (new code 100 %, overall 84.5 %) and Analyzer gate pass locally.✅ Checklist
.squad/stack.md, and the Analyzer gate reports no diagnostic in a changed file..squad/stack.mdpasses (line coverage on new or changed production code and overall).README.md,ARCHITECTURE.md) to reflect my changes..squad/stack.mdprescribes.csharp.instructions.mdare followed.⏭ Next Steps