Skip to content

Response blocking in netty#5650

Merged
cataphract merged 2 commits into
masterfrom
glopes/netty-block-response
Aug 24, 2023
Merged

Response blocking in netty#5650
cataphract merged 2 commits into
masterfrom
glopes/netty-block-response

Conversation

@cataphract

Copy link
Copy Markdown
Contributor

No description provided.

@cataphract
cataphract requested a review from a team as a code owner July 27, 2023 12:45
@pr-commenter

pr-commenter Bot commented Jul 27, 2023

Copy link
Copy Markdown

Benchmarks

Startup

Parameters

Baseline Candidate
commit 1.20.0-SNAPSHOT~e3aa415c99 1.20.0-SNAPSHOT~c7562e5af9
config baseline candidate
See matching parameters
Baseline Candidate
application insecure-bank insecure-bank
module Agent Agent
parent None None
variant appsec appsec

Summary

Found 8 performance improvements and 2 performance regressions! Performance is the same for 52 cases.

scenario Δ mean execution_time candidate mean execution_time baseline mean execution_time
scenario:insecure-bank:appsec:Telemetry better
[-572.080µs; -390.721µs] or [-10.004%; -6.833%]
5.237ms 5.719ms
scenario:insecure-bank:iast:Remote Config worse
[+28.927µs; +73.057µs] or [+5.151%; +13.009%]
612.579µs 561.587µs
scenario:insecure-bank:iast:Telemetry better
[-756.935µs; -494.668µs] or [-12.973%; -8.478%]
5.209ms 5.835ms
scenario:insecure-bank:profiling:Telemetry better
[-828.546µs; -467.668µs] or [-13.813%; -7.797%]
5.350ms 5.998ms
scenario:insecure-bank:tracing:Telemetry better
[-798.302µs; -521.809µs] or [-13.141%; -8.590%]
5.415ms 6.075ms
scenario:petclinic:appsec:Telemetry better
[-593.079µs; -503.855µs] or [-10.402%; -8.837%]
5.153ms 5.701ms
scenario:petclinic:iast:Remote Config worse
[+26.584µs; +72.933µs] or [+4.809%; +13.193%]
602.561µs 552.803µs
scenario:petclinic:iast:Telemetry better
[-794.530µs; -489.075µs] or [-13.680%; -8.421%]
5.166ms 5.808ms
scenario:petclinic:profiling:Telemetry better
[-853.502µs; -542.519µs] or [-14.187%; -9.018%]
5.318ms 6.016ms
scenario:petclinic:tracing:Telemetry better
[-722.714µs; -493.988µs] or [-11.970%; -8.181%]
5.430ms 6.038ms
Startup time reports for insecure-bank
gantt
    title insecure-bank - global startup overhead: candidate=1.20.0-SNAPSHOT~c7562e5af9, baseline=1.20.0-SNAPSHOT~e3aa415c99

    dateFormat X
    axisFormat %s
section tracing
Agent [baseline] (991.287 ms) : 0, 991287
Total [baseline] (8.671 s) : 0, 8670907
Agent [candidate] (987.062 ms) : 0, 987062
Total [candidate] (8.655 s) : 0, 8654759
section appsec
Agent [baseline] (1.069 s) : 0, 1068695
Total [baseline] (8.719 s) : 0, 8719188
Agent [candidate] (1.087 s) : 0, 1087110
Total [candidate] (8.818 s) : 0, 8818380
section iast
Agent [baseline] (1.096 s) : 0, 1095503
Total [baseline] (9.187 s) : 0, 9187020
Agent [candidate] (1.087 s) : 0, 1087077
Total [candidate] (9.18 s) : 0, 9179679
section profiling
Agent [baseline] (1.169 s) : 0, 1168689
Total [baseline] (8.904 s) : 0, 8904332
Agent [candidate] (1.163 s) : 0, 1162774
Total [candidate] (8.924 s) : 0, 8924412
Loading
  • baseline results
Module Variant Duration Δ tracing
Agent tracing 991.287 ms -
Agent appsec 1.069 s 77.409 ms (7.8%)
Agent iast 1.096 s 104.217 ms (10.5%)
Agent profiling 1.169 s 177.402 ms (17.9%)
Total tracing 8.671 s -
Total appsec 8.719 s 48.281 ms (0.6%)
Total iast 9.187 s 516.113 ms (6.0%)
Total profiling 8.904 s 233.425 ms (2.7%)
  • candidate results
