Added GraphQL monitoring support#6375
Merged
Merged
Conversation
ValentinZakharov
force-pushed
the
vzakharov/api_security_graphql
branch
from
December 15, 2023 17:06
d51aa7f to
9c0fcc0
Compare
BenchmarksStartupParameters
See matching parameters
SummaryFound 1 performance improvements and 0 performance regressions! Performance is the same for 47 metrics, 15 unstable metrics.
Startup time reports for insecure-bankgantt
title insecure-bank - global startup overhead: candidate=1.32.0-SNAPSHOT~25f4a37a6d, baseline=1.32.0-SNAPSHOT~6d2f2adf41
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.092 s) : 0, 1092087
Total [baseline] (8.602 s) : 0, 8602281
Agent [candidate] (1.081 s) : 0, 1080658
Total [candidate] (8.602 s) : 0, 8602356
section iast
Agent [baseline] (1.211 s) : 0, 1211066
Total [baseline] (9.045 s) : 0, 9044693
Agent [candidate] (1.216 s) : 0, 1215936
Total [candidate] (9.08 s) : 0, 9079611
section iast_HARDCODED_SECRET_DISABLED
Agent [baseline] (1.203 s) : 0, 1203161
Total [baseline] (8.995 s) : 0, 8995297
Agent [candidate] (1.214 s) : 0, 1213530
Total [candidate] (9.027 s) : 0, 9027491
section iast_TELEMETRY_OFF
Agent [baseline] (1.213 s) : 0, 1212929
Total [baseline] (9.088 s) : 0, 9087836
Agent [candidate] (1.202 s) : 0, 1202277
Total [candidate] (9.07 s) : 0, 9069761
gantt
title insecure-bank - break down per module: candidate=1.32.0-SNAPSHOT~25f4a37a6d, baseline=1.32.0-SNAPSHOT~6d2f2adf41
dateFormat X
axisFormat %s
section tracing
BytebuddyAgent [baseline] (705.074 ms) : 0, 705074
BytebuddyAgent [candidate] (696.335 ms) : 0, 696335
GlobalTracer [baseline] (294.62 ms) : 0, 294620
GlobalTracer [candidate] (292.264 ms) : 0, 292264
AppSec [baseline] (49.086 ms) : 0, 49086
AppSec [candidate] (49.095 ms) : 0, 49095
Remote Config [baseline] (743.742 µs) : 0, 744
Remote Config [candidate] (1.093 ms) : 0, 1093
Telemetry [baseline] (7.856 ms) : 0, 7856
Telemetry [candidate] (7.576 ms) : 0, 7576
section iast
BytebuddyAgent [baseline] (806.259 ms) : 0, 806259
BytebuddyAgent [candidate] (807.663 ms) : 0, 807663
GlobalTracer [baseline] (289.093 ms) : 0, 289093
GlobalTracer [candidate] (291.641 ms) : 0, 291641
AppSec [baseline] (50.841 ms) : 0, 50841
AppSec [candidate] (49.736 ms) : 0, 49736
IAST [baseline] (22.969 ms) : 0, 22969
IAST [candidate] (24.244 ms) : 0, 24244
Remote Config [baseline] (599.038 µs) : 0, 599
Remote Config [candidate] (584.732 µs) : 0, 585
Telemetry [baseline] (6.624 ms) : 0, 6624
Telemetry [candidate] (7.496 ms) : 0, 7496
section iast_HARDCODED_SECRET_DISABLED
BytebuddyAgent [baseline] (799.074 ms) : 0, 799074
BytebuddyAgent [candidate] (805.985 ms) : 0, 805985
GlobalTracer [baseline] (288.785 ms) : 0, 288785
GlobalTracer [candidate] (291.213 ms) : 0, 291213
AppSec [baseline] (49.317 ms) : 0, 49317
AppSec [candidate] (50.717 ms) : 0, 50717
IAST [baseline] (22.908 ms) : 0, 22908
IAST [candidate] (23.869 ms) : 0, 23869
Remote Config [baseline] (597.444 µs) : 0, 597
Remote Config [candidate] (584.758 µs) : 0, 585
Telemetry [baseline] (8.146 ms) : 0, 8146
Telemetry [candidate] (6.588 ms) : 0, 6588
section iast_TELEMETRY_OFF
BytebuddyAgent [baseline] (803.551 ms) : 0, 803551
BytebuddyAgent [candidate] (795.841 ms) : 0, 795841
GlobalTracer [baseline] (292.415 ms) : 0, 292415
GlobalTracer [candidate] (290.72 ms) : 0, 290720
AppSec [baseline] (49.232 ms) : 0, 49232
AppSec [candidate] (51.19 ms) : 0, 51190
IAST [baseline] (24.307 ms) : 0, 24307
IAST [candidate] (21.921 ms) : 0, 21921
Remote Config [baseline] (579.552 µs) : 0, 580
Remote Config [candidate] (580.507 µs) : 0, 581
Telemetry [baseline] (8.115 ms) : 0, 8115
Telemetry [candidate] (7.441 ms) : 0, 7441
Startup time reports for petclinicgantt
title petclinic - global startup overhead: candidate=1.32.0-SNAPSHOT~25f4a37a6d, baseline=1.32.0-SNAPSHOT~6d2f2adf41
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.08 s) : 0, 1080479
Total [baseline] (9.159 s) : 0, 9158785
Agent [candidate] (1.087 s) : 0, 1087311
Total [candidate] (9.171 s) : 0, 9170575
section appsec
Agent [baseline] (1.201 s) : 0, 1200764
Total [baseline] (9.333 s) : 0, 9332522
Agent [candidate] (1.203 s) : 0, 1203466
Total [candidate] (9.428 s) : 0, 9427853
section iast
Agent [baseline] (1.207 s) : 0, 1207122
Total [baseline] (9.405 s) : 0, 9404600
Agent [candidate] (1.214 s) : 0, 1214020
Total [candidate] (9.403 s) : 0, 9403344
section profiling
Agent [baseline] (1.273 s) : 0, 1272707
Total [baseline] (9.398 s) : 0, 9397658
Agent [candidate] (1.274 s) : 0, 1273847
Total [candidate] (9.392 s) : 0, 9392239
gantt
title petclinic - break down per module: candidate=1.32.0-SNAPSHOT~25f4a37a6d, baseline=1.32.0-SNAPSHOT~6d2f2adf41
dateFormat X
axisFormat %s
section tracing
BytebuddyAgent [baseline] (697.345 ms) : 0, 697345
BytebuddyAgent [candidate] (701.017 ms) : 0, 701017
GlobalTracer [baseline] (291.568 ms) : 0, 291568
GlobalTracer [candidate] (293.972 ms) : 0, 293972
AppSec [baseline] (48.758 ms) : 0, 48758
AppSec [candidate] (49.333 ms) : 0, 49333
Remote Config [baseline] (746.754 µs) : 0, 747
Remote Config [candidate] (1.129 ms) : 0, 1129
Telemetry [baseline] (7.855 ms) : 0, 7855
Telemetry [candidate] (7.393 ms) : 0, 7393
section appsec
BytebuddyAgent [baseline] (696.859 ms) : 0, 696859
BytebuddyAgent [candidate] (697.576 ms) : 0, 697576
GlobalTracer [baseline] (290.912 ms) : 0, 290912
GlobalTracer [candidate] (292.257 ms) : 0, 292257
AppSec [baseline] (153.33 ms) : 0, 153330
AppSec [candidate] (153.822 ms) : 0, 153822
Remote Config [baseline] (611.839 µs) : 0, 612
Remote Config [candidate] (619.775 µs) : 0, 620
Telemetry [baseline] (6.873 ms) : 0, 6873
Telemetry [candidate] (6.929 ms) : 0, 6929
IAST [baseline] (17.877 ms) : 0, 17877
IAST [candidate] (18.005 ms) : 0, 18005
section iast
BytebuddyAgent [baseline] (802.69 ms) : 0, 802690
BytebuddyAgent [candidate] (807.238 ms) : 0, 807238
GlobalTracer [baseline] (289.071 ms) : 0, 289071
GlobalTracer [candidate] (291.315 ms) : 0, 291315
AppSec [baseline] (50.027 ms) : 0, 50027
AppSec [candidate] (52.033 ms) : 0, 52033
Remote Config [baseline] (603.702 µs) : 0, 604
Remote Config [candidate] (582.849 µs) : 0, 583
Telemetry [baseline] (7.371 ms) : 0, 7371
Telemetry [candidate] (6.762 ms) : 0, 6762
IAST [baseline] (22.957 ms) : 0, 22957
IAST [candidate] (21.511 ms) : 0, 21511
section profiling
BytebuddyAgent [baseline] (688.696 ms) : 0, 688696
BytebuddyAgent [candidate] (689.202 ms) : 0, 689202
GlobalTracer [baseline] (375.831 ms) : 0, 375831
GlobalTracer [candidate] (376.361 ms) : 0, 376361
AppSec [baseline] (49.629 ms) : 0, 49629
AppSec [candidate] (49.854 ms) : 0, 49854
Remote Config [baseline] (793.653 µs) : 0, 794
Remote Config [candidate] (880.275 µs) : 0, 880
Telemetry [baseline] (7.397 ms) : 0, 7397
Telemetry [candidate] (7.286 ms) : 0, 7286
ProfilingAgent [baseline] (94.251 ms) : 0, 94251
ProfilingAgent [candidate] (94.105 ms) : 0, 94105
Profiling [baseline] (94.275 ms) : 0, 94275
Profiling [candidate] (94.128 ms) : 0, 94128
LoadRequest duration reports for insecure-bankgantt
title insecure-bank - request duration [CI 0.99] : candidate=1.32.0-SNAPSHOT~25f4a37a6d, baseline=1.32.0-SNAPSHOT~6d2f2adf41
dateFormat X
axisFormat %s
section baseline
no_agent (360.918 µs) : 341, 380
. : milestone, 361,
iast (468.534 µs) : 448, 489
. : milestone, 469,
iast_FULL (533.601 µs) : 513, 554
. : milestone, 534,
iast_GLOBAL (490.61 µs) : 470, 512
. : milestone, 491,
iast_HARDCODED_SECRET_DISABLED (476.809 µs) : 456, 498
. : milestone, 477,
iast_INACTIVE (448.624 µs) : 427, 470
. : milestone, 449,
iast_TELEMETRY_OFF (467.385 µs) : 447, 488
. : milestone, 467,
tracing (448.722 µs) : 428, 470
. : milestone, 449,
section candidate
no_agent (358.903 µs) : 339, 378
. : milestone, 359,
iast (470.558 µs) : 450, 491
. : milestone, 471,
iast_FULL (537.172 µs) : 516, 558
. : milestone, 537,
iast_GLOBAL (495.071 µs) : 474, 516
. : milestone, 495,
iast_HARDCODED_SECRET_DISABLED (470.334 µs) : 450, 491
. : milestone, 470,
iast_INACTIVE (443.293 µs) : 423, 463
. : milestone, 443,
iast_TELEMETRY_OFF (468.824 µs) : 448, 490
. : milestone, 469,
tracing (445.174 µs) : 424, 466
. : milestone, 445,
Request duration reports for petclinicgantt
title petclinic - request duration [CI 0.99] : candidate=1.32.0-SNAPSHOT~25f4a37a6d, baseline=1.32.0-SNAPSHOT~6d2f2adf41
dateFormat X
axisFormat %s
section baseline
no_agent (1.343 ms) : 1324, 1362
. : milestone, 1343,
appsec (1.76 ms) : 1737, 1784
. : milestone, 1760,
iast (1.512 ms) : 1489, 1535
. : milestone, 1512,
profiling (1.521 ms) : 1497, 1544
. : milestone, 1521,
tracing (1.486 ms) : 1462, 1509
. : milestone, 1486,
section candidate
no_agent (1.349 ms) : 1330, 1368
. : milestone, 1349,
appsec (1.778 ms) : 1754, 1801
. : milestone, 1778,
iast (1.506 ms) : 1483, 1530
. : milestone, 1506,
profiling (1.51 ms) : 1487, 1534
. : milestone, 1510,
tracing (1.498 ms) : 1475, 1522
. : milestone, 1498,
|
ValentinZakharov
force-pushed
the
vzakharov/api_security_graphql
branch
from
December 16, 2023 10:43
9c0fcc0 to
e04e4f6
Compare
smola
reviewed
Dec 18, 2023
|
|
||
| Address<Map<String, Object>> WAF_CONTEXT_PROCESSOR = new Address<>("waf.context.processor"); | ||
|
|
||
| Address<Map<String, ?>> SERVER_GRAPHQL_ALL_RESOLVERS = |
Member
There was a problem hiding this comment.
Have you checked whether latest GraphQL rules support the server.graphql.all_resolvers at all? Or they moved to server.graphql.resolver only?
Contributor
Author
There was a problem hiding this comment.
Yes, both are supported everywhere
ValentinZakharov
force-pushed
the
vzakharov/api_security_graphql
branch
from
December 18, 2023 15:16
1af2443 to
038d5bf
Compare
ValentinZakharov
force-pushed
the
vzakharov/api_security_graphql
branch
from
January 24, 2024 22:08
038d5bf to
49df193
Compare
ValentinZakharov
force-pushed
the
vzakharov/api_security_graphql
branch
from
January 30, 2024 00:45
6d29583 to
cdfd44e
Compare
ValentinZakharov
marked this pull request as ready for review
January 30, 2024 01:04
jandro996
approved these changes
Feb 2, 2024
This was referenced Feb 9, 2024
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
Implemented GraphQL monitoring support for ASM. Allows to detect and report attacks via GraphQL.
Current implementation consist of extension of GraphQL instrumentation along with new smoke-test application for testing resolvers.
ASM GraphQL monitoring will be enabled if the AppSec is enabled.
Motivation
The implementation support of GraphQL in our application security product is driven by the evolving landscape of customer needs and the growing adoption of GraphQL. GraphQL applications are susceptible to traditional types of attacks like Cross-Site Scripting (XSS) and SQL injection. Recognising potential security risks, we implemented GraphQL support in the ASM product to shielded from both novel and conventional threats.
Additional Notes
Jira ticket: APPSEC-11459