-
Notifications
You must be signed in to change notification settings - Fork 140
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 bug RC empty key #6058
Conversation
Datadog ReportBranch report: ✅ 0 Failed, 371021 Passed, 2079 Skipped, 16h 25m 52.73s Total Time |
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 (6058) - mean (70ms) : 67, 72
. : milestone, 70,
master - mean (70ms) : 67, 73
. : milestone, 70,
section CallTarget+Inlining+NGEN
This PR (6058) - mean (1,099ms) : 1080, 1117
. : milestone, 1099,
master - mean (1,105ms) : 1067, 1143
. : milestone, 1105,
gantt
title Execution time (ms) FakeDbCommand (.NET Core 3.1)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6058) - mean (108ms) : 105, 112
. : milestone, 108,
master - mean (109ms) : 105, 112
. : milestone, 109,
section CallTarget+Inlining+NGEN
This PR (6058) - mean (762ms) : 750, 774
. : milestone, 762,
master - mean (766ms) : 751, 782
. : milestone, 766,
gantt
title Execution time (ms) FakeDbCommand (.NET 6)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6058) - mean (92ms) : 90, 94
. : milestone, 92,
master - mean (92ms) : 90, 94
. : milestone, 92,
section CallTarget+Inlining+NGEN
This PR (6058) - mean (721ms) : 706, 736
. : milestone, 721,
master - mean (727ms) : 707, 747
. : milestone, 727,
gantt
title Execution time (ms) HttpMessageHandler (.NET Framework 4.6.2)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6058) - mean (190ms) : 187, 193
. : milestone, 190,
master - mean (191ms) : 187, 195
. : milestone, 191,
section CallTarget+Inlining+NGEN
This PR (6058) - mean (1,192ms) : 1169, 1214
. : milestone, 1192,
master - mean (1,202ms) : 1165, 1240
. : milestone, 1202,
gantt
title Execution time (ms) HttpMessageHandler (.NET Core 3.1)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6058) - mean (276ms) : 273, 280
. : milestone, 276,
master - mean (276ms) : 270, 281
. : milestone, 276,
section CallTarget+Inlining+NGEN
This PR (6058) - mean (935ms) : 916, 955
. : milestone, 935,
master - mean (938ms) : 918, 958
. : milestone, 938,
gantt
title Execution time (ms) HttpMessageHandler (.NET 6)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6058) - mean (265ms) : 261, 268
. : milestone, 265,
master - mean (265ms) : 261, 269
. : milestone, 265,
section CallTarget+Inlining+NGEN
This PR (6058) - mean (921ms) : 904, 939
. : milestone, 921,
master - mean (922ms) : 906, 939
. : milestone, 922,
|
Benchmarks Report for appsec 🐌Benchmarks for #6058 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.142 | 189.33 | 216.21 |
Benchmark | base/diff | Base Median (ns) | Diff Median (ns) | Modality |
---|---|---|---|---|
Benchmarks.Trace.Asm.AppSecBodyBenchmark.ObjectExtractorSimpleBody‑net472 | 1.185 | 209.22 | 176.49 |
Raw results
Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
---|---|---|---|---|---|---|---|---|---|
master | AllCycleSimpleBody |
net6.0 | 73μs | 87.5ns | 339ns | 0.0722 | 0 | 0 | 6 KB |
master | AllCycleSimpleBody |
netcoreapp3.1 | 61.3μs | 87.8ns | 340ns | 0.0922 | 0 | 0 | 6.95 KB |
master | AllCycleSimpleBody |
net472 | 48.1μs | 51.7ns | 200ns | 1.3 | 0 | 0 | 8.34 KB |
master | AllCycleMoreComplexBody |
net6.0 | 78.3μs | 114ns | 443ns | 0.117 | 0 | 0 | 9.51 KB |
master | AllCycleMoreComplexBody |
netcoreapp3.1 | 69μs | 111ns | 432ns | 0.137 | 0 | 0 | 10.36 KB |
master | AllCycleMoreComplexBody |
net472 | 55.5μs | 71.7ns | 278ns | 1.87 | 0.0279 | 0 | 11.85 KB |
master | ObjectExtractorSimpleBody |
net6.0 | 139ns | 0.0954ns | 0.369ns | 0.00396 | 0 | 0 | 280 B |
master | ObjectExtractorSimpleBody |
netcoreapp3.1 | 189ns | 0.359ns | 1.39ns | 0.00367 | 0 | 0 | 272 B |
master | ObjectExtractorSimpleBody |
net472 | 209ns | 0.158ns | 0.614ns | 0.0446 | 0 | 0 | 281 B |
master | ObjectExtractorMoreComplexBody |
net6.0 | 3μs | 1.9ns | 7.34ns | 0.0525 | 0 | 0 | 3.78 KB |
master | ObjectExtractorMoreComplexBody |
netcoreapp3.1 | 4.03μs | 1.93ns | 6.95ns | 0.0485 | 0 | 0 | 3.69 KB |
master | ObjectExtractorMoreComplexBody |
net472 | 3.89μs | 2.36ns | 8.81ns | 0.602 | 0.00586 | 0 | 3.8 KB |
#6058 | AllCycleSimpleBody |
net6.0 | 72.9μs | 117ns | 453ns | 0.0726 | 0 | 0 | 6 KB |
#6058 | AllCycleSimpleBody |
netcoreapp3.1 | 63.6μs | 89.5ns | 347ns | 0.0953 | 0 | 0 | 6.95 KB |
#6058 | AllCycleSimpleBody |
net472 | 48.1μs | 22.7ns | 81.7ns | 1.32 | 0 | 0 | 8.34 KB |
#6058 | AllCycleMoreComplexBody |
net6.0 | 80.8μs | 119ns | 459ns | 0.117 | 0 | 0 | 9.51 KB |
#6058 | AllCycleMoreComplexBody |
netcoreapp3.1 | 69.4μs | 116ns | 448ns | 0.138 | 0 | 0 | 10.36 KB |
#6058 | AllCycleMoreComplexBody |
net472 | 54.7μs | 51.1ns | 191ns | 1.88 | 0.0273 | 0 | 11.85 KB |
#6058 | ObjectExtractorSimpleBody |
net6.0 | 139ns | 0.135ns | 0.505ns | 0.0039 | 0 | 0 | 280 B |
#6058 | ObjectExtractorSimpleBody |
netcoreapp3.1 | 216ns | 0.395ns | 1.53ns | 0.00371 | 0 | 0 | 272 B |
#6058 | ObjectExtractorSimpleBody |
net472 | 176ns | 0.228ns | 0.883ns | 0.0446 | 0 | 0 | 281 B |
#6058 | ObjectExtractorMoreComplexBody |
net6.0 | 3.06μs | 2.3ns | 8.59ns | 0.0534 | 0 | 0 | 3.78 KB |
#6058 | ObjectExtractorMoreComplexBody |
netcoreapp3.1 | 3.93μs | 2.1ns | 7.86ns | 0.0487 | 0 | 0 | 3.69 KB |
#6058 | ObjectExtractorMoreComplexBody |
net472 | 3.8μs | 3.21ns | 12.4ns | 0.602 | 0.0057 | 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 | 35.9μs | 12.4ns | 48.1ns | 0.449 | 0 | 0 | 32.4 KB |
master | EncodeArgs |
netcoreapp3.1 | 54.5μs | 22.6ns | 87.4ns | 0.435 | 0 | 0 | 32.4 KB |
master | EncodeArgs |
net472 | 66.3μs | 34.3ns | 133ns | 5.15 | 0.0661 | 0 | 32.5 KB |
master | EncodeLegacyArgs |
net6.0 | 70.2μs | 15.6ns | 60.6ns | 0 | 0 | 0 | 2.14 KB |
master | EncodeLegacyArgs |
netcoreapp3.1 | 106μs | 374ns | 1.45μs | 0 | 0 | 0 | 2.14 KB |
master | EncodeLegacyArgs |
net472 | 152μs | 64.2ns | 249ns | 0.302 | 0 | 0 | 2.15 KB |
#6058 | EncodeArgs |
net6.0 | 38μs | 28.2ns | 109ns | 0.449 | 0 | 0 | 32.4 KB |
#6058 | EncodeArgs |
netcoreapp3.1 | 54.1μs | 15.3ns | 57.2ns | 0.431 | 0 | 0 | 32.4 KB |
#6058 | EncodeArgs |
net472 | 65.8μs | 41.9ns | 162ns | 5.13 | 0.0658 | 0 | 32.5 KB |
#6058 | EncodeLegacyArgs |
net6.0 | 76.6μs | 35.2ns | 137ns | 0 | 0 | 0 | 2.14 KB |
#6058 | EncodeLegacyArgs |
netcoreapp3.1 | 105μs | 359ns | 1.39μs | 0 | 0 | 0 | 2.14 KB |
#6058 | EncodeLegacyArgs |
net472 | 152μs | 151ns | 586ns | 0.304 | 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 | 184μs | 57ns | 197ns | 0 | 0 | 0 | 2.44 KB |
master | RunWafRealisticBenchmark |
netcoreapp3.1 | 197μs | 235ns | 909ns | 0 | 0 | 0 | 2.39 KB |
master | RunWafRealisticBenchmark |
net472 | 208μs | 127ns | 477ns | 0.314 | 0 | 0 | 2.46 KB |
master | RunWafRealisticBenchmarkWithAttack |
net6.0 | 122μs | 44.5ns | 166ns | 0 | 0 | 0 | 1.47 KB |
master | RunWafRealisticBenchmarkWithAttack |
netcoreapp3.1 | 129μs | 93.5ns | 350ns | 0 | 0 | 0 | 1.46 KB |
master | RunWafRealisticBenchmarkWithAttack |
net472 | 139μs | 53.1ns | 206ns | 0.209 | 0 | 0 | 1.49 KB |
#6058 | RunWafRealisticBenchmark |
net6.0 | 185μs | 51.8ns | 194ns | 0 | 0 | 0 | 2.44 KB |
#6058 | RunWafRealisticBenchmark |
netcoreapp3.1 | 199μs | 280ns | 1.08μs | 0 | 0 | 0 | 2.39 KB |
#6058 | RunWafRealisticBenchmark |
net472 | 208μs | 45.6ns | 164ns | 0.311 | 0 | 0 | 2.46 KB |
#6058 | RunWafRealisticBenchmarkWithAttack |
net6.0 | 122μs | 37.1ns | 139ns | 0 | 0 | 0 | 1.47 KB |
#6058 | RunWafRealisticBenchmarkWithAttack |
netcoreapp3.1 | 130μs | 69ns | 267ns | 0 | 0 | 0 | 1.46 KB |
#6058 | RunWafRealisticBenchmarkWithAttack |
net472 | 138μs | 25.3ns | 91.3ns | 0.207 | 0 | 0 | 1.49 KB |
Benchmarks.Trace.Iast.StringAspectsBenchmark - Same speed ✔️ More allocations ⚠️
More allocations ⚠️ in #6058
Benchmark
Base Allocated
Diff Allocated
Change
Change %
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑net6.0
255.36 KB
263.99 KB
8.63 KB
3.38%
Fewer allocations 🎉 in #6058
Benchmark
Base Allocated
Diff Allocated
Change
Change %
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark‑net472
59.39 KB
59.04 KB
-352 B
-0.59%
Benchmark | Base Allocated | Diff Allocated | Change | Change % |
---|---|---|---|---|
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑net6.0 | 255.36 KB | 263.99 KB | 8.63 KB | 3.38% |
Benchmark | Base Allocated | Diff Allocated | Change | Change % |
---|---|---|---|---|
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark‑net472 | 59.39 KB | 59.04 KB | -352 B | -0.59% |
Raw results
Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
---|---|---|---|---|---|---|---|---|---|
master | StringConcatBenchmark |
net6.0 | 59.4μs | 775ns | 7.75μs | 0 | 0 | 0 | 43.44 KB |
master | StringConcatBenchmark |
netcoreapp3.1 | 60.1μs | 722ns | 7.11μs | 0 | 0 | 0 | 42.64 KB |
master | StringConcatBenchmark |
net472 | 37.3μs | 150ns | 562ns | 0 | 0 | 0 | 59.39 KB |
master | StringConcatAspectBenchmark |
net6.0 | 291μs | 5.71μs | 56.6μs | 0 | 0 | 0 | 255.36 KB |
master | StringConcatAspectBenchmark |
netcoreapp3.1 | 334μs | 1.75μs | 11.8μs | 0 | 0 | 0 | 253.17 KB |
master | StringConcatAspectBenchmark |
net472 | 269μs | 5.14μs | 49.8μs | 0 | 0 | 0 | 278.53 KB |
#6058 | StringConcatBenchmark |
net6.0 | 60.3μs | 628ns | 6.12μs | 0 | 0 | 0 | 43.44 KB |
#6058 | StringConcatBenchmark |
netcoreapp3.1 | 62.7μs | 795ns | 7.91μs | 0 | 0 | 0 | 42.64 KB |
#6058 | StringConcatBenchmark |
net472 | 37.3μs | 79.7ns | 287ns | 0 | 0 | 0 | 59.04 KB |
#6058 | StringConcatAspectBenchmark |
net6.0 | 306μs | 1.73μs | 11.2μs | 0 | 0 | 0 | 263.99 KB |
#6058 | StringConcatAspectBenchmark |
netcoreapp3.1 | 334μs | 1.53μs | 6.67μs | 0 | 0 | 0 | 253.21 KB |
#6058 | StringConcatAspectBenchmark |
net472 | 236μs | 939ns | 3.25μs | 0 | 0 | 0 | 278.53 KB |
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 (6058) (11.020M) : 0, 11020144
master (11.101M) : 0, 11101013
benchmarks/2.9.0 (11.081M) : 0, 11080577
section Automatic
This PR (6058) (7.291M) : 0, 7291344
master (7.322M) : 0, 7321945
benchmarks/2.9.0 (7.732M) : 0, 7732233
section Trace stats
master (7.648M) : 0, 7647979
section Manual
master (11.159M) : 0, 11158874
section Manual + Automatic
This PR (6058) (6.699M) : 0, 6699016
master (6.756M) : 0, 6755889
section DD_TRACE_ENABLED=0
master (10.104M) : 0, 10103630
gantt
title Throughput Linux arm64 (Total requests)
dateFormat X
axisFormat %s
section Baseline
This PR (6058) (9.504M) : 0, 9503984
master (9.538M) : 0, 9538166
benchmarks/2.9.0 (9.798M) : 0, 9798067
section Automatic
This PR (6058) (6.672M) : 0, 6671570
master (6.560M) : 0, 6559669
section Trace stats
master (6.899M) : 0, 6898524
section Manual
master (9.530M) : 0, 9529944
section Manual + Automatic
This PR (6058) (6.152M) : 0, 6151691
master (6.111M) : 0, 6111240
section DD_TRACE_ENABLED=0
master (8.837M) : 0, 8836832
gantt
title Throughput Windows x64 (Total requests)
dateFormat X
axisFormat %s
section Baseline
This PR (6058) (10.141M) : 0, 10140511
master (10.017M) : 0, 10017307
benchmarks/2.9.0 (10.067M) : 0, 10067315
section Automatic
This PR (6058) (6.581M) : 0, 6580786
master (6.715M) : 0, 6715040
benchmarks/2.9.0 (7.552M) : 0, 7552193
section Trace stats
master (7.357M) : 0, 7357178
section Manual
master (9.959M) : 0, 9958707
section Manual + Automatic
This PR (6058) (6.095M) : 0, 6094768
master (6.139M) : 0, 6139159
section DD_TRACE_ENABLED=0
master (9.384M) : 0, 9383899
|
Benchmarks Report for tracer 🐌Benchmarks for #6058 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
|
c276ae9
to
5addae2
Compare
Snapshots difference summaryThe following differences have been observed in committed snapshots. It is meant to help the reviewer. 1 occurrences of : + },
+ {
+ TraceId: Id_7,
+ SpanId: Id_8,
+ Name: aspnet_core.request,
+ Resource: GET /home/index,
+ Service: Samples.Security.AspNetCore5,
+ Type: web,
+ Tags: {
+ actor.ip: 86.242.244.246,
+ appsec.event: true,
+ aspnet_core.endpoint: Samples.Security.AspNetCore5.Controllers.HomeController.Index (Samples.Security.AspNetCore5),
+ aspnet_core.route: {controller=home}/{action=index}/{id?},
+ component: aspnet_core,
+ env: integration_tests,
+ http.client_ip: 127.0.0.1,
+ http.endpoint: {controller=home}/{action=index}/{id?},
+ http.method: GET,
+ http.request.headers.host: localhost:00000,
+ http.request.headers.user-agent: dd-test-scanner-log-block,
+ http.request.headers.x-forwarded-for: 86.242.244.246,
+ http.response.headers.content-type: text/html; charset=utf-8,
+ http.route: {controller=home}/{action=index}/{id?},
+ http.status_code: 200,
+ http.url: http://localhost:00000/,
+ http.useragent: dd-test-scanner-log-block,
+ language: dotnet,
+ network.client.ip: 127.0.0.1,
+ runtime-id: Guid_1,
+ span.kind: server,
+ _dd.appsec.json: {"triggers":[{"rule":{"id":"new-test-non-blocking","name":"Datadog test scanner - NON blocking version: user-agent","tags":{"category":"attack_attempt","type":"attack_tool"}},"rule_matches":[{"operator":"match_regex","operator_value":"^dd-test-scanner-log-block(?:$|/|\\s)","parameters":[{"address":"server.request.headers.no_cookies","highlight":["dd-test-scanner-log-block"],"key_path":["user-agent","0"],"value":"dd-test-scanner-log-block"}]}]}]},
+ _dd.origin: appsec,
+ _dd.runtime_family: dotnet
+ },
+ Metrics: {
+ process_id: 0,
+ _dd.appsec.enabled: 1.0,
+ _dd.appsec.waf.duration: 0.0,
+ _dd.appsec.waf.duration_ext: 0.0,
+ _dd.top_level: 1.0,
+ _dd.tracer_kr: 1.0,
+ _sampling_priority_v1: 2.0
+ },
+ MetaStruct: {
+ appsec:
+ }
+ },
+ {
+ TraceId: Id_9,
+ SpanId: Id_10,
+ Name: aspnet_core.request,
+ Resource: GET /,
+ Service: Samples.Security.AspNetCore5,
+ Type: web,
+ Tags: {
+ actor.ip: 86.242.244.246,
+ appsec.blocked: true,
+ appsec.event: true,
+ component: aspnet_core,
+ env: integration_tests,
+ http.client_ip: 127.0.0.1,
+ http.method: GET,
+ http.request.headers.host: localhost:00000,
+ http.request.headers.user-agent: dd-test-scanner-log-block,
+ http.request.headers.x-forwarded-for: 86.242.244.246,
+ http.response.headers.content-type: application/json,
+ http.status_code: 405,
+ http.url: http://localhost:00000/,
+ http.useragent: dd-test-scanner-log-block,
+ language: dotnet,
+ network.client.ip: 127.0.0.1,
+ runtime-id: Guid_1,
+ span.kind: server,
+ _dd.appsec.json: {"triggers":[{"rule":{"id":"ua0-600-56x","name":"Datadog test scanner - blocking version: user-agent","tags":{"category":"attack_attempt","type":"attack_tool"}},"rule_matches":[{"operator":"match_regex","operator_value":"^dd-test-scanner-log-block(?:$|/|\\s)","parameters":[{"address":"server.request.headers.no_cookies","highlight":["dd-test-scanner-log-block"],"key_path":["user-agent","0"],"value":"dd-test-scanner-log-block"}]}]}]},
+ _dd.origin: appsec,
+ _dd.runtime_family: dotnet
+ },
+ Metrics: {
+ process_id: 0,
+ _dd.appsec.enabled: 1.0,
+ _dd.appsec.waf.duration: 0.0,
+ _dd.appsec.waf.duration_ext: 0.0,
+ _dd.top_level: 1.0,
+ _dd.tracer_kr: 1.0,
+ _sampling_priority_v1: 2.0
+ },
+ MetaStruct: {
+ appsec:
+ }
+ },
+ {
+ TraceId: Id_11,
+ SpanId: Id_12,
+ Name: aspnet_core.request,
+ Resource: GET /,
+ Service: Samples.Security.AspNetCore5,
+ Type: web,
+ Tags: {
+ actor.ip: 86.242.244.246,
+ appsec.blocked: true,
+ appsec.event: true,
+ component: aspnet_core,
+ env: integration_tests,
+ http.client_ip: 127.0.0.1,
+ http.method: GET,
+ http.request.headers.host: localhost:00000,
+ http.request.headers.user-agent: dd-test-scanner-log-block,
+ http.request.headers.x-forwarded-for: 86.242.244.246,
+ http.response.headers.content-type: application/json,
+ http.status_code: 403,
+ http.url: http://localhost:00000/,
+ http.useragent: dd-test-scanner-log-block,
+ language: dotnet,
+ network.client.ip: 127.0.0.1,
+ runtime-id: Guid_1,
+ span.kind: server,
+ _dd.appsec.json: {"triggers":[{"rule":{"id":"ua0-600-56x","name":"Datadog test scanner - blocking version: user-agent","tags":{"category":"attack_attempt","type":"attack_tool"}},"rule_matches":[{"operator":"match_regex","operator_value":"^dd-test-scanner-log-block(?:$|/|\\s)","parameters":[{"address":"server.request.headers.no_cookies","highlight":["dd-test-scanner-log-block"],"key_path":["user-agent","0"],"value":"dd-test-scanner-log-block"}]}]}]},
+ _dd.origin: appsec,
+ _dd.runtime_family: dotnet
+ },
+ Metrics: {
+ process_id: 0,
+ _dd.appsec.enabled: 1.0,
+ _dd.appsec.waf.duration: 0.0,
+ _dd.appsec.waf.duration_ext: 0.0,
+ _dd.top_level: 1.0,
+ _dd.tracer_kr: 1.0,
+ _sampling_priority_v1: 2.0
+ },
+ MetaStruct: {
+ appsec:
+ }
|
5addae2
to
24555a0
Compare
@@ -33,7 +33,7 @@ public void ProcessUpdates(ConfigurationStatus configurationStatus, List<RemoteC | |||
ruleSet = RuleSet.From(result.TypedFile); | |||
} | |||
|
|||
configurationStatus.RulesByFile[result.TypedFile.Path] = ruleSet; | |||
configurationStatus.RulesByFile[firstFile.Path.Path] = ruleSet; |
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.
So, this is the only change necessary to fix the bug? It would be nice to see a more developed explaination of why it fixes the bug in the PR summary.
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.
The Path of the file wasn't get from the right variable.
result.TypedFile
is a JToken
, getting the Path
from this object would get the path of the JSON token (that is an empty string here and totally not the info we wanted to get)
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.
LGTM , few nits
tracer/test/Datadog.Trace.Security.IntegrationTests/AspNetBase.cs
Outdated
Show resolved
Hide resolved
tracer/test/Datadog.Trace.Security.IntegrationTests/AspNetBase.cs
Outdated
Show resolved
Hide resolved
tracer/test/Datadog.Trace.Security.IntegrationTests/Rcm/AspNetCore5AsmRemoteRules.cs
Show resolved
Hide resolved
f5ef3fe
to
a34e78f
Compare
Summary of changes
Fixed a regression bug.
The key variable for the process update wasn't the right one.
Bug explanation
The Path of the file wasn't get from the right variable.
result.TypedFile
is aJToken
, getting thePath
from this object would get the path of the JSON token. The path is an empty string and totally not the info we wanted to get.Test coverage
Mistake Not...
to trigger a blocking event from the default ruleset