Missing http.response.headers.content-type span tag on blocking responses - netty fix#10720
Closed
Missing http.response.headers.content-type span tag on blocking responses - netty fix#10720
Conversation
BenchmarksStartupParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 64 metrics, 7 unstable metrics. Startup time reports for insecure-bankgantt
title insecure-bank - global startup overhead: candidate=1.61.0-SNAPSHOT~47b551a1c3, baseline=1.61.0-SNAPSHOT~9b93366972
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.058 s) : 0, 1058404
Total [baseline] (8.841 s) : 0, 8841170
Agent [candidate] (1.055 s) : 0, 1055406
Total [candidate] (8.825 s) : 0, 8825485
section iast
Agent [baseline] (1.226 s) : 0, 1225943
Total [baseline] (9.563 s) : 0, 9562903
Agent [candidate] (1.23 s) : 0, 1229590
Total [candidate] (9.579 s) : 0, 9578912
gantt
title insecure-bank - break down per module: candidate=1.61.0-SNAPSHOT~47b551a1c3, baseline=1.61.0-SNAPSHOT~9b93366972
dateFormat X
axisFormat %s
section tracing
crashtracking [baseline] (1.193 ms) : 0, 1193
crashtracking [candidate] (1.191 ms) : 0, 1191
BytebuddyAgent [baseline] (627.683 ms) : 0, 627683
BytebuddyAgent [candidate] (627.798 ms) : 0, 627798
AgentMeter [baseline] (29.174 ms) : 0, 29174
AgentMeter [candidate] (29.102 ms) : 0, 29102
GlobalTracer [baseline] (256.298 ms) : 0, 256298
GlobalTracer [candidate] (256.727 ms) : 0, 256727
AppSec [baseline] (31.497 ms) : 0, 31497
AppSec [candidate] (31.387 ms) : 0, 31387
Debugger [baseline] (58.445 ms) : 0, 58445
Debugger [candidate] (58.374 ms) : 0, 58374
Remote Config [baseline] (584.061 µs) : 0, 584
Remote Config [candidate] (586.687 µs) : 0, 587
Telemetry [baseline] (8.601 ms) : 0, 8601
Telemetry [candidate] (8.576 ms) : 0, 8576
Flare Poller [baseline] (8.861 ms) : 0, 8861
Flare Poller [candidate] (5.603 ms) : 0, 5603
section iast
crashtracking [baseline] (1.216 ms) : 0, 1216
crashtracking [candidate] (1.199 ms) : 0, 1199
BytebuddyAgent [baseline] (795.465 ms) : 0, 795465
BytebuddyAgent [candidate] (799.142 ms) : 0, 799142
AgentMeter [baseline] (11.358 ms) : 0, 11358
AgentMeter [candidate] (11.384 ms) : 0, 11384
GlobalTracer [baseline] (247.02 ms) : 0, 247020
GlobalTracer [candidate] (247.817 ms) : 0, 247817
AppSec [baseline] (26.42 ms) : 0, 26420
AppSec [candidate] (26.351 ms) : 0, 26351
Debugger [baseline] (62.903 ms) : 0, 62903
Debugger [candidate] (62.234 ms) : 0, 62234
Remote Config [baseline] (520.452 µs) : 0, 520
Remote Config [candidate] (519.786 µs) : 0, 520
Telemetry [baseline] (14.831 ms) : 0, 14831
Telemetry [candidate] (14.722 ms) : 0, 14722
Flare Poller [baseline] (4.897 ms) : 0, 4897
Flare Poller [candidate] (4.884 ms) : 0, 4884
IAST [baseline] (25.128 ms) : 0, 25128
IAST [candidate] (25.19 ms) : 0, 25190
Startup time reports for petclinicgantt
title petclinic - global startup overhead: candidate=1.61.0-SNAPSHOT~47b551a1c3, baseline=1.61.0-SNAPSHOT~9b93366972
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.07 s) : 0, 1070132
Total [baseline] (11.09 s) : 0, 11089834
Agent [candidate] (1.071 s) : 0, 1070716
Total [candidate] (11.068 s) : 0, 11067780
section appsec
Agent [baseline] (1.253 s) : 0, 1253041
Total [baseline] (11.195 s) : 0, 11194880
Agent [candidate] (1.245 s) : 0, 1245430
Total [candidate] (11.247 s) : 0, 11246751
section iast
Agent [baseline] (1.243 s) : 0, 1243452
Total [baseline] (11.389 s) : 0, 11389120
Agent [candidate] (1.229 s) : 0, 1229379
Total [candidate] (11.434 s) : 0, 11433524
section profiling
Agent [baseline] (1.189 s) : 0, 1188568
Total [baseline] (11.124 s) : 0, 11123572
Agent [candidate] (1.189 s) : 0, 1188841
Total [candidate] (11.079 s) : 0, 11079019
gantt
title petclinic - break down per module: candidate=1.61.0-SNAPSHOT~47b551a1c3, baseline=1.61.0-SNAPSHOT~9b93366972
dateFormat X
axisFormat %s
section tracing
crashtracking [baseline] (1.193 ms) : 0, 1193
crashtracking [candidate] (1.204 ms) : 0, 1204
BytebuddyAgent [baseline] (632.915 ms) : 0, 632915
BytebuddyAgent [candidate] (635.008 ms) : 0, 635008
AgentMeter [baseline] (29.554 ms) : 0, 29554
AgentMeter [candidate] (29.419 ms) : 0, 29419
GlobalTracer [baseline] (259.878 ms) : 0, 259878
GlobalTracer [candidate] (259.538 ms) : 0, 259538
AppSec [baseline] (32.013 ms) : 0, 32013
AppSec [candidate] (31.932 ms) : 0, 31932
Debugger [baseline] (60.266 ms) : 0, 60266
Debugger [candidate] (60.076 ms) : 0, 60076
Remote Config [baseline] (600.704 µs) : 0, 601
Remote Config [candidate] (590.239 µs) : 0, 590
Telemetry [baseline] (8.724 ms) : 0, 8724
Telemetry [candidate] (8.739 ms) : 0, 8739
Flare Poller [baseline] (8.842 ms) : 0, 8842
Flare Poller [candidate] (8.097 ms) : 0, 8097
section appsec
crashtracking [baseline] (1.197 ms) : 0, 1197
crashtracking [candidate] (1.182 ms) : 0, 1182
BytebuddyAgent [baseline] (662.241 ms) : 0, 662241
BytebuddyAgent [candidate] (658.106 ms) : 0, 658106
AgentMeter [baseline] (12.081 ms) : 0, 12081
AgentMeter [candidate] (11.997 ms) : 0, 11997
GlobalTracer [baseline] (259.45 ms) : 0, 259450
GlobalTracer [candidate] (258.25 ms) : 0, 258250
AppSec [baseline] (178.234 ms) : 0, 178234
AppSec [candidate] (177.198 ms) : 0, 177198
Debugger [baseline] (65.128 ms) : 0, 65128
Debugger [candidate] (65.354 ms) : 0, 65354
Remote Config [baseline] (575.512 µs) : 0, 576
Remote Config [candidate] (572.945 µs) : 0, 573
Telemetry [baseline] (9.169 ms) : 0, 9169
Telemetry [candidate] (9.043 ms) : 0, 9043
Flare Poller [baseline] (4.422 ms) : 0, 4422
Flare Poller [candidate] (3.587 ms) : 0, 3587
IAST [baseline] (24.162 ms) : 0, 24162
IAST [candidate] (23.888 ms) : 0, 23888
section iast
crashtracking [baseline] (1.207 ms) : 0, 1207
crashtracking [candidate] (1.19 ms) : 0, 1190
BytebuddyAgent [baseline] (806.847 ms) : 0, 806847
BytebuddyAgent [candidate] (797.192 ms) : 0, 797192
AgentMeter [baseline] (11.804 ms) : 0, 11804
AgentMeter [candidate] (11.329 ms) : 0, 11329
GlobalTracer [baseline] (249.857 ms) : 0, 249857
GlobalTracer [candidate] (247.96 ms) : 0, 247960
AppSec [baseline] (26.738 ms) : 0, 26738
AppSec [candidate] (26.48 ms) : 0, 26480
Debugger [baseline] (64.421 ms) : 0, 64421
Debugger [candidate] (63.524 ms) : 0, 63524
Remote Config [baseline] (545.794 µs) : 0, 546
Remote Config [candidate] (523.123 µs) : 0, 523
Telemetry [baseline] (15.148 ms) : 0, 15148
Telemetry [candidate] (14.947 ms) : 0, 14947
Flare Poller [baseline] (4.988 ms) : 0, 4988
Flare Poller [candidate] (4.897 ms) : 0, 4897
IAST [baseline] (25.625 ms) : 0, 25625
IAST [candidate] (25.241 ms) : 0, 25241
section profiling
crashtracking [baseline] (1.181 ms) : 0, 1181
crashtracking [candidate] (1.192 ms) : 0, 1192
BytebuddyAgent [baseline] (686.301 ms) : 0, 686301
BytebuddyAgent [candidate] (687.48 ms) : 0, 687480
AgentMeter [baseline] (8.613 ms) : 0, 8613
AgentMeter [candidate] (8.64 ms) : 0, 8640
GlobalTracer [baseline] (216.217 ms) : 0, 216217
GlobalTracer [candidate] (216.655 ms) : 0, 216655
AppSec [baseline] (32.02 ms) : 0, 32020
AppSec [candidate] (32.059 ms) : 0, 32059
Debugger [baseline] (62.604 ms) : 0, 62604
Debugger [candidate] (62.059 ms) : 0, 62059
Remote Config [baseline] (608.725 µs) : 0, 609
Remote Config [candidate] (573.582 µs) : 0, 574
Telemetry [baseline] (11.352 ms) : 0, 11352
Telemetry [candidate] (10.586 ms) : 0, 10586
Flare Poller [baseline] (3.537 ms) : 0, 3537
Flare Poller [candidate] (4.351 ms) : 0, 4351
ProfilingAgent [baseline] (94.978 ms) : 0, 94978
ProfilingAgent [candidate] (94.069 ms) : 0, 94069
Profiling [baseline] (95.558 ms) : 0, 95558
Profiling [candidate] (94.629 ms) : 0, 94629
LoadParameters
See matching parameters
SummaryFound 1 performance improvements and 2 performance regressions! Performance is the same for 17 metrics, 16 unstable metrics.
Request duration reports for petclinicgantt
title petclinic - request duration [CI 0.99] : candidate=1.61.0-SNAPSHOT~47b551a1c3, baseline=1.61.0-SNAPSHOT~9b93366972
dateFormat X
axisFormat %s
section baseline
no_agent (18.538 ms) : 18347, 18728
. : milestone, 18538,
appsec (19.057 ms) : 18860, 19254
. : milestone, 19057,
code_origins (18.171 ms) : 17989, 18353
. : milestone, 18171,
iast (17.87 ms) : 17696, 18044
. : milestone, 17870,
profiling (18.865 ms) : 18675, 19055
. : milestone, 18865,
tracing (17.89 ms) : 17712, 18069
. : milestone, 17890,
section candidate
no_agent (19.304 ms) : 19111, 19497
. : milestone, 19304,
appsec (19.626 ms) : 19427, 19826
. : milestone, 19626,
code_origins (18.637 ms) : 18452, 18822
. : milestone, 18637,
iast (17.936 ms) : 17761, 18112
. : milestone, 17936,
profiling (19.887 ms) : 19683, 20090
. : milestone, 19887,
tracing (17.686 ms) : 17509, 17862
. : milestone, 17686,
Request duration reports for insecure-bankgantt
title insecure-bank - request duration [CI 0.99] : candidate=1.61.0-SNAPSHOT~47b551a1c3, baseline=1.61.0-SNAPSHOT~9b93366972
dateFormat X
axisFormat %s
section baseline
no_agent (1.177 ms) : 1166, 1189
. : milestone, 1177,
iast (3.208 ms) : 3165, 3251
. : milestone, 3208,
iast_FULL (5.792 ms) : 5734, 5849
. : milestone, 5792,
iast_GLOBAL (3.575 ms) : 3507, 3642
. : milestone, 3575,
profiling (2.094 ms) : 2075, 2113
. : milestone, 2094,
tracing (1.743 ms) : 1729, 1757
. : milestone, 1743,
section candidate
no_agent (1.194 ms) : 1182, 1206
. : milestone, 1194,
iast (3.095 ms) : 3053, 3137
. : milestone, 3095,
iast_FULL (5.74 ms) : 5683, 5797
. : milestone, 5740,
iast_GLOBAL (3.55 ms) : 3495, 3605
. : milestone, 3550,
profiling (2.283 ms) : 2261, 2304
. : milestone, 2283,
tracing (1.806 ms) : 1791, 1821
. : milestone, 1806,
DacapoParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 11 metrics, 1 unstable metrics. Execution time for tomcatgantt
title tomcat - execution time [CI 0.99] : candidate=1.61.0-SNAPSHOT~47b551a1c3, baseline=1.61.0-SNAPSHOT~9b93366972
dateFormat X
axisFormat %s
section baseline
no_agent (1.477 ms) : 1465, 1488
. : milestone, 1477,
appsec (3.846 ms) : 3619, 4072
. : milestone, 3846,
iast (2.265 ms) : 2196, 2334
. : milestone, 2265,
iast_GLOBAL (2.298 ms) : 2228, 2367
. : milestone, 2298,
profiling (2.073 ms) : 2018, 2128
. : milestone, 2073,
tracing (2.059 ms) : 2005, 2112
. : milestone, 2059,
section candidate
no_agent (1.473 ms) : 1461, 1484
. : milestone, 1473,
appsec (3.817 ms) : 3595, 4039
. : milestone, 3817,
iast (2.257 ms) : 2188, 2326
. : milestone, 2257,
iast_GLOBAL (2.299 ms) : 2230, 2368
. : milestone, 2299,
profiling (2.081 ms) : 2027, 2136
. : milestone, 2081,
tracing (2.074 ms) : 2020, 2127
. : milestone, 2074,
Execution time for biojavagantt
title biojava - execution time [CI 0.99] : candidate=1.61.0-SNAPSHOT~47b551a1c3, baseline=1.61.0-SNAPSHOT~9b93366972
dateFormat X
axisFormat %s
section baseline
no_agent (14.988 s) : 14988000, 14988000
. : milestone, 14988000,
appsec (14.893 s) : 14893000, 14893000
. : milestone, 14893000,
iast (17.919 s) : 17919000, 17919000
. : milestone, 17919000,
iast_GLOBAL (17.777 s) : 17777000, 17777000
. : milestone, 17777000,
profiling (15.015 s) : 15015000, 15015000
. : milestone, 15015000,
tracing (15.083 s) : 15083000, 15083000
. : milestone, 15083000,
section candidate
no_agent (15.66 s) : 15660000, 15660000
. : milestone, 15660000,
appsec (15.152 s) : 15152000, 15152000
. : milestone, 15152000,
iast (18.119 s) : 18119000, 18119000
. : milestone, 18119000,
iast_GLOBAL (17.822 s) : 17822000, 17822000
. : milestone, 17822000,
profiling (15.423 s) : 15423000, 15423000
. : milestone, 15423000,
tracing (15.201 s) : 15201000, 15201000
. : milestone, 15201000,
|
9e136d3 to
281e32f
Compare
Member
Author
|
We can discard it since this approach requires implementation for each blocking implementation and is not necessary. The new approach in #10711 solves everything directly in GatewayBridge. |
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.
What Does This Do
Fixes missing
http.response.headers.*span tags on blocking responses for Netty-based runtimes (Vert.x, Play) and Akka-HTTP (Play).Changes:
BlockingResponseHandlernow writeshttp.response.headers.content-typeandcontent-lengthdirectly viasetTagTop()on the span after building the blocking response. The IG response header callbacks were already being fired but are insufficient here becauseGatewayBridgeclears the collected headers when the WAF returns a second blocking action on the response.GatewayBridge.onRequestEnded()now writes response header span tags for all requests, not only those that triggered AppSec events.BlockingResponseHelpernow writes the header tags directly in bothmaybeCreateBlockingResponse()(request-time blocking) andhandleFinishForWaf()(response-time blocking detected by the WAF).Motivation
Blocking handlers in Netty and Akka-HTTP fire the IG response header callbacks on the 403 they build, but the collected headers never reach the span. When the WAF analyses the blocking response headers, it returns another blocking action, causing
GatewayBridge.onResponseHeaderDone()to callclearResponseHeadersForBlocking(), which wipes the headers beforeonRequestEnded()can write them as span tags. The fix bypasses that chain and writes the tags directly. The same issue affected non-AppSec requests whereGatewayBridge.onRequestEnded()only wrote response header tags inside the!collectedEvents.isEmpty()branch.Additional Notes
Contributor Checklist
type:and (comp:orinst:) labels in addition to any other useful labelsclose,fix, or any linking keywords when referencing an issueUse
solvesinstead, and assign the PR milestone to the issueJira ticket: APPSEC-61447
Note: Once your PR is ready to merge, add it to the merge queue by commenting
/merge./merge -ccancels the queue request./merge -f --reason "reason"skips all merge queue checks; please use this judiciously, as some checks do not run at the PR-level. For more information, see this doc.