[Debugger] Redact sensitive values in expression dumps#8879
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the Live Debugger expression “dump-to-string” path to apply redaction when stringifying objects for log-probe templates and span decorations, ensuring sensitive members aren’t leaked when dumping containing objects.
Changes:
- Add dump-time redaction for sensitive field/property identifiers, including normalization of compiler-generated backing field names (e.g.,
<Password>k__BackingField→Password). - Redact
IDictionaryvalues when the corresponding key matches existing dictionary-key redaction rules. - Add targeted tests validating redaction behavior for template dumps and span decoration dumps.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| tracer/src/Datadog.Trace/Debugger/Expressions/ProbeExpressionParser.Dump.cs | Adds redaction checks during dump stringification, backing-field name normalization, and dictionary value redaction behavior. |
| tracer/test/Datadog.Trace.Tests/Debugger/DebuggerExpressionLanguageTests.cs | Adds unit tests to verify redaction in template dumps and span-decoration dumps. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2797ff1963
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Execution-Time Benchmarks Report ⏱️Execution-time results for samples comparing This PR (8879) and master. ✅ No regressions detected - check the details below Full Metrics ComparisonFakeDbCommand
HttpMessageHandler
Comparison explanationExecution-time benchmarks measure the whole time it takes to execute a program, and are intended to measure the one-off costs. Cases where the execution time results for the PR are worse than latest master results are highlighted in **red**. The following thresholds were used for comparing the execution times:
Note that these results are based on a single point-in-time result for each branch. For full results, see the dashboard. Graphs show the p99 interval based on the mean and StdDev of the test run, as well as the mean value of the run (shown as a diamond below the graph). Duration chartsFakeDbCommand (.NET Framework 4.8)gantt
title Execution time (ms) FakeDbCommand (.NET Framework 4.8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8879) - mean (70ms) : 68, 72
master - mean (70ms) : 68, 72
section Bailout
This PR (8879) - mean (77ms) : 74, 81
master - mean (74ms) : 73, 76
section CallTarget+Inlining+NGEN
This PR (8879) - mean (1,080ms) : 1034, 1125
master - mean (1,084ms) : 1029, 1139
FakeDbCommand (.NET Core 3.1)gantt
title Execution time (ms) FakeDbCommand (.NET Core 3.1)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8879) - mean (110ms) : 105, 116
master - mean (109ms) : 106, 112
section Bailout
This PR (8879) - mean (114ms) : 108, 120
master - mean (110ms) : 107, 113
section CallTarget+Inlining+NGEN
This PR (8879) - mean (774ms) : 750, 798
master - mean (780ms) : 752, 809
FakeDbCommand (.NET 6)gantt
title Execution time (ms) FakeDbCommand (.NET 6)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8879) - mean (100ms) : 95, 104
master - mean (101ms) : 94, 107
section Bailout
This PR (8879) - mean (97ms) : 96, 99
master - mean (98ms) : 94, 102
section CallTarget+Inlining+NGEN
This PR (8879) - mean (938ms) : 900, 976
master - mean (934ms) : 894, 973
FakeDbCommand (.NET 8)gantt
title Execution time (ms) FakeDbCommand (.NET 8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8879) - mean (94ms) : 92, 97
master - mean (94ms) : 92, 97
section Bailout
This PR (8879) - mean (97ms) : 93, 101
master - mean (95ms) : 93, 97
section CallTarget+Inlining+NGEN
This PR (8879) - mean (814ms) : 776, 853
master - mean (817ms) : 783, 851
HttpMessageHandler (.NET Framework 4.8)gantt
title Execution time (ms) HttpMessageHandler (.NET Framework 4.8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8879) - mean (200ms) : 194, 205
master - mean (202ms) : 196, 208
section Bailout
This PR (8879) - mean (205ms) : 202, 209
master - mean (205ms) : 202, 208
section CallTarget+Inlining+NGEN
This PR (8879) - mean (1,204ms) : 1163, 1245
master - mean (1,206ms) : 1162, 1251
HttpMessageHandler (.NET Core 3.1)gantt
title Execution time (ms) HttpMessageHandler (.NET Core 3.1)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8879) - mean (286ms) : 276, 296
master - mean (291ms) : 284, 299
section Bailout
This PR (8879) - mean (287ms) : 282, 293
master - mean (291ms) : 283, 298
section CallTarget+Inlining+NGEN
This PR (8879) - mean (966ms) : 948, 984
master - mean (974ms) : 949, 999
HttpMessageHandler (.NET 6)gantt
title Execution time (ms) HttpMessageHandler (.NET 6)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8879) - mean (281ms) : 274, 289
master - mean (283ms) : 275, 290
section Bailout
This PR (8879) - mean (281ms) : 274, 287
master - mean (283ms) : 278, 287
section CallTarget+Inlining+NGEN
This PR (8879) - mean (1,161ms) : 1114, 1209
master - mean (1,169ms) : 1133, 1206
HttpMessageHandler (.NET 8)gantt
title Execution time (ms) HttpMessageHandler (.NET 8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8879) - mean (276ms) : 267, 285
master - mean (281ms) : 275, 287
section Bailout
This PR (8879) - mean (278ms) : 270, 285
master - mean (278ms) : 271, 285
section CallTarget+Inlining+NGEN
This PR (8879) - mean (1,042ms) : 1002, 1082
master - mean (1,043ms) : 991, 1095
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
BenchmarksBenchmark execution time: 2026-07-09 09:03:45 Comparing candidate commit c1df673 in PR branch Found 0 performance improvements and 1 performance regressions! Performance is the same for 71 metrics, 0 unstable metrics, 62 known flaky benchmarks, 64 flaky benchmarks without significant changes.
|
247a090 to
c1df673
Compare
Summary of changes
<Password>k__BackingFieldare treated asPassword.IDictionaryvalues when their keys match existing dictionary-key redaction rules.Reason for change
Implementation details
DumpObject, before collection dispatch orToString(), so redacted-named collection fields cannot dump their entries.ShouldRedactDictionaryKey(...)to stay aligned with existing expression dictionary redaction behavior.Test coverage
DebuggerExpressionLanguageTests