[AzureMonitorAutoConfigure] Validate Live Metrics redirect targets - #50117
Open
xiang17 wants to merge 5 commits into
Open
[AzureMonitorAutoConfigure] Validate Live Metrics redirect targets#50117xiang17 wants to merge 5 commits into
xiang17 wants to merge 5 commits into
Conversation
xiang17
requested review from
Harsimar Kaur (harsimar) and
Rajkumar Rangaraj (rajkumar-rangaraj)
as code owners
August 12, 2026 17:37
xiang17
requested review from
a team,
Ram Thiru (ramthi) and
Trask Stalnaker (trask)
as code owners
August 12, 2026 17:37
|
Azure Pipelines: Successfully started running 1 pipeline(s). 35 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR hardens Live Metrics (QuickPulse) redirect handling in azure-monitor-opentelemetry-autoconfigure by validating redirect targets before storing/using them, ensuring redirects stay within a trusted boundary.
Changes:
- Introduces
QuickPulseRedirectValidatorto validate redirect URLs (HTTPS only, no userinfo, default port, and trusted host boundary). - Updates
QuickPulseCoordinatorto apply redirect validation prior to setting the redirect endpoint prefix. - Adds unit tests covering accepted and rejected redirect scenarios, and updates the module CHANGELOG.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/test/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/quickpulse/QuickPulseCoordinatorTest.java | Adds tests for trusted vs. untrusted/invalid redirect targets. |
| sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/quickpulse/QuickPulseRedirectValidator.java | New validator implementing redirect URL and trust-boundary checks. |
| sdk/monitor/azure-monitor-opentelemetry-autoconfigure/src/main/java/com/azure/monitor/opentelemetry/autoconfigure/implementation/quickpulse/QuickPulseCoordinator.java | Applies redirect validation before persisting/using redirect endpoint prefixes. |
| sdk/monitor/azure-monitor-opentelemetry-autoconfigure/CHANGELOG.md | Documents the redirect validation bug fix. |
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
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
Adds validation for Live Metrics QuickPulse redirect targets in
azure-monitor-opentelemetry-autoconfigure.The QuickPulse service can return
x-ms-qps-service-endpoint-redirect-v2.Previously, the SDK accepted the redirect target before applying a trust-boundary
check. This change validates the redirect before storing or using it.
The validator now requires redirect targets to:
Invalid or untrusted redirects are ignored and the SDK continues using its current endpoint (the configured endpoint, or the last successfully validated redirect).
Validation
mvn -f sdk/monitor/azure-monitor-opentelemetry-autoconfigure/pom.xml -Dtest=QuickPulseCoordinatorTest testAlso verified the submitted PoC against the patched local artifact. The SDK no longer derives or stores the attacker redirect endpoint:
All SDK Contribution checklist:
General Guidelines and Best Practices
Testing Guidelines