Module Variant Duration Δ tracing
Agent tracing 987.062 ms -
Agent appsec 1.087 s 100.048 ms (10.1%)
Agent iast 1.087 s 100.015 ms (10.1%)
Agent profiling 1.163 s 175.712 ms (17.8%)
Total tracing 8.655 s -
Total appsec 8.818 s 163.621 ms (1.9%)
Total iast 9.18 s 524.92 ms (6.1%)
Total profiling 8.924 s 269.653 ms (3.1%)
gantt
    title insecure-bank - break down per module: candidate=1.20.0-SNAPSHOT~c7562e5af9, baseline=1.20.0-SNAPSHOT~e3aa415c99

    dateFormat X
    axisFormat %s
section tracing
BytebuddyAgent [baseline] (614.281 ms) : 0, 614281
BytebuddyAgent [candidate] (612.381 ms) : 0, 612381
GlobalTracer [baseline] (285.316 ms) : 0, 285316
GlobalTracer [candidate] (283.862 ms) : 0, 283862
AppSec [baseline] (50.441 ms) : 0, 50441
AppSec [candidate] (50.389 ms) : 0, 50389
Remote Config [baseline] (670.529 µs) : 0, 671
Remote Config [candidate] (667.915 µs) : 0, 668
Telemetry [baseline] (6.075 ms) : 0, 6075
Telemetry [candidate] (5.415 ms) : 0, 5415
section appsec
BytebuddyAgent [baseline] (609.732 ms) : 0, 609732
BytebuddyAgent [candidate] (620.686 ms) : 0, 620686
GlobalTracer [baseline] (283.493 ms) : 0, 283493
GlobalTracer [candidate] (289.41 ms) : 0, 289410
AppSec [baseline] (134.673 ms) : 0, 134673
AppSec [candidate] (136.274 ms) : 0, 136274
Remote Config [baseline] (717.208 µs) : 0, 717
Remote Config [candidate] (734.228 µs) : 0, 734
Telemetry [baseline] (5.719 ms) : 0, 5719
Telemetry [candidate] (5.237 ms) : 0, 5237
section iast
BytebuddyAgent [baseline] (721.939 ms) : 0, 721939
BytebuddyAgent [candidate] (714.48 ms) : 0, 714480
GlobalTracer [baseline] (271.238 ms) : 0, 271238
GlobalTracer [candidate] (271.523 ms) : 0, 271523
AppSec [baseline] (47.442 ms) : 0, 47442
AppSec [candidate] (46.769 ms) : 0, 46769
Remote Config [baseline] (561.587 µs) : 0, 562
Remote Config [candidate] (612.579 µs) : 0, 613
Telemetry [baseline] (5.835 ms) : 0, 5835
Telemetry [candidate] (5.209 ms) : 0, 5209
IAST [baseline] (13.954 ms) : 0, 13954
IAST [candidate] (14.272 ms) : 0, 14272
section profiling
BytebuddyAgent [baseline] (631.013 ms) : 0, 631013
BytebuddyAgent [candidate] (627.313 ms) : 0, 627313
GlobalTracer [baseline] (351.904 ms) : 0, 351904
GlobalTracer [candidate] (351.58 ms) : 0, 351580
AppSec [baseline] (49.495 ms) : 0, 49495
AppSec [candidate] (49.373 ms) : 0, 49373
Remote Config [baseline] (663.369 µs) : 0, 663
Remote Config [candidate] (664.973 µs) : 0, 665
Telemetry [baseline] (5.998 ms) : 0, 5998
Telemetry [candidate] (5.35 ms) : 0, 5350
ProfilingAgent [baseline] (76.091 ms) : 0, 76091
ProfilingAgent [candidate] (75.242 ms) : 0, 75242
Profiling [baseline] (76.115 ms) : 0, 76115
Profiling [candidate] (75.266 ms) : 0, 75266
Loading
Startup time reports for petclinic
gantt
    title petclinic - global startup overhead: candidate=1.20.0-SNAPSHOT~c7562e5af9, baseline=1.20.0-SNAPSHOT~e3aa415c99

    dateFormat X
    axisFormat %s
