Removing MetaStruct check from TestSessionTimeoutVulnerability#6395
Conversation
Snapshots difference summaryThe following differences have been observed in committed snapshots. It is meant to help the reviewer. 1 occurrences of : - },
- MetaStruct: {
- iast:
|
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 (6395) - mean (69ms) : 66, 72
. : milestone, 69,
master - mean (69ms) : 66, 71
. : milestone, 69,
section CallTarget+Inlining+NGEN
This PR (6395) - mean (980ms) : 957, 1003
. : milestone, 980,
master - mean (977ms) : 957, 998
. : milestone, 977,
gantt
title Execution time (ms) FakeDbCommand (.NET Core 3.1)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6395) - mean (108ms) : 106, 111
. : milestone, 108,
master - mean (108ms) : 106, 110
. : milestone, 108,
section CallTarget+Inlining+NGEN
This PR (6395) - mean (685ms) : 665, 706
. : milestone, 685,
master - mean (679ms) : 665, 692
. : milestone, 679,
gantt
title Execution time (ms) FakeDbCommand (.NET 6)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6395) - mean (92ms) : 90, 93
. : milestone, 92,
master - mean (91ms) : 89, 93
. : milestone, 91,
section CallTarget+Inlining+NGEN
This PR (6395) - mean (636ms) : 618, 654
. : milestone, 636,
master - mean (633ms) : 617, 648
. : milestone, 633,
gantt
title Execution time (ms) HttpMessageHandler (.NET Framework 4.6.2)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6395) - mean (190ms) : 186, 194
. : milestone, 190,
master - mean (190ms) : 186, 194
. : milestone, 190,
section CallTarget+Inlining+NGEN
This PR (6395) - mean (1,093ms) : 1064, 1121
. : milestone, 1093,
master - mean (1,092ms) : 1055, 1128
. : milestone, 1092,
gantt
title Execution time (ms) HttpMessageHandler (.NET Core 3.1)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6395) - mean (277ms) : 272, 281
. : milestone, 277,
master - mean (277ms) : 273, 281
. : milestone, 277,
section CallTarget+Inlining+NGEN
This PR (6395) - mean (872ms) : 844, 900
. : milestone, 872,
master - mean (869ms) : 842, 895
. : milestone, 869,
gantt
title Execution time (ms) HttpMessageHandler (.NET 6)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6395) - mean (267ms) : 258, 276
. : milestone, 267,
master - mean (265ms) : 261, 269
. : milestone, 265,
section CallTarget+Inlining+NGEN
This PR (6395) - mean (853ms) : 818, 888
. : milestone, 853,
master - mean (852ms) : 818, 886
. : milestone, 852,
|
Datadog ReportBranch report: ✅ 0 Failed, 452169 Passed, 2739 Skipped, 19h 33m 38.58s Total Time |
Benchmarks Report for appsec 🐌Benchmarks for #6395 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 - Slower
|
| Benchmark | diff/base | Base Median (ns) | Diff Median (ns) | Modality |
|---|---|---|---|---|
| Benchmarks.Trace.Asm.AppSecBodyBenchmark.ObjectExtractorSimpleBody‑netcoreapp3.1 | 1.121 | 199.17 | 223.32 |
| Benchmark | base/diff | Base Median (ns) | Diff Median (ns) | Modality |
|---|---|---|---|---|
| Benchmarks.Trace.Asm.AppSecBodyBenchmark.ObjectExtractorSimpleBody‑net6.0 | 1.192 | 181.67 | 152.36 |
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | AllCycleSimpleBody |
net6.0 | 218μs | 168ns | 628ns | 2.5 | 0 | 0 | 176.82 KB |
| master | AllCycleSimpleBody |
netcoreapp3.1 | 306μs | 201ns | 778ns | 2.45 | 0 | 0 | 184.26 KB |
| master | AllCycleSimpleBody |
net472 | 285μs | 574ns | 2.22μs | 33.4 | 2.53 | 0 | 210.04 KB |
| master | AllCycleMoreComplexBody |
net6.0 | 225μs | 202ns | 781ns | 2.45 | 0 | 0 | 180.33 KB |
| master | AllCycleMoreComplexBody |
netcoreapp3.1 | 336μs | 125ns | 469ns | 2.51 | 0 | 0 | 187.68 KB |
| master | AllCycleMoreComplexBody |
net472 | 291μs | 511ns | 1.98μs | 33.9 | 2.49 | 0 | 213.56 KB |
| master | ObjectExtractorSimpleBody |
net6.0 | 182ns | 0.104ns | 0.388ns | 0.00394 | 0 | 0 | 280 B |
| master | ObjectExtractorSimpleBody |
netcoreapp3.1 | 199ns | 0.203ns | 0.759ns | 0.00371 | 0 | 0 | 272 B |
| master | ObjectExtractorSimpleBody |
net472 | 211ns | 0.246ns | 0.953ns | 0.0446 | 0 | 0 | 281 B |
| master | ObjectExtractorMoreComplexBody |
net6.0 | 2.96μs | 1.64ns | 6.14ns | 0.0534 | 0 | 0 | 3.78 KB |
| master | ObjectExtractorMoreComplexBody |
netcoreapp3.1 | 3.86μs | 2.11ns | 7.89ns | 0.0503 | 0 | 0 | 3.69 KB |
| master | ObjectExtractorMoreComplexBody |
net472 | 4.34μs | 5.78ns | 22.4ns | 0.603 | 0.00651 | 0 | 3.8 KB |
| #6395 | AllCycleSimpleBody |
net6.0 | 222μs | 162ns | 628ns | 2.45 | 0 | 0 | 176.82 KB |
| #6395 | AllCycleSimpleBody |
netcoreapp3.1 | 315μs | 168ns | 628ns | 2.39 | 0 | 0 | 184.26 KB |
| #6395 | AllCycleSimpleBody |
net472 | 289μs | 447ns | 1.73μs | 33.3 | 2.58 | 0 | 210.04 KB |
| #6395 | AllCycleMoreComplexBody |
net6.0 | 220μs | 125ns | 450ns | 2.54 | 0 | 0 | 180.33 KB |
| #6395 | AllCycleMoreComplexBody |
netcoreapp3.1 | 326μs | 186ns | 720ns | 2.49 | 0 | 0 | 187.68 KB |
| #6395 | AllCycleMoreComplexBody |
net472 | 302μs | 871ns | 3.37μs | 33.9 | 2.63 | 0 | 213.56 KB |
| #6395 | ObjectExtractorSimpleBody |
net6.0 | 152ns | 0.0814ns | 0.305ns | 0.00391 | 0 | 0 | 280 B |
| #6395 | ObjectExtractorSimpleBody |
netcoreapp3.1 | 223ns | 0.114ns | 0.44ns | 0.00372 | 0 | 0 | 272 B |
| #6395 | ObjectExtractorSimpleBody |
net472 | 215ns | 0.54ns | 2.09ns | 0.0446 | 0 | 0 | 281 B |
| #6395 | ObjectExtractorMoreComplexBody |
net6.0 | 2.99μs | 2.06ns | 7.71ns | 0.0533 | 0 | 0 | 3.78 KB |
| #6395 | ObjectExtractorMoreComplexBody |
netcoreapp3.1 | 3.68μs | 2.39ns | 8.94ns | 0.0498 | 0 | 0 | 3.69 KB |
| #6395 | ObjectExtractorMoreComplexBody |
net472 | 4.42μs | 7.27ns | 28.1ns | 0.602 | 0.0065 | 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 | 38.6μs | 21.2ns | 79.5ns | 0.457 | 0 | 0 | 32.4 KB |
| master | EncodeArgs |
netcoreapp3.1 | 54.3μs | 30.9ns | 107ns | 0.431 | 0 | 0 | 32.4 KB |
| master | EncodeArgs |
net472 | 68.2μs | 56.8ns | 213ns | 5.14 | 0.068 | 0 | 32.5 KB |
| master | EncodeLegacyArgs |
net6.0 | 79.5μs | 142ns | 548ns | 0 | 0 | 0 | 2.14 KB |
| master | EncodeLegacyArgs |
netcoreapp3.1 | 105μs | 327ns | 1.27μs | 0 | 0 | 0 | 2.14 KB |
| master | EncodeLegacyArgs |
net472 | 160μs | 83.9ns | 325ns | 0.321 | 0 | 0 | 2.15 KB |
| #6395 | EncodeArgs |
net6.0 | 37.2μs | 28.7ns | 107ns | 0.447 | 0 | 0 | 32.4 KB |
| #6395 | EncodeArgs |
netcoreapp3.1 | 54.3μs | 19.4ns | 72.6ns | 0.431 | 0 | 0 | 32.4 KB |
| #6395 | EncodeArgs |
net472 | 69.2μs | 77.9ns | 302ns | 5.14 | 0.0694 | 0 | 32.5 KB |
| #6395 | EncodeLegacyArgs |
net6.0 | 71.9μs | 48.4ns | 181ns | 0.0359 | 0 | 0 | 2.14 KB |
| #6395 | EncodeLegacyArgs |
netcoreapp3.1 | 106μs | 391ns | 1.51μs | 0 | 0 | 0 | 2.14 KB |
| #6395 | EncodeLegacyArgs |
net472 | 156μs | 48.5ns | 181ns | 0.315 | 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 | 186μs | 310ns | 1.2μs | 0 | 0 | 0 | 2.44 KB |
| master | RunWafRealisticBenchmark |
netcoreapp3.1 | 194μs | 109ns | 392ns | 0 | 0 | 0 | 2.39 KB |
| master | RunWafRealisticBenchmark |
net472 | 211μs | 110ns | 425ns | 0.316 | 0 | 0 | 2.46 KB |
| master | RunWafRealisticBenchmarkWithAttack |
net6.0 | 124μs | 62.9ns | 244ns | 0 | 0 | 0 | 1.47 KB |
| master | RunWafRealisticBenchmarkWithAttack |
netcoreapp3.1 | 130μs | 98.3ns | 381ns | 0 | 0 | 0 | 1.46 KB |
| master | RunWafRealisticBenchmarkWithAttack |
net472 | 141μs | 180ns | 696ns | 0.209 | 0 | 0 | 1.49 KB |
| #6395 | RunWafRealisticBenchmark |
net6.0 | 183μs | 148ns | 574ns | 0 | 0 | 0 | 2.44 KB |
| #6395 | RunWafRealisticBenchmark |
netcoreapp3.1 | 196μs | 183ns | 709ns | 0 | 0 | 0 | 2.39 KB |
| #6395 | RunWafRealisticBenchmark |
net472 | 209μs | 119ns | 459ns | 0.311 | 0 | 0 | 2.46 KB |
| #6395 | RunWafRealisticBenchmarkWithAttack |
net6.0 | 124μs | 49.5ns | 185ns | 0 | 0 | 0 | 1.47 KB |
| #6395 | RunWafRealisticBenchmarkWithAttack |
netcoreapp3.1 | 129μs | 117ns | 439ns | 0 | 0 | 0 | 1.46 KB |
| #6395 | RunWafRealisticBenchmarkWithAttack |
net472 | 139μs | 52.1ns | 202ns | 0.209 | 0 | 0 | 1.49 KB |
Benchmarks.Trace.Iast.StringAspectsBenchmark - Same speed ✔️ Fewer allocations 🎉
Fewer allocations 🎉 in #6395
Benchmark
Base Allocated
Diff Allocated
Change
Change %
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark‑net472
62.21 KB
60.91 KB
-1.3 KB
-2.08%
| Benchmark | Base Allocated | Diff Allocated | Change | Change % |
|---|---|---|---|---|
| Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark‑net472 | 62.21 KB | 60.91 KB | -1.3 KB | -2.08% |
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | StringConcatBenchmark |
net6.0 | 57.4μs | 625ns | 6.15μs | 0 | 0 | 0 | 43.44 KB |
| master | StringConcatBenchmark |
netcoreapp3.1 | 58.6μs | 673ns | 6.45μs | 0 | 0 | 0 | 42.64 KB |
| master | StringConcatBenchmark |
net472 | 37.9μs | 49.4ns | 171ns | 0 | 0 | 0 | 62.21 KB |
| master | StringConcatAspectBenchmark |
net6.0 | 317μs | 1.44μs | 8.4μs | 0 | 0 | 0 | 255.74 KB |
| master | StringConcatAspectBenchmark |
netcoreapp3.1 | 338μs | 2.17μs | 20.8μs | 0 | 0 | 0 | 253.86 KB |
| master | StringConcatAspectBenchmark |
net472 | 288μs | 5.69μs | 55.4μs | 0 | 0 | 0 | 278.53 KB |
| #6395 | StringConcatBenchmark |
net6.0 | 52.9μs | 291ns | 2.13μs | 0 | 0 | 0 | 43.44 KB |
| #6395 | StringConcatBenchmark |
netcoreapp3.1 | 59.5μs | 712ns | 6.87μs | 0 | 0 | 0 | 42.64 KB |
| #6395 | StringConcatBenchmark |
net472 | 37.4μs | 77.9ns | 291ns | 0 | 0 | 0 | 60.91 KB |
| #6395 | StringConcatAspectBenchmark |
net6.0 | 323μs | 6.21μs | 61.4μs | 0 | 0 | 0 | 255.02 KB |
| #6395 | StringConcatAspectBenchmark |
netcoreapp3.1 | 341μs | 1.51μs | 9.06μs | 0 | 0 | 0 | 253.62 KB |
| #6395 | StringConcatAspectBenchmark |
net472 | 307μs | 7.05μs | 69.4μs | 0 | 0 | 0 | 278.53 KB |
Benchmarks Report for tracer 🐌Benchmarks for #6395 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 - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.SerilogBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.SpanBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.TraceAnnotationsBenchmark - Same speed ✔️ Same allocations ✔️Raw results
|
andrewlock
left a comment
There was a problem hiding this comment.
It would be good to understand why this is flaky 🤔 Can someone from ASM shed light on it?
So speaking with @e-n-0 in Slack and from my understanding on this it could be that the vulnerability is reported very early on this tests which could be happening before agent config is fetched so instead it falls back to the Json. |
e-n-0
left a comment
There was a problem hiding this comment.
Thanks for the PR 😄
In the previous merged PR, I added meta struct support to iast. The vulnerability data is stored in meta struct if the config of the agent say it's compatible, so we need it.
As mentioned by Maximo, as the vulnerability is triggered at the start of the application, the agent config might not be loaded yet by the tracer, thus fallbacking to the json serialization (and the missing metastruct part from snapshot).
## Summary of changes Same as #6395 this test is part of the same family and I just noticed it also sometimes flakes without the expected snapshot.
## Summary of changes
Disabling SpanMetaStructs from Agent used in related test and snapshot
file.
## Reason for change
After recent PR got merged test started flaking in master, but since the
feature is already tested somewhere else as expected removing from this
test to prevent flakes.
## Implementation details
Setting:
```await TryStartApp(newFixture, new MockTracerAgent.AgentConfiguration { SpanMetaStructs = false });```
Removing the below from the received snapshot:
```
},
MetaStruct: {
iast:
```
## Test coverage
The test.
## Summary of changes Same as #6395 this test is part of the same family and I just noticed it also sometimes flakes without the expected snapshot.
Summary of changes
Disabling SpanMetaStructs from Agent used in related test and snapshot file.
Reason for change
After recent PR got merged test started flaking in master, but since the feature is already tested somewhere else as expected removing from this test to prevent flakes.
Implementation details
Setting:
await TryStartApp(newFixture, new MockTracerAgent.AgentConfiguration { SpanMetaStructs = false });Removing the below from the received snapshot:
Test coverage
The test.