-
Notifications
You must be signed in to change notification settings - Fork 324
Proposal 2: Deferred Commit Pattern in ASM Listener #10375
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
Draft
jandro996
wants to merge
8
commits into
master
Choose a base branch
from
alejandro.gonzalez/APPSEC-60528_P2
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Conversation
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
47e1f7f to
a8ca135
Compare
BenchmarksStartupParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 58 metrics, 7 unstable metrics. Startup time reports for petclinicgantt
title petclinic - global startup overhead: candidate=1.59.0-SNAPSHOT~4ccde35fea, baseline=1.59.0-SNAPSHOT~cb69759fb3
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.082 s) : 0, 1082253
Total [baseline] (10.767 s) : 0, 10766699
Agent [candidate] (1.083 s) : 0, 1083291
Total [candidate] (10.772 s) : 0, 10772404
section appsec
Agent [baseline] (1.265 s) : 0, 1265306
Total [baseline] (10.992 s) : 0, 10992142
Agent [candidate] (1.265 s) : 0, 1264890
Total [candidate] (10.953 s) : 0, 10952741
section iast
Agent [baseline] (1.243 s) : 0, 1242693
Total [baseline] (11.214 s) : 0, 11214010
Agent [candidate] (1.228 s) : 0, 1227632
Total [candidate] (11.206 s) : 0, 11206476
section profiling
Agent [baseline] (1.207 s) : 0, 1206969
Total [baseline] (10.958 s) : 0, 10958181
Agent [candidate] (1.205 s) : 0, 1204921
Total [candidate] (10.948 s) : 0, 10947522
gantt
title petclinic - break down per module: candidate=1.59.0-SNAPSHOT~4ccde35fea, baseline=1.59.0-SNAPSHOT~cb69759fb3
dateFormat X
axisFormat %s
section tracing
crashtracking [baseline] (1.175 ms) : 0, 1175
crashtracking [candidate] (1.176 ms) : 0, 1176
BytebuddyAgent [baseline] (649.463 ms) : 0, 649463
BytebuddyAgent [candidate] (651.115 ms) : 0, 651115
GlobalTracer [baseline] (282.038 ms) : 0, 282038
GlobalTracer [candidate] (282.126 ms) : 0, 282126
AppSec [baseline] (32.45 ms) : 0, 32450
AppSec [candidate] (32.504 ms) : 0, 32504
Debugger [baseline] (68.208 ms) : 0, 68208
Debugger [candidate] (67.489 ms) : 0, 67489
Remote Config [baseline] (647.206 µs) : 0, 647
Remote Config [candidate] (629.963 µs) : 0, 630
Telemetry [baseline] (8.962 ms) : 0, 8962
Telemetry [candidate] (8.995 ms) : 0, 8995
Flare Poller [baseline] (3.806 ms) : 0, 3806
Flare Poller [candidate] (3.812 ms) : 0, 3812
section appsec
crashtracking [baseline] (1.181 ms) : 0, 1181
crashtracking [candidate] (1.183 ms) : 0, 1183
BytebuddyAgent [baseline] (691.717 ms) : 0, 691717
BytebuddyAgent [candidate] (691.648 ms) : 0, 691648
GlobalTracer [baseline] (258.61 ms) : 0, 258610
GlobalTracer [candidate] (258.321 ms) : 0, 258321
AppSec [baseline] (173.307 ms) : 0, 173307
AppSec [candidate] (173.068 ms) : 0, 173068
Debugger [baseline] (66.756 ms) : 0, 66756
Debugger [candidate] (66.971 ms) : 0, 66971
Remote Config [baseline] (788.757 µs) : 0, 789
Remote Config [candidate] (771.826 µs) : 0, 772
Telemetry [baseline] (9.368 ms) : 0, 9368
Telemetry [candidate] (9.365 ms) : 0, 9365
Flare Poller [baseline] (3.7 ms) : 0, 3700
Flare Poller [candidate] (3.693 ms) : 0, 3693
IAST [baseline] (24.43 ms) : 0, 24430
IAST [candidate] (24.522 ms) : 0, 24522
section iast
crashtracking [baseline] (1.203 ms) : 0, 1203
crashtracking [candidate] (1.186 ms) : 0, 1186
BytebuddyAgent [baseline] (803.893 ms) : 0, 803893
BytebuddyAgent [candidate] (794.624 ms) : 0, 794624
GlobalTracer [baseline] (259.945 ms) : 0, 259945
GlobalTracer [candidate] (257.171 ms) : 0, 257171
AppSec [baseline] (34.031 ms) : 0, 34031
AppSec [candidate] (34.124 ms) : 0, 34124
Debugger [baseline] (67.451 ms) : 0, 67451
Debugger [candidate] (65.419 ms) : 0, 65419
Remote Config [baseline] (602.225 µs) : 0, 602
Remote Config [candidate] (602.001 µs) : 0, 602
Telemetry [baseline] (8.603 ms) : 0, 8603
Telemetry [candidate] (8.452 ms) : 0, 8452
Flare Poller [baseline] (3.712 ms) : 0, 3712
Flare Poller [candidate] (3.519 ms) : 0, 3519
IAST [baseline] (27.583 ms) : 0, 27583
IAST [candidate] (27.138 ms) : 0, 27138
section profiling
crashtracking [baseline] (1.206 ms) : 0, 1206
crashtracking [candidate] (1.219 ms) : 0, 1219
BytebuddyAgent [baseline] (702.206 ms) : 0, 702206
BytebuddyAgent [candidate] (701.949 ms) : 0, 701949
GlobalTracer [baseline] (221.695 ms) : 0, 221695
GlobalTracer [candidate] (220.785 ms) : 0, 220785
AppSec [baseline] (32.506 ms) : 0, 32506
AppSec [candidate] (32.064 ms) : 0, 32064
Debugger [baseline] (68.421 ms) : 0, 68421
Debugger [candidate] (68.083 ms) : 0, 68083
Remote Config [baseline] (638.533 µs) : 0, 639
Remote Config [candidate] (635.588 µs) : 0, 636
Telemetry [baseline] (8.985 ms) : 0, 8985
Telemetry [candidate] (8.984 ms) : 0, 8984
Flare Poller [baseline] (3.744 ms) : 0, 3744
Flare Poller [candidate] (3.788 ms) : 0, 3788
ProfilingAgent [baseline] (97.728 ms) : 0, 97728
ProfilingAgent [candidate] (97.644 ms) : 0, 97644
Profiling [baseline] (98.309 ms) : 0, 98309
Profiling [candidate] (98.247 ms) : 0, 98247
Startup time reports for insecure-bankgantt
title insecure-bank - global startup overhead: candidate=1.59.0-SNAPSHOT~4ccde35fea, baseline=1.59.0-SNAPSHOT~cb69759fb3
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.083 s) : 0, 1082624
Total [baseline] (8.716 s) : 0, 8716188
Agent [candidate] (1.085 s) : 0, 1084849
Total [candidate] (8.744 s) : 0, 8743935
section iast
Agent [baseline] (1.238 s) : 0, 1238144
Total [baseline] (9.314 s) : 0, 9314487
Agent [candidate] (1.231 s) : 0, 1230653
Total [candidate] (9.32 s) : 0, 9320047
gantt
title insecure-bank - break down per module: candidate=1.59.0-SNAPSHOT~4ccde35fea, baseline=1.59.0-SNAPSHOT~cb69759fb3
dateFormat X
axisFormat %s
section tracing
crashtracking [baseline] (1.199 ms) : 0, 1199
crashtracking [candidate] (1.192 ms) : 0, 1192
BytebuddyAgent [baseline] (651.056 ms) : 0, 651056
BytebuddyAgent [candidate] (651.932 ms) : 0, 651932
GlobalTracer [baseline] (282.026 ms) : 0, 282026
GlobalTracer [candidate] (282.692 ms) : 0, 282692
AppSec [baseline] (32.522 ms) : 0, 32522
AppSec [candidate] (32.611 ms) : 0, 32611
Debugger [baseline] (66.734 ms) : 0, 66734
Debugger [candidate] (67.589 ms) : 0, 67589
Remote Config [baseline] (656.553 µs) : 0, 657
Remote Config [candidate] (630.214 µs) : 0, 630
Telemetry [baseline] (8.917 ms) : 0, 8917
Telemetry [candidate] (8.972 ms) : 0, 8972
Flare Poller [baseline] (3.789 ms) : 0, 3789
Flare Poller [candidate] (3.751 ms) : 0, 3751
section iast
crashtracking [baseline] (1.207 ms) : 0, 1207
crashtracking [candidate] (1.19 ms) : 0, 1190
BytebuddyAgent [baseline] (802.482 ms) : 0, 802482
BytebuddyAgent [candidate] (796.658 ms) : 0, 796658
GlobalTracer [baseline] (259.23 ms) : 0, 259230
GlobalTracer [candidate] (257.786 ms) : 0, 257786
AppSec [baseline] (35.068 ms) : 0, 35068
AppSec [candidate] (34.463 ms) : 0, 34463
Debugger [baseline] (64.357 ms) : 0, 64357
Debugger [candidate] (65.184 ms) : 0, 65184
Remote Config [baseline] (608.386 µs) : 0, 608
Remote Config [candidate] (604.115 µs) : 0, 604
Telemetry [baseline] (8.547 ms) : 0, 8547
Telemetry [candidate] (8.658 ms) : 0, 8658
Flare Poller [baseline] (3.591 ms) : 0, 3591
Flare Poller [candidate] (3.598 ms) : 0, 3598
IAST [baseline] (27.295 ms) : 0, 27295
IAST [candidate] (27.005 ms) : 0, 27005
LoadParameters
See matching parameters
SummaryFound 0 performance improvements and 1 performance regressions! Performance is the same for 18 metrics, 17 unstable metrics.
Request duration reports for petclinicgantt
title petclinic - request duration [CI 0.99] : candidate=1.59.0-SNAPSHOT~4ccde35fea, baseline=1.59.0-SNAPSHOT~cb69759fb3
dateFormat X
axisFormat %s
section baseline
no_agent (18.077 ms) : 17890, 18263
. : milestone, 18077,
appsec (18.741 ms) : 18549, 18933
. : milestone, 18741,
code_origins (17.745 ms) : 17570, 17920
. : milestone, 17745,
iast (17.955 ms) : 17773, 18137
. : milestone, 17955,
profiling (18.498 ms) : 18311, 18685
. : milestone, 18498,
tracing (17.73 ms) : 17552, 17909
. : milestone, 17730,
section candidate
no_agent (19.355 ms) : 19155, 19555
. : milestone, 19355,
appsec (18.642 ms) : 18452, 18833
. : milestone, 18642,
code_origins (17.629 ms) : 17455, 17802
. : milestone, 17629,
iast (17.758 ms) : 17581, 17934
. : milestone, 17758,
profiling (18.514 ms) : 18329, 18700
. : milestone, 18514,
tracing (18.041 ms) : 17862, 18219
. : milestone, 18041,
Request duration reports for insecure-bankgantt
title insecure-bank - request duration [CI 0.99] : candidate=1.59.0-SNAPSHOT~4ccde35fea, baseline=1.59.0-SNAPSHOT~cb69759fb3
dateFormat X
axisFormat %s
section baseline
no_agent (1.188 ms) : 1176, 1199
. : milestone, 1188,
iast (3.236 ms) : 3189, 3282
. : milestone, 3236,
iast_FULL (5.745 ms) : 5688, 5803
. : milestone, 5745,
iast_GLOBAL (3.534 ms) : 3483, 3585
. : milestone, 3534,
profiling (2.169 ms) : 2147, 2191
. : milestone, 2169,
tracing (1.781 ms) : 1766, 1796
. : milestone, 1781,
section candidate
no_agent (1.195 ms) : 1183, 1207
. : milestone, 1195,
iast (3.185 ms) : 3142, 3227
. : milestone, 3185,
iast_FULL (5.77 ms) : 5713, 5826
. : milestone, 5770,
iast_GLOBAL (3.501 ms) : 3450, 3552
. : milestone, 3501,
profiling (2.006 ms) : 1987, 2025
. : milestone, 2006,
tracing (1.797 ms) : 1782, 1812
. : milestone, 1797,
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.59.0-SNAPSHOT~4ccde35fea, baseline=1.59.0-SNAPSHOT~cb69759fb3
dateFormat X
axisFormat %s
section baseline
no_agent (1.477 ms) : 1466, 1489
. : milestone, 1477,
appsec (3.742 ms) : 3523, 3961
. : milestone, 3742,
iast (2.229 ms) : 2163, 2294
. : milestone, 2229,
iast_GLOBAL (2.27 ms) : 2205, 2336
. : milestone, 2270,
profiling (2.079 ms) : 2026, 2132
. : milestone, 2079,
tracing (2.061 ms) : 2009, 2112
. : milestone, 2061,
section candidate
no_agent (1.481 ms) : 1470, 1493
. : milestone, 1481,
appsec (3.67 ms) : 3455, 3885
. : milestone, 3670,
iast (2.227 ms) : 2162, 2292
. : milestone, 2227,
iast_GLOBAL (2.264 ms) : 2199, 2330
. : milestone, 2264,
profiling (2.114 ms) : 2059, 2170
. : milestone, 2114,
tracing (2.038 ms) : 1987, 2089
. : milestone, 2038,
Execution time for biojavagantt
title biojava - execution time [CI 0.99] : candidate=1.59.0-SNAPSHOT~4ccde35fea, baseline=1.59.0-SNAPSHOT~cb69759fb3
dateFormat X
axisFormat %s
section baseline
no_agent (14.859 s) : 14859000, 14859000
. : milestone, 14859000,
appsec (14.671 s) : 14671000, 14671000
. : milestone, 14671000,
iast (17.838 s) : 17838000, 17838000
. : milestone, 17838000,
iast_GLOBAL (17.944 s) : 17944000, 17944000
. : milestone, 17944000,
profiling (15.131 s) : 15131000, 15131000
. : milestone, 15131000,
tracing (14.795 s) : 14795000, 14795000
. : milestone, 14795000,
section candidate
no_agent (15.418 s) : 15418000, 15418000
. : milestone, 15418000,
appsec (14.552 s) : 14552000, 14552000
. : milestone, 14552000,
iast (17.955 s) : 17955000, 17955000
. : milestone, 17955000,
iast_GLOBAL (17.619 s) : 17619000, 17619000
. : milestone, 17619000,
profiling (14.764 s) : 14764000, 14764000
. : milestone, 14764000,
tracing (14.704 s) : 14704000, 14704000
. : milestone, 14704000,
|
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)
comp: remote config
Configuration at Runtime
tag: do not merge
Do not merge changes
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
Implement the Deferred Commit Pattern inspired by DebuggerProductChangesListener (suggested here) in AppSecConfigChangesListener. Operations (accept/remove) are accumulated during execution and executed atomically in commit() with guaranteed ordering.
Remove the exceptional remove → apply → commit from for ASM_DD from productState
Motivation
A Java ASM customer reported a memory spike when security rules were updated via Remote Configuration (RC):
We were able to reproduce the issue, and after talking with other tracers it looks like we have a problem with how ASM_DD product configurations are handled.
Right now, the configuration for that product needs to be cleared, if there was a previous one, before applying a new one. Otherwise we hit this issue (more details here).
This document aims to present solutions to be discussed in the java guild as the way we fixed it is more of a minimal illustration of a solution to solve the incident quickly.
Additional Notes
More info here
Contributor Checklist
type:and (comp:orinst:) labels in addition to any useful labelsclose,fixor any linking keywords when referencing an issue.Use
solvesinstead, and assign the PR milestone to the issueJira ticket: [PROJ-IDENT]