section tracing
Agent [baseline] (992.692 ms) : 0, 992692
Total [baseline] (9.183 s) : 0, 9183266
Agent [candidate] (989.193 ms) : 0, 989193
Total [candidate] (9.246 s) : 0, 9246184
section appsec
Agent [baseline] (1.069 s) : 0, 1068984
Total [baseline] (9.227 s) : 0, 9226924
Agent [candidate] (1.07 s) : 0, 1070487
Total [candidate] (9.304 s) : 0, 9304039
section iast
Agent [baseline] (1.086 s) : 0, 1086042
Total [baseline] (9.406 s) : 0, 9406250
Agent [candidate] (1.085 s) : 0, 1084851
Total [candidate] (9.455 s) : 0, 9455335
section profiling
Agent [baseline] (1.163 s) : 0, 1163255
Total [baseline] (9.502 s) : 0, 9501634
Agent [candidate] (1.157 s) : 0, 1156992
Total [candidate] (9.45 s) : 0, 9450165
Loading
  • baseline results
Module Variant Duration Δ tracing
Agent tracing 992.692 ms -
Agent appsec 1.069 s 76.292 ms (7.7%)
Agent iast 1.086 s 93.35 ms (9.4%)
Agent profiling 1.163 s 170.563 ms (17.2%)
Total tracing 9.183 s -
Total appsec 9.227 s 43.657 ms (0.5%)
Total iast 9.406 s 222.984 ms (2.4%)
Total profiling 9.502 s 318.368 ms (3.5%)
  • candidate results
Module Variant Duration Δ tracing
Agent tracing 989.193 ms -
Agent appsec 1.07 s 81.294 ms (8.2%)
Agent iast 1.085 s 95.658 ms (9.7%)
Agent profiling 1.157 s 167.799 ms (17.0%)
Total tracing 9.246 s -
Total appsec 9.304 s 57.854 ms (0.6%)
Total iast 9.455 s 209.15 ms (2.3%)
Total profiling 9.45 s 203.98 ms (2.2%)
gantt
    title petclinic - break down per module: candidate=1.20.0-SNAPSHOT~c7562e5af9, baseline=1.20.0-SNAPSHOT~e3aa415c99

    dateFormat X
    axisFormat %s
section tracing
BytebuddyAgent [baseline] (615.632 ms) : 0, 615632
BytebuddyAgent [candidate] (612.432 ms) : 0, 612432
GlobalTracer [baseline] (285.549 ms) : 0, 285549
GlobalTracer [candidate] (286.0 ms) : 0, 286000
AppSec [baseline] (50.271 ms) : 0, 50271
AppSec [candidate] (50.32 ms) : 0, 50320
Remote Config [baseline] (662.467 µs) : 0, 662
Remote Config [candidate] (662.862 µs) : 0, 663
Telemetry [baseline] (6.038 ms) : 0, 6038
Telemetry [candidate] (5.43 ms) : 0, 5430
section appsec
BytebuddyAgent [baseline] (610.121 ms) : 0, 610121
BytebuddyAgent [candidate] (610.72 ms) : 0, 610720
GlobalTracer [baseline] (282.888 ms) : 0, 282888
GlobalTracer [candidate] (283.903 ms) : 0, 283903
AppSec [baseline] (135.259 ms) : 0, 135259
AppSec [candidate] (135.695 ms) : 0, 135695
Remote Config [baseline] (724.419 µs) : 0, 724
Remote Config [candidate] (724.366 µs) : 0, 724
Telemetry [baseline] (5.701 ms) : 0, 5701
Telemetry [candidate] (5.153 ms) : 0, 5153
section iast
BytebuddyAgent [baseline] (714.969 ms) : 0, 714969
BytebuddyAgent [candidate] (713.618 ms) : 0, 713618
GlobalTracer [baseline] (269.638 ms) : 0, 269638
GlobalTracer [candidate] (270.653 ms) : 0, 270653
AppSec [baseline] (46.925 ms) : 0, 46925
AppSec [candidate] (46.416 ms) : 0, 46416
Remote Config [baseline] (552.803 µs) : 0, 553
Remote Config [candidate] (602.561 µs) : 0, 603
Telemetry [baseline] (5.808 ms) : 0, 5808
Telemetry [candidate] (5.166 ms) : 0, 5166
IAST [baseline] (13.862 ms) : 0, 13862
IAST [candidate] (14.203 ms) : 0, 14203
section profiling
BytebuddyAgent [baseline] (627.012 ms) : 0, 627012
BytebuddyAgent [candidate] (623.974 ms) : 0, 623974
GlobalTracer [baseline] (350.334 ms) : 0, 350334
GlobalTracer [candidate] (349.669 ms) : 0, 349669
AppSec [baseline] (49.733 ms) : 0, 49733
AppSec [candidate] (49.134 ms) : 0, 49134
Remote Config [baseline] (687.49 µs) : 0, 687
Remote Config [candidate] (657.27 µs) : 0, 657
Telemetry [baseline] (6.016 ms) : 0, 6016
Telemetry [candidate] (5.318 ms) : 0, 5318
ProfilingAgent [baseline] (76.141 ms) : 0, 76141
ProfilingAgent [candidate] (75.35 ms) : 0, 75350
Profiling [baseline] (76.165 ms) : 0, 76165
Profiling [candidate] (75.374 ms) : 0, 75374
Loading

