Fix AppSec/IAST context dropped when trace.propagation.behavior.extract=ignore/restart#11666
Draft
dougqh wants to merge 1 commit into
Draft
Fix AppSec/IAST context dropped when trace.propagation.behavior.extract=ignore/restart#11666dougqh wants to merge 1 commit into
dougqh wants to merge 1 commit into
Conversation
Contributor
|
Contributor
🟢 Java Benchmark SLOs — All performance SLOs passed
PR vs. master results
Commit: Load and DaCapo benchmarks can be triggered manually in the GitLab pipeline. Results will appear in the Benchmarking Platform UI after completion. |
2e5fe4c to
7480c60
Compare
…ct=ignore/restart With IGNORE or RESTART, CoreSpanBuilder nulls the remote TagContext parent before buildSpanContext reaches the instanceof TagContext branch that copies requestContextDataAppSec/requestContextDataIast. The AppSec context is lost and GatewayBridge callbacks no-op, silently bypassing WAF/RASP for all inbound requests in AppSec-enabled services configured to ignore distributed tracing extraction. Fix: promote the AppSec/IAST data from the TagContext into the builder fields before nulling the parent. The builder-field path in buildSpanContext applies these after the parent is gone, preserving the request context while still correctly dropping trace identifiers and sampling priority. Fixes: APMSP-3198 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
7480c60 to
c6b6424
Compare
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.
Summary
trace.propagation.behavior.extract=ignoreorrestart,CoreSpanBuilder.startnulls the remoteTagContextparent beforebuildSpanContextreaches theinstanceof TagContextbranch that copiesrequestContextDataAppSec/requestContextDataIastinto theDDSpanContext.DDSpanContextends up with null AppSec context, causing everyGatewayBridgecallback to returnNoopFlow.INSTANCE— silently bypassing WAF/RASP for all inbound requests in AppSec-enabled services configured to ignore distributed tracing extraction. IAST is similarly affected.TagContextinto the builder fields (builderRequestContextDataAppSec/builderRequestContextDataIast), whichbuildSpanContextapplies after the parent is gone. Trace identifiers and sampling priority are still correctly dropped.Test plan
CoreSpanBuilderTest.appSecContextPreservedFromTagContextWithIgnoreBehavior— asserts AppSec/IAST context survivesextract=ignoreCoreSpanBuilderTest.appSecContextPreservedFromTagContextWithRestartBehavior— same forextract=restart./gradlew :dd-trace-core:test --tests "datadog.trace.core.CoreSpanBuilderTest.appSecContext*"Fixes: APMSP-3198
tag: no release note
tag: ai generated
🤖 Generated with Claude Code