-
Notifications
You must be signed in to change notification settings - Fork 145
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ASM] Fix IAST weak random vulnerability error #6432
Conversation
Datadog ReportBranch report: ❌ 3 Failed (0 Known Flaky), 462675 Passed, 3653 Skipped, 32h 59m 32.94s Total Time ❌ Failed Tests (3) |
Execution-Time Benchmarks Report ⏱️Execution-time results for samples comparing the following branches/commits: Execution-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 shown 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). gantt
title Execution time (ms) FakeDbCommand (.NET Framework 4.6.2)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6432) - mean (68ms) : 65, 71
. : milestone, 68,
master - mean (68ms) : 66, 71
. : milestone, 68,
section CallTarget+Inlining+NGEN
This PR (6432) - mean (975ms) : 952, 997
. : milestone, 975,
master - mean (976ms) : 953, 998
. : milestone, 976,
gantt
title Execution time (ms) FakeDbCommand (.NET Core 3.1)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6432) - mean (107ms) : 105, 109
. : milestone, 107,
master - mean (107ms) : 104, 110
. : milestone, 107,
section CallTarget+Inlining+NGEN
This PR (6432) - mean (674ms) : 658, 690
. : milestone, 674,
master - mean (679ms) : 662, 695
. : milestone, 679,
gantt
title Execution time (ms) FakeDbCommand (.NET 6)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6432) - mean (91ms) : 89, 93
. : milestone, 91,
master - mean (91ms) : 89, 92
. : milestone, 91,
section CallTarget+Inlining+NGEN
This PR (6432) - mean (626ms) : 609, 643
. : milestone, 626,
master - mean (635ms) : 619, 651
. : milestone, 635,
gantt
title Execution time (ms) HttpMessageHandler (.NET Framework 4.6.2)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6432) - mean (196ms) : 191, 201
. : milestone, 196,
master - mean (193ms) : 188, 198
. : milestone, 193,
section CallTarget+Inlining+NGEN
This PR (6432) - mean (1,102ms) : 1067, 1138
. : milestone, 1102,
master - mean (1,096ms) : 1070, 1122
. : milestone, 1096,
gantt
title Execution time (ms) HttpMessageHandler (.NET Core 3.1)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6432) - mean (279ms) : 274, 284
. : milestone, 279,
master - mean (279ms) : 275, 284
. : milestone, 279,
section CallTarget+Inlining+NGEN
This PR (6432) - mean (866ms) : 830, 902
. : milestone, 866,
master - mean (871ms) : 845, 896
. : milestone, 871,
gantt
title Execution time (ms) HttpMessageHandler (.NET 6)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6432) - mean (267ms) : 262, 271
. : milestone, 267,
master - mean (266ms) : 263, 269
. : milestone, 266,
section CallTarget+Inlining+NGEN
This PR (6432) - mean (844ms) : 809, 879
. : milestone, 844,
master - mean (851ms) : 818, 884
. : milestone, 851,
|
Throughput/Crank Report ⚡Throughput results for AspNetCoreSimpleController comparing the following branches/commits: Cases where throughput results for the PR are worse than latest master (5% drop or greater), results are shown in red. Note that these results are based on a single point-in-time result for each branch. For full results, see one of the many, many dashboards! gantt
title Throughput Linux x64 (Total requests)
dateFormat X
axisFormat %s
section Baseline
This PR (6432) (11.265M) : 0, 11264987
master (11.173M) : 0, 11172862
benchmarks/2.9.0 (11.033M) : 0, 11032866
section Automatic
This PR (6432) (7.242M) : 0, 7242243
master (7.214M) : 0, 7214402
benchmarks/2.9.0 (7.786M) : 0, 7785853
section Trace stats
master (7.560M) : 0, 7559850
section Manual
master (11.194M) : 0, 11193707
section Manual + Automatic
This PR (6432) (6.780M) : 0, 6780255
master (6.718M) : 0, 6717525
section DD_TRACE_ENABLED=0
master (10.296M) : 0, 10295976
gantt
title Throughput Linux arm64 (Total requests)
dateFormat X
axisFormat %s
section Baseline
This PR (6432) (9.603M) : 0, 9602810
master (9.776M) : 0, 9776047
benchmarks/2.9.0 (9.495M) : 0, 9494821
section Automatic
This PR (6432) (6.293M) : 0, 6293265
master (6.425M) : 0, 6425271
section Trace stats
master (6.758M) : 0, 6757513
section Manual
master (9.661M) : 0, 9660549
section Manual + Automatic
This PR (6432) (5.928M) : 0, 5927617
master (6.039M) : 0, 6038872
section DD_TRACE_ENABLED=0
master (8.861M) : 0, 8860501
gantt
title Throughput Windows x64 (Total requests)
dateFormat X
axisFormat %s
section Baseline
This PR (6432) (10.098M) : 0, 10097920
master (9.399M) : 0, 9399211
benchmarks/2.9.0 (10.020M) : 0, 10019592
section Automatic
This PR (6432) (6.468M) : 0, 6467904
master (5.619M) : 0, 5618747
benchmarks/2.9.0 (7.255M) : 0, 7255257
section Trace stats
master (6.816M) : 0, 6816490
section Manual
master (9.559M) : 0, 9558747
section Manual + Automatic
This PR (6432) (5.938M) : 0, 5938007
master (6.022M) : 0, 6022498
section DD_TRACE_ENABLED=0
master (9.201M) : 0, 9201064
|
Benchmarks Report for tracer 🐌Benchmarks for #6432 compared to master:
The following thresholds were used for comparing the benchmark speeds:
Allocation changes below 0.5% are ignored. Benchmark detailsBenchmarks.Trace.ActivityBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.AgentWriterBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.AspNetCoreBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.DbCommandBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.ElasticsearchBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.GraphQLBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.HttpClientBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.ILoggerBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.Log4netBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.NLogBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.RedisBenchmark - Slower
|
Benchmark | diff/base | Base Median (ns) | Diff Median (ns) | Modality |
---|---|---|---|---|
Benchmarks.Trace.RedisBenchmark.SendReceive‑net6.0 | 1.118 | 1,310.72 | 1,465.73 |
Raw results
Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
---|---|---|---|---|---|---|---|---|---|
master | SendReceive |
net6.0 | 1.31μs | 0.911ns | 3.53ns | 0.0157 | 0 | 0 | 1.14 KB |
master | SendReceive |
netcoreapp3.1 | 1.93μs | 0.778ns | 3.01ns | 0.0154 | 0 | 0 | 1.14 KB |
master | SendReceive |
net472 | 2.21μs | 0.887ns | 3.44ns | 0.183 | 0 | 0 | 1.16 KB |
#6432 | SendReceive |
net6.0 | 1.47μs | 0.799ns | 3.09ns | 0.0162 | 0 | 0 | 1.14 KB |
#6432 | SendReceive |
netcoreapp3.1 | 1.85μs | 1.05ns | 4.08ns | 0.0157 | 0 | 0 | 1.14 KB |
#6432 | SendReceive |
net472 | 2.12μs | 0.758ns | 2.84ns | 0.183 | 0 | 0 | 1.16 KB |
Benchmarks.Trace.SerilogBenchmark - Same speed ✔️ Same allocations ✔️
Raw results
Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
---|---|---|---|---|---|---|---|---|---|
master | EnrichedLog |
net6.0 | 2.75μs | 0.668ns | 2.41ns | 0.022 | 0 | 0 | 1.6 KB |
master | EnrichedLog |
netcoreapp3.1 | 3.9μs | 2.14ns | 8.29ns | 0.0216 | 0 | 0 | 1.65 KB |
master | EnrichedLog |
net472 | 4.42μs | 3.49ns | 13.5ns | 0.322 | 0 | 0 | 2.04 KB |
#6432 | EnrichedLog |
net6.0 | 2.79μs | 1.44ns | 5.57ns | 0.0223 | 0 | 0 | 1.6 KB |
#6432 | EnrichedLog |
netcoreapp3.1 | 3.96μs | 1.66ns | 6.43ns | 0.0216 | 0 | 0 | 1.65 KB |
#6432 | EnrichedLog |
net472 | 4.33μs | 3.66ns | 14.2ns | 0.322 | 0 | 0 | 2.04 KB |
Benchmarks.Trace.SpanBenchmark - Same speed ✔️ Same allocations ✔️
Raw results
Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
---|---|---|---|---|---|---|---|---|---|
master | StartFinishSpan |
net6.0 | 402ns | 0.238ns | 0.921ns | 0.00805 | 0 | 0 | 576 B |
master | StartFinishSpan |
netcoreapp3.1 | 616ns | 0.76ns | 2.95ns | 0.00768 | 0 | 0 | 576 B |
master | StartFinishSpan |
net472 | 631ns | 0.366ns | 1.42ns | 0.0916 | 0 | 0 | 578 B |
master | StartFinishScope |
net6.0 | 556ns | 0.355ns | 1.38ns | 0.00982 | 0 | 0 | 696 B |
master | StartFinishScope |
netcoreapp3.1 | 733ns | 0.697ns | 2.7ns | 0.00919 | 0 | 0 | 696 B |
master | StartFinishScope |
net472 | 849ns | 0.866ns | 3.35ns | 0.104 | 0 | 0 | 658 B |
#6432 | StartFinishSpan |
net6.0 | 399ns | 0.276ns | 1.07ns | 0.00803 | 0 | 0 | 576 B |
#6432 | StartFinishSpan |
netcoreapp3.1 | 572ns | 0.467ns | 1.75ns | 0.00767 | 0 | 0 | 576 B |
#6432 | StartFinishSpan |
net472 | 687ns | 0.571ns | 2.21ns | 0.0918 | 0 | 0 | 578 B |
#6432 | StartFinishScope |
net6.0 | 545ns | 0.327ns | 1.27ns | 0.00983 | 0 | 0 | 696 B |
#6432 | StartFinishScope |
netcoreapp3.1 | 691ns | 0.247ns | 0.955ns | 0.0093 | 0 | 0 | 696 B |
#6432 | StartFinishScope |
net472 | 847ns | 0.356ns | 1.38ns | 0.104 | 0 | 0 | 658 B |
Benchmarks.Trace.TraceAnnotationsBenchmark - Slower ⚠️ Same allocations ✔️
Slower ⚠️ in #6432
Benchmark
diff/base
Base Median (ns)
Diff Median (ns)
Modality
Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin‑net6.0
1.168
591.12
690.29
Benchmark | diff/base | Base Median (ns) | Diff Median (ns) | Modality |
---|---|---|---|---|
Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin‑net6.0 | 1.168 | 591.12 | 690.29 |
Raw results
Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
---|---|---|---|---|---|---|---|---|---|
master | RunOnMethodBegin |
net6.0 | 591ns | 0.394ns | 1.47ns | 0.00976 | 0 | 0 | 696 B |
master | RunOnMethodBegin |
netcoreapp3.1 | 885ns | 0.35ns | 1.31ns | 0.00973 | 0 | 0 | 696 B |
master | RunOnMethodBegin |
net472 | 1.16μs | 1.04ns | 4.04ns | 0.104 | 0 | 0 | 658 B |
#6432 | RunOnMethodBegin |
net6.0 | 690ns | 0.611ns | 2.37ns | 0.00975 | 0 | 0 | 696 B |
#6432 | RunOnMethodBegin |
netcoreapp3.1 | 848ns | 0.788ns | 3.05ns | 0.00968 | 0 | 0 | 696 B |
#6432 | RunOnMethodBegin |
net472 | 1.22μs | 0.727ns | 2.52ns | 0.104 | 0 | 0 | 658 B |
…aDog/dd-trace-dotnet into nacho/FixIastNonRequestSpans
Benchmarks Report for appsec 🐌Benchmarks for #6432 compared to master:
The following thresholds were used for comparing the benchmark speeds:
Allocation changes below 0.5% are ignored. Benchmark detailsBenchmarks.Trace.Asm.AppSecBodyBenchmark - Faster 🎉 Same allocations ✔️
|
Benchmark | base/diff | Base Median (ns) | Diff Median (ns) | Modality |
---|---|---|---|---|
Benchmarks.Trace.Asm.AppSecBodyBenchmark.ObjectExtractorSimpleBody‑netcoreapp3.1 | 1.220 | 229.02 | 187.74 |
Raw results
Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
---|---|---|---|---|---|---|---|---|---|
master | AllCycleSimpleBody |
net6.0 | 187μs | 117ns | 437ns | 2.62 | 0 | 0 | 188.52 KB |
master | AllCycleSimpleBody |
netcoreapp3.1 | 281μs | 159ns | 597ns | 2.66 | 0 | 0 | 195.8 KB |
master | AllCycleSimpleBody |
net472 | 250μs | 153ns | 574ns | 35.8 | 2 | 0 | 225.32 KB |
master | AllCycleMoreComplexBody |
net6.0 | 189μs | 80.4ns | 290ns | 2.74 | 0 | 0 | 192.02 KB |
master | AllCycleMoreComplexBody |
netcoreapp3.1 | 298μs | 639ns | 2.48μs | 2.63 | 0 | 0 | 199.22 KB |
master | AllCycleMoreComplexBody |
net472 | 254μs | 425ns | 1.64μs | 36.4 | 2.02 | 0 | 228.83 KB |
master | ObjectExtractorSimpleBody |
net6.0 | 138ns | 0.184ns | 0.69ns | 0.00394 | 0 | 0 | 280 B |
master | ObjectExtractorSimpleBody |
netcoreapp3.1 | 229ns | 0.339ns | 1.31ns | 0.00366 | 0 | 0 | 272 B |
master | ObjectExtractorSimpleBody |
net472 | 163ns | 0.264ns | 1.02ns | 0.0446 | 0 | 0 | 281 B |
master | ObjectExtractorMoreComplexBody |
net6.0 | 2.89μs | 1.4ns | 5.22ns | 0.0522 | 0 | 0 | 3.78 KB |
master | ObjectExtractorMoreComplexBody |
netcoreapp3.1 | 3.73μs | 3.7ns | 13.8ns | 0.0508 | 0 | 0 | 3.69 KB |
master | ObjectExtractorMoreComplexBody |
net472 | 3.6μs | 2.19ns | 8.18ns | 0.603 | 0.00543 | 0 | 3.8 KB |
#6432 | AllCycleSimpleBody |
net6.0 | 200μs | 190ns | 710ns | 2.6 | 0 | 0 | 188.38 KB |
#6432 | AllCycleSimpleBody |
netcoreapp3.1 | 304μs | 105ns | 406ns | 2.58 | 0 | 0 | 195.66 KB |
#6432 | AllCycleSimpleBody |
net472 | 269μs | 121ns | 451ns | 35.7 | 2.02 | 0 | 225.16 KB |
#6432 | AllCycleMoreComplexBody |
net6.0 | 208μs | 125ns | 469ns | 2.71 | 0 | 0 | 191.88 KB |
#6432 | AllCycleMoreComplexBody |
netcoreapp3.1 | 312μs | 259ns | 1μs | 2.64 | 0 | 0 | 199.07 KB |
#6432 | AllCycleMoreComplexBody |
net472 | 277μs | 105ns | 363ns | 36.2 | 2.07 | 0 | 228.68 KB |
#6432 | ObjectExtractorSimpleBody |
net6.0 | 140ns | 0.155ns | 0.599ns | 0.00395 | 0 | 0 | 280 B |
#6432 | ObjectExtractorSimpleBody |
netcoreapp3.1 | 188ns | 0.35ns | 1.31ns | 0.00372 | 0 | 0 | 272 B |
#6432 | ObjectExtractorSimpleBody |
net472 | 163ns | 0.191ns | 0.69ns | 0.0446 | 0 | 0 | 281 B |
#6432 | ObjectExtractorMoreComplexBody |
net6.0 | 2.9μs | 1.91ns | 7.13ns | 0.0538 | 0 | 0 | 3.78 KB |
#6432 | ObjectExtractorMoreComplexBody |
netcoreapp3.1 | 3.8μs | 2.52ns | 9.41ns | 0.0493 | 0 | 0 | 3.69 KB |
#6432 | ObjectExtractorMoreComplexBody |
net472 | 3.6μs | 2.6ns | 9.74ns | 0.602 | 0.00544 | 0 | 3.8 KB |
Benchmarks.Trace.Asm.AppSecEncoderBenchmark - Same speed ✔️ Same allocations ✔️
Raw results
Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
---|---|---|---|---|---|---|---|---|---|
master | EncodeArgs |
net6.0 | 37.2μs | 26.4ns | 98.6ns | 0.445 | 0 | 0 | 32.4 KB |
master | EncodeArgs |
netcoreapp3.1 | 54.7μs | 56.4ns | 219ns | 0.432 | 0 | 0 | 32.4 KB |
master | EncodeArgs |
net472 | 67.7μs | 43.1ns | 161ns | 5.16 | 0.067 | 0 | 32.5 KB |
master | EncodeLegacyArgs |
net6.0 | 74.2μs | 107ns | 416ns | 0 | 0 | 0 | 2.14 KB |
master | EncodeLegacyArgs |
netcoreapp3.1 | 104μs | 163ns | 630ns | 0 | 0 | 0 | 2.14 KB |
master | EncodeLegacyArgs |
net472 | 154μs | 128ns | 497ns | 0.306 | 0 | 0 | 2.15 KB |
#6432 | EncodeArgs |
net6.0 | 39.2μs | 12.3ns | 47.6ns | 0.449 | 0 | 0 | 32.4 KB |
#6432 | EncodeArgs |
netcoreapp3.1 | 54.6μs | 18.5ns | 71.5ns | 0.435 | 0 | 0 | 32.4 KB |
#6432 | EncodeArgs |
net472 | 66.9μs | 43.2ns | 167ns | 5.15 | 0.0669 | 0 | 32.5 KB |
#6432 | EncodeLegacyArgs |
net6.0 | 74.1μs | 15ns | 58.1ns | 0 | 0 | 0 | 2.14 KB |
#6432 | EncodeLegacyArgs |
netcoreapp3.1 | 106μs | 267ns | 1.04μs | 0 | 0 | 0 | 2.14 KB |
#6432 | EncodeLegacyArgs |
net472 | 153μs | 118ns | 458ns | 0.307 | 0 | 0 | 2.15 KB |
Benchmarks.Trace.Asm.AppSecWafBenchmark - Same speed ✔️ Same allocations ✔️
Raw results
Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
---|---|---|---|---|---|---|---|---|---|
master | RunWafRealisticBenchmark |
net6.0 | 181μs | 84ns | 291ns | 0 | 0 | 0 | 2.44 KB |
master | RunWafRealisticBenchmark |
netcoreapp3.1 | 192μs | 249ns | 964ns | 0 | 0 | 0 | 2.39 KB |
master | RunWafRealisticBenchmark |
net472 | 209μs | 180ns | 696ns | 0.309 | 0 | 0 | 2.46 KB |
master | RunWafRealisticBenchmarkWithAttack |
net6.0 | 122μs | 119ns | 461ns | 0 | 0 | 0 | 1.47 KB |
master | RunWafRealisticBenchmarkWithAttack |
netcoreapp3.1 | 129μs | 162ns | 583ns | 0 | 0 | 0 | 1.46 KB |
master | RunWafRealisticBenchmarkWithAttack |
net472 | 139μs | 56.6ns | 219ns | 0.209 | 0 | 0 | 1.49 KB |
#6432 | RunWafRealisticBenchmark |
net6.0 | 183μs | 279ns | 1.08μs | 0 | 0 | 0 | 2.44 KB |
#6432 | RunWafRealisticBenchmark |
netcoreapp3.1 | 193μs | 295ns | 1.1μs | 0 | 0 | 0 | 2.39 KB |
#6432 | RunWafRealisticBenchmark |
net472 | 208μs | 110ns | 413ns | 0.311 | 0 | 0 | 2.46 KB |
#6432 | RunWafRealisticBenchmarkWithAttack |
net6.0 | 121μs | 71.5ns | 267ns | 0 | 0 | 0 | 1.47 KB |
#6432 | RunWafRealisticBenchmarkWithAttack |
netcoreapp3.1 | 129μs | 96.6ns | 348ns | 0 | 0 | 0 | 1.46 KB |
#6432 | RunWafRealisticBenchmarkWithAttack |
net472 | 139μs | 100ns | 387ns | 0.208 | 0 | 0 | 1.49 KB |
Benchmarks.Trace.Iast.StringAspectsBenchmark - Same speed ✔️ More allocations ⚠️
More allocations ⚠️ in #6432
Benchmark
Base Allocated
Diff Allocated
Change
Change %
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑net6.0
257.94 KB
265.46 KB
7.52 KB
2.92%
Fewer allocations 🎉 in #6432
Benchmark
Base Allocated
Diff Allocated
Change
Change %
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark‑net472
61.66 KB
59.07 KB
-2.59 KB
-4.20%
Benchmark | Base Allocated | Diff Allocated | Change | Change % |
---|---|---|---|---|
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑net6.0 | 257.94 KB | 265.46 KB | 7.52 KB | 2.92% |
Benchmark | Base Allocated | Diff Allocated | Change | Change % |
---|---|---|---|---|
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark‑net472 | 61.66 KB | 59.07 KB | -2.59 KB | -4.20% |
Raw results
Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
---|---|---|---|---|---|---|---|---|---|
master | StringConcatBenchmark |
net6.0 | 52.3μs | 249ns | 932ns | 0 | 0 | 0 | 43.44 KB |
master | StringConcatBenchmark |
netcoreapp3.1 | 53.4μs | 176ns | 660ns | 0 | 0 | 0 | 42.64 KB |
master | StringConcatBenchmark |
net472 | 36.4μs | 80.4ns | 290ns | 0 | 0 | 0 | 61.66 KB |
master | StringConcatAspectBenchmark |
net6.0 | 310μs | 1.09μs | 3.92μs | 0 | 0 | 0 | 257.94 KB |
master | StringConcatAspectBenchmark |
netcoreapp3.1 | 333μs | 1.74μs | 9.37μs | 0 | 0 | 0 | 253.05 KB |
master | StringConcatAspectBenchmark |
net472 | 284μs | 6.2μs | 59.5μs | 0 | 0 | 0 | 278.53 KB |
#6432 | StringConcatBenchmark |
net6.0 | 58.9μs | 638ns | 6.38μs | 0 | 0 | 0 | 43.44 KB |
#6432 | StringConcatBenchmark |
netcoreapp3.1 | 52.8μs | 259ns | 1.04μs | 0 | 0 | 0 | 42.64 KB |
#6432 | StringConcatBenchmark |
net472 | 37.1μs | 80.4ns | 301ns | 0 | 0 | 0 | 59.07 KB |
#6432 | StringConcatAspectBenchmark |
net6.0 | 296μs | 4.62μs | 43.8μs | 0 | 0 | 0 | 265.46 KB |
#6432 | StringConcatAspectBenchmark |
netcoreapp3.1 | 337μs | 1.61μs | 12.5μs | 0 | 0 | 0 | 252.01 KB |
#6432 | StringConcatAspectBenchmark |
net472 | 278μs | 5.7μs | 54.6μs | 0 | 0 | 0 | 278.53 KB |
Snapshots difference summaryThe following differences have been observed in committed snapshots. It is meant to help the reviewer. 1 occurrences of : - TraceId: Id_1,
- SpanId: Id_4,
+ TraceId: Id_4,
+ SpanId: Id_5,
[...]
- ParentId: Id_5,
+ ParentId: Id_6,
1 occurrences of : - TraceId: Id_1,
- SpanId: Id_6,
+ TraceId: Id_7,
+ SpanId: Id_8,
[...]
- ParentId: Id_7,
+ ParentId: Id_9,
1 occurrences of : - TraceId: Id_1,
- SpanId: Id_8,
+ TraceId: Id_10,
+ SpanId: Id_11,
[...]
- ParentId: Id_9,
+ ParentId: Id_12,
|
@@ -17,7 +17,7 @@ internal class SymmetricAlgorithmIntegrationCommon | |||
internal const IntegrationId IntegrationId = Configuration.IntegrationId.SymmetricAlgorithm; | |||
private static readonly IDatadogLogger Log = DatadogLogging.GetLoggerFor(typeof(SymmetricAlgorithmIntegrationCommon)); | |||
|
|||
internal static Scope? CreateScope<TTarget>(TTarget instance) | |||
internal static Scope? CreateScope<TTarget>(TTarget instance, bool autoCloseScopeWhenSingleSpan = true) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand why this isn't used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right. Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
Thanks for your feedback and reviews! |
Summary of changes
When running an app out of a request context, we were not closing the scope after creating a vulnerability span in the case of an IAST weak random vulnerability. That would make the tracer to stop sending spans and would store them forever, taking an increasing amount of memory.
Basically, in the method close_span of the class traceContext, the variable _openSpans would never reach 0, so the array _spans would never be empty and would keep storing spans forever.
The problem is that, in the System.Random aspect, we were not closing the scope/span, which we were actually doing in other aspects such as the weak hash aspect.
A little refactor has been done. Now, by default, we close an IAST vulnerability span right after creation in non request scenarios. In the call target instrumentations, we already handle the closing of the span, so the IAST instrumentations that can be launched in non request scenarios will keep the span closing that was already implemented.
A filter has been added to avoid instrumenting the Grpc.Net.Client assembly. We were reporting a vulnerability inside this library that was adding noise.
In the deduplication tests, a new random.Next call has been added. Before the implemented changes, this test would receive no spans from the tracer after adding the Random.Next call.
Reason for change
Implementation details
Test coverage
Other details