Load

Parameters

Baseline Candidate
commit 1.20.0-SNAPSHOT~e3aa415c99 1.20.0-SNAPSHOT~c7562e5af9
config baseline candidate
end_time 2023-08-18T12:10:17 2023-08-18T12:28:25
start_time 2023-08-18T12:10:00 2023-08-18T12:28:08
See matching parameters
Baseline Candidate
application insecure-bank insecure-bank
variant appsec appsec

Summary

Found 0 performance improvements and 0 performance regressions! Performance is the same for 24 cases.

Request duration reports for insecure-bank
gantt
    title insecure-bank - request duration [CI 0.99] : candidate=1.20.0-SNAPSHOT~c7562e5af9, baseline=1.20.0-SNAPSHOT~e3aa415c99
    dateFormat X
    axisFormat %s
section baseline
no_agent (358.394 µs) : 339, 378
.   : milestone, 358,
appsec (663.408 µs) : 643, 684
.   : milestone, 663,
iast (460.783 µs) : 439, 482
.   : milestone, 461,
iast_FULL (521.55 µs) : 501, 542
.   : milestone, 522,
iast_INACTIVE (440.553 µs) : 420, 461
.   : milestone, 441,
profiling (439.078 µs) : 419, 459
.   : milestone, 439,
tracing (432.668 µs) : 411, 454
.   : milestone, 433,
section candidate
no_agent (365.95 µs) : 345, 387
.   : milestone, 366,
appsec (666.849 µs) : 646, 688
.   : milestone, 667,
iast (460.919 µs) : 440, 482
.   : milestone, 461,
iast_FULL (519.188 µs) : 499, 540
.   : milestone, 519,
iast_INACTIVE (445.252 µs) : 423, 468
.   : milestone, 445,
profiling (434.769 µs) : 414, 455
.   : milestone, 435,
tracing (436.451 µs) : 416, 457
.   : milestone, 436,
Loading
  • baseline results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 358.394 µs [338.896 µs, 377.891 µs] -
appsec 663.408 µs [642.882 µs, 683.934 µs] 305.015 µs (85.1%)
iast 460.783 µs [439.373 µs, 482.193 µs] 102.39 µs (28.6%)
iast_FULL 521.55 µs [500.887 µs, 542.213 µs] 163.157 µs (45.5%)
iast_INACTIVE 440.553 µs [419.86 µs, 461.245 µs] 82.159 µs (22.9%)
profiling 439.078 µs [418.762 µs, 459.394 µs] 80.684 µs (22.5%)
tracing 432.668 µs [411.459 µs, 453.878 µs] 74.275 µs (20.7%)
  • candidate results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 365.95 µs [345.009 µs, 386.89 µs] -
appsec 666.849 µs [645.579 µs, 688.12 µs] 300.899 µs (82.2%)
iast 460.919 µs [440.175 µs, 481.664 µs] 94.97 µs (26.0%)
iast_FULL 519.188 µs [498.518 µs, 539.858 µs] 153.238 µs (41.9%)
iast_INACTIVE 445.252 µs [422.881 µs, 467.623 µs] 79.302 µs (21.7%)
profiling 434.769 µs [414.43 µs, 455.107 µs] 68.819 µs (18.8%)
tracing 436.451 µs [416.014 µs, 456.888 µs] 70.501 µs (19.3%)
Request duration reports for petclinic
gantt
    title petclinic - request duration [CI 0.99] : candidate=1.20.0-SNAPSHOT~c7562e5af9, baseline=1.20.0-SNAPSHOT~e3aa415c99
    dateFormat X
    axisFormat %s
section baseline
no_agent (1.336 ms) : 1317, 1355
.   : milestone, 1336,
appsec (1.698 ms) : 1674, 1722
.   : milestone, 1698,
iast (1.444 ms) : 1420, 1469
.   : milestone, 1444,
profiling (1.456 ms) : 1432, 1481
.   : milestone, 1456,
tracing (1.452 ms) : 1428, 1476
.   : milestone, 1452,
section candidate
no_agent (1.331 ms) : 1312, 1350
.   : milestone, 1331,
appsec (1.67 ms) : 1646, 1694
.   : milestone, 1670,
iast (1.461 ms) : 1437, 1486
.   : milestone, 1461,
profiling (1.459 ms) : 1435, 1484
.   : milestone, 1459,
tracing (1.457 ms) : 1432, 1482
.   : milestone, 1457,
Loading
  • baseline results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 1.336 ms [1.317 ms, 1.355 ms] -
appsec 1.698 ms [1.674 ms, 1.722 ms] 361.41 µs (27.0%)
iast 1.444 ms [1.42 ms, 1.469 ms] 108.031 µs (8.1%)
profiling 1.456 ms [1.432 ms, 1.481 ms] 120.281 µs (9.0%)
tracing 1.452 ms [1.428 ms, 1.476 ms] 115.833 µs (8.7%)
  • candidate results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 1.331 ms [1.312 ms, 1.35 ms] -
appsec 1.67 ms [1.646 ms, 1.694 ms] 339.153 µs (25.5%)
iast 1.461 ms [1.437 ms, 1.486 ms] 130.613 µs (9.8%)
profiling 1.459 ms [1.435 ms, 1.484 ms] 128.59 µs (9.7%)
tracing 1.457 ms [1.432 ms, 1.482 ms] 125.92 µs (9.5%)

@cataphract
cataphract force-pushed the glopes/netty-block-response branch from d494a5d to c9937f1 Compare July 28, 2023 11:39
Base automatically changed from glopes/netty-fix-propagation to master July 28, 2023 11:56
@cataphract cataphract added the comp: asm waf Application Security Management (WAF) label Jul 28, 2023
@smola
smola requested review from a team and ValentinZakharov August 7, 2023 10:15
@cataphract
cataphract removed the request for review from ValentinZakharov August 7, 2023 10:15

@Override
public void write(ChannelHandlerContext ctx, Object msg, ChannelPromise prm) throws Exception {
Channel channel = ctx.channel();

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here, short-circuit for AppSec disabled?

@cataphract
cataphract force-pushed the glopes/netty-block-response branch from c9937f1 to b2d110c Compare August 16, 2023 17:21
@cataphract
cataphract requested a review from smola August 16, 2023 17:21
@smola
smola requested a review from a team August 18, 2023 09:51

@Override
boolean testBlockingOnResponse() {
false

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why would this be false now?

@cataphract
cataphract requested a review from smola August 18, 2023 11:36
@cataphract
cataphract merged commit 1689d5c into master Aug 24, 2023
@cataphract
cataphract deleted the glopes/netty-block-response branch August 24, 2023 13:33
@github-actions github-actions Bot added this to the 1.20.0 milestone Aug 24, 2023
@ValentinZakharov ValentinZakharov changed the title Netty: block on response Implemented blocking capability support for Netty Aug 30, 2023
@ValentinZakharov ValentinZakharov changed the title Implemented blocking capability support for Netty Added blocking attacks capability for Netty Aug 30, 2023
@smola smola changed the title Added blocking attacks capability for Netty Response blocking in netty Jun 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp: asm waf Application Security Management (WAF)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants