-
Notifications
You must be signed in to change notification settings - Fork 312
Adding missing XML request/response schema collection #9432
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
base: master
Are you sure you want to change the base?
Conversation
fd35d02
to
d4321c4
Compare
🎯 Code Coverage 🔗 Commit SHA: 0967f11 | Docs | Was this helpful? Give us feedback! |
BenchmarksStartupParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 50 metrics, 9 unstable metrics. Startup time reports for petclinicgantt
title petclinic - global startup overhead: candidate=1.54.0-SNAPSHOT~0967f11e2f, baseline=1.54.0-SNAPSHOT~1052f4935d
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.06 s) : 0, 1059829
Total [baseline] (10.796 s) : 0, 10795508
Agent [candidate] (1.072 s) : 0, 1072319
Total [candidate] (10.684 s) : 0, 10683803
section appsec
Agent [baseline] (1.239 s) : 0, 1239393
Total [baseline] (11.027 s) : 0, 11026838
Agent [candidate] (1.234 s) : 0, 1234385
Total [candidate] (11.03 s) : 0, 11029944
section iast
Agent [baseline] (1.191 s) : 0, 1191439
Total [baseline] (11.032 s) : 0, 11031998
Agent [candidate] (1.194 s) : 0, 1193896
Total [candidate] (11.22 s) : 0, 11220285
section profiling
Agent [baseline] (1.213 s) : 0, 1212767
Total [baseline] (10.945 s) : 0, 10944955
Agent [candidate] (1.21 s) : 0, 1209786
Total [candidate] (10.82 s) : 0, 10819514
gantt
title petclinic - break down per module: candidate=1.54.0-SNAPSHOT~0967f11e2f, baseline=1.54.0-SNAPSHOT~1052f4935d
dateFormat X
axisFormat %s
section tracing
crashtracking [baseline] (1.461 ms) : 0, 1461
crashtracking [candidate] (1.459 ms) : 0, 1459
BytebuddyAgent [baseline] (731.318 ms) : 0, 731318
BytebuddyAgent [candidate] (740.19 ms) : 0, 740190
GlobalTracer [baseline] (251.99 ms) : 0, 251990
GlobalTracer [candidate] (254.93 ms) : 0, 254930
AppSec [baseline] (30.604 ms) : 0, 30604
AppSec [candidate] (31.001 ms) : 0, 31001
Debugger [baseline] (6.421 ms) : 0, 6421
Debugger [candidate] (6.508 ms) : 0, 6508
Remote Config [baseline] (682.044 µs) : 0, 682
Remote Config [candidate] (685.609 µs) : 0, 686
Telemetry [baseline] (16.271 ms) : 0, 16271
Telemetry [candidate] (16.351 ms) : 0, 16351
section appsec
crashtracking [baseline] (1.506 ms) : 0, 1506
crashtracking [candidate] (1.449 ms) : 0, 1449
BytebuddyAgent [baseline] (758.275 ms) : 0, 758275
BytebuddyAgent [candidate] (755.799 ms) : 0, 755799
GlobalTracer [baseline] (247.057 ms) : 0, 247057
GlobalTracer [candidate] (245.142 ms) : 0, 245142
AppSec [baseline] (170.613 ms) : 0, 170613
AppSec [candidate] (171.758 ms) : 0, 171758
Debugger [baseline] (6.072 ms) : 0, 6072
Debugger [candidate] (6.028 ms) : 0, 6028
Remote Config [baseline] (645.179 µs) : 0, 645
Remote Config [candidate] (622.919 µs) : 0, 623
Telemetry [baseline] (10.063 ms) : 0, 10063
Telemetry [candidate] (8.57 ms) : 0, 8570
IAST [baseline] (23.828 ms) : 0, 23828
IAST [candidate] (23.811 ms) : 0, 23811
section iast
crashtracking [baseline] (1.448 ms) : 0, 1448
crashtracking [candidate] (1.461 ms) : 0, 1461
BytebuddyAgent [baseline] (853.24 ms) : 0, 853240
BytebuddyAgent [candidate] (855.319 ms) : 0, 855319
GlobalTracer [baseline] (245.77 ms) : 0, 245770
GlobalTracer [candidate] (246.659 ms) : 0, 246659
AppSec [baseline] (25.608 ms) : 0, 25608
AppSec [candidate] (25.698 ms) : 0, 25698
Debugger [baseline] (6.092 ms) : 0, 6092
Debugger [candidate] (6.004 ms) : 0, 6004
Remote Config [baseline] (594.909 µs) : 0, 595
Remote Config [candidate] (599.253 µs) : 0, 599
Telemetry [baseline] (8.249 ms) : 0, 8249
Telemetry [candidate] (8.316 ms) : 0, 8316
IAST [baseline] (29.481 ms) : 0, 29481
IAST [candidate] (28.789 ms) : 0, 28789
section profiling
crashtracking [baseline] (1.444 ms) : 0, 1444
crashtracking [candidate] (1.437 ms) : 0, 1437
BytebuddyAgent [baseline] (763.685 ms) : 0, 763685
BytebuddyAgent [candidate] (762.449 ms) : 0, 762449
GlobalTracer [baseline] (233.278 ms) : 0, 233278
GlobalTracer [candidate] (232.519 ms) : 0, 232519
AppSec [baseline] (31.366 ms) : 0, 31366
AppSec [candidate] (31.203 ms) : 0, 31203
Debugger [baseline] (12.881 ms) : 0, 12881
Debugger [candidate] (12.827 ms) : 0, 12827
Remote Config [baseline] (716.508 µs) : 0, 717
Remote Config [candidate] (744.354 µs) : 0, 744
Telemetry [baseline] (9.397 ms) : 0, 9397
Telemetry [candidate] (9.633 ms) : 0, 9633
ProfilingAgent [baseline] (108.683 ms) : 0, 108683
ProfilingAgent [candidate] (107.649 ms) : 0, 107649
Profiling [baseline] (109.307 ms) : 0, 109307
Profiling [candidate] (108.308 ms) : 0, 108308
Startup time reports for insecure-bankgantt
title insecure-bank - global startup overhead: candidate=1.54.0-SNAPSHOT~0967f11e2f, baseline=1.54.0-SNAPSHOT~1052f4935d
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.062 s) : 0, 1061743
Total [baseline] (8.617 s) : 0, 8616534
Agent [candidate] (1.063 s) : 0, 1063271
Total [candidate] (8.617 s) : 0, 8616754
section iast
Agent [baseline] (1.191 s) : 0, 1191420
Total [baseline] (9.297 s) : 0, 9297168
Agent [candidate] (1.191 s) : 0, 1191267
Total [candidate] (9.279 s) : 0, 9278592
gantt
title insecure-bank - break down per module: candidate=1.54.0-SNAPSHOT~0967f11e2f, baseline=1.54.0-SNAPSHOT~1052f4935d
dateFormat X
axisFormat %s
section tracing
crashtracking [baseline] (1.455 ms) : 0, 1455
crashtracking [candidate] (1.46 ms) : 0, 1460
BytebuddyAgent [baseline] (733.221 ms) : 0, 733221
BytebuddyAgent [candidate] (734.189 ms) : 0, 734189
GlobalTracer [baseline] (252.211 ms) : 0, 252211
GlobalTracer [candidate] (252.498 ms) : 0, 252498
AppSec [baseline] (30.521 ms) : 0, 30521
AppSec [candidate] (30.587 ms) : 0, 30587
Debugger [baseline] (6.39 ms) : 0, 6390
Debugger [candidate] (6.432 ms) : 0, 6432
Remote Config [baseline] (699.97 µs) : 0, 700
Remote Config [candidate] (675.957 µs) : 0, 676
Telemetry [baseline] (16.282 ms) : 0, 16282
Telemetry [candidate] (16.428 ms) : 0, 16428
section iast
crashtracking [baseline] (1.456 ms) : 0, 1456
crashtracking [candidate] (1.465 ms) : 0, 1465
BytebuddyAgent [baseline] (852.9 ms) : 0, 852900
BytebuddyAgent [candidate] (853.434 ms) : 0, 853434
GlobalTracer [baseline] (246.947 ms) : 0, 246947
GlobalTracer [candidate] (248.265 ms) : 0, 248265
AppSec [baseline] (25.693 ms) : 0, 25693
AppSec [candidate] (24.671 ms) : 0, 24671
Debugger [baseline] (6.043 ms) : 0, 6043
Debugger [candidate] (5.992 ms) : 0, 5992
Remote Config [baseline] (593.166 µs) : 0, 593
Remote Config [candidate] (588.549 µs) : 0, 589
Telemetry [baseline] (8.168 ms) : 0, 8168
Telemetry [candidate] (8.132 ms) : 0, 8132
IAST [baseline] (28.757 ms) : 0, 28757
IAST [candidate] (27.894 ms) : 0, 27894
LoadParameters
See matching parameters
SummaryFound 1 performance improvements and 1 performance regressions! Performance is the same for 10 metrics, 12 unstable metrics.
Request duration reports for insecure-bankgantt
title insecure-bank - request duration [CI 0.99] : candidate=1.54.0-SNAPSHOT~0967f11e2f, baseline=1.54.0-SNAPSHOT~1052f4935d
dateFormat X
axisFormat %s
section baseline
no_agent (4.392 ms) : 4340, 4443
. : milestone, 4392,
iast (9.707 ms) : 9546, 9868
. : milestone, 9707,
iast_FULL (14.187 ms) : 13904, 14471
. : milestone, 14187,
iast_GLOBAL (10.838 ms) : 10646, 11030
. : milestone, 10838,
profiling (9.108 ms) : 8965, 9251
. : milestone, 9108,
tracing (7.989 ms) : 7866, 8112
. : milestone, 7989,
section candidate
no_agent (4.414 ms) : 4358, 4471
. : milestone, 4414,
iast (9.517 ms) : 9360, 9674
. : milestone, 9517,
iast_FULL (14.237 ms) : 13948, 14525
. : milestone, 14237,
iast_GLOBAL (10.962 ms) : 10752, 11173
. : milestone, 10962,
profiling (8.963 ms) : 8819, 9106
. : milestone, 8963,
tracing (7.849 ms) : 7737, 7961
. : milestone, 7849,
Request duration reports for petclinicgantt
title petclinic - request duration [CI 0.99] : candidate=1.54.0-SNAPSHOT~0967f11e2f, baseline=1.54.0-SNAPSHOT~1052f4935d
dateFormat X
axisFormat %s
section baseline
no_agent (36.56 ms) : 36274, 36846
. : milestone, 36560,
appsec (47.996 ms) : 47578, 48415
. : milestone, 47996,
code_origins (45.271 ms) : 44876, 45665
. : milestone, 45271,
iast (44.861 ms) : 44477, 45246
. : milestone, 44861,
profiling (48.852 ms) : 48405, 49299
. : milestone, 48852,
tracing (44.77 ms) : 44409, 45132
. : milestone, 44770,
section candidate
no_agent (38.099 ms) : 37792, 38407
. : milestone, 38099,
appsec (49.263 ms) : 48830, 49696
. : milestone, 49263,
code_origins (44.814 ms) : 44442, 45185
. : milestone, 44814,
iast (44.787 ms) : 44407, 45167
. : milestone, 44787,
profiling (46.773 ms) : 46360, 47185
. : milestone, 46773,
tracing (46.016 ms) : 45616, 46416
. : milestone, 46016,
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.54.0-SNAPSHOT~0967f11e2f, baseline=1.54.0-SNAPSHOT~1052f4935d
dateFormat X
axisFormat %s
section baseline
no_agent (1.49 ms) : 1478, 1501
. : milestone, 1490,
appsec (3.742 ms) : 3526, 3959
. : milestone, 3742,
iast (2.21 ms) : 2148, 2273
. : milestone, 2210,
iast_GLOBAL (2.255 ms) : 2192, 2318
. : milestone, 2255,
profiling (2.059 ms) : 2008, 2109
. : milestone, 2059,
tracing (2.048 ms) : 1998, 2097
. : milestone, 2048,
section candidate
no_agent (1.48 ms) : 1468, 1492
. : milestone, 1480,
appsec (3.743 ms) : 3525, 3961
. : milestone, 3743,
iast (2.209 ms) : 2147, 2272
. : milestone, 2209,
iast_GLOBAL (2.253 ms) : 2191, 2316
. : milestone, 2253,
profiling (2.079 ms) : 2027, 2131
. : milestone, 2079,
tracing (2.032 ms) : 1983, 2081
. : milestone, 2032,
Execution time for biojavagantt
title biojava - execution time [CI 0.99] : candidate=1.54.0-SNAPSHOT~0967f11e2f, baseline=1.54.0-SNAPSHOT~1052f4935d
dateFormat X
axisFormat %s
section baseline
no_agent (14.947 s) : 14947000, 14947000
. : milestone, 14947000,
appsec (14.905 s) : 14905000, 14905000
. : milestone, 14905000,
iast (18.118 s) : 18118000, 18118000
. : milestone, 18118000,
iast_GLOBAL (18.278 s) : 18278000, 18278000
. : milestone, 18278000,
profiling (15.417 s) : 15417000, 15417000
. : milestone, 15417000,
tracing (14.801 s) : 14801000, 14801000
. : milestone, 14801000,
section candidate
no_agent (14.97 s) : 14970000, 14970000
. : milestone, 14970000,
appsec (15.151 s) : 15151000, 15151000
. : milestone, 15151000,
iast (18.725 s) : 18725000, 18725000
. : milestone, 18725000,
iast_GLOBAL (18.142 s) : 18142000, 18142000
. : milestone, 18142000,
profiling (15.403 s) : 15403000, 15403000
. : milestone, 15403000,
tracing (14.865 s) : 14865000, 14865000
. : milestone, 14865000,
|
Looks good! I updated the title of the PR because you’re solving the problem for both request and response. |
849c2bb
to
104bbbd
Compare
92c36be
to
5328ef4
Compare
b0bb9b0
to
883c505
Compare
Hi! 👋 Looks like you updated a Git Submodule.
|
883c505
to
dbf8609
Compare
Hi! 👋 Looks like you updated a Git Submodule.
|
dbf8609
to
0f25a53
Compare
Hi! 👋 Looks like you updated a Git Submodule.
|
0f25a53
to
2d76ec9
Compare
Hi! 👋 Looks like you updated a Git Submodule.
|
2d76ec9
to
3334659
Compare
Hi! 👋 Looks like you updated a Git Submodule.
|
3334659
to
cb66848
Compare
Hi! 👋 Looks like you updated a Git Submodule.
|
cb66848
to
c11840f
Compare
Hi! 👋 Looks like you updated a Git Submodule.
|
c11840f
to
b47fdf5
Compare
Hi! 👋 Looks like you updated a Git Submodule.
|
public final class XmlDomUtils { | ||
|
||
/** Default maximum recursion depth for XML DOM conversion to prevent stack overflow. */ | ||
public static final int DEFAULT_MAX_CONVERSION_DEPTH = 15; |
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.
any reason to set the max depth to 15 here?
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.
didn’t want to risk overflowing the client app 😅
* | ||
* <p>The method applies the same truncation limits as the main conversion logic. | ||
*/ | ||
private static Object doConversionXmlDom(Object obj, int depth, State state) { |
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.
Hey! Just wondering... would it make sense to preserve the namespace info here?
Right now we are dropping the XML namespaces. Maybe we could keep the full name using something like {namespace}localName?
What do you think, @sezen-datadog, @manuel-alvarez-alvarez?
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.
it's a good place to do it as technically all xml conversions pass through here!
Map<String, Object> newMap = new HashMap<>(); | ||
|
||
// Add attributes | ||
NamedNodeMap attributes = elem.getAttributes(); |
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.
Would it make sense to separate element attributes from child elements in the map?
Maybe something like:
newMap.put("@attributes", attributesMap)
newMap.put("elements", elementsMap)
What do you think?
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.
I’m not against it~!
return new HashMap<>(); | ||
} else if (obj instanceof Element) { | ||
Element elem = (Element) obj; | ||
Map<String, Object> newMap = new HashMap<>(); |
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.
I don’t have a strong opinion on this, but I wonder if it could be useful for XML to preserve the order of elements.
Not sure if any WAF rule currently relies on this though, maybe it’s something worth considering? 😅
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.
i don’t think the order matters on json (it's also a map!) so perhaps no reason to be really concerned with it right now
Signed-off-by: sezen.leblay <[email protected]>
b47fdf5
to
0967f11
Compare
What Does This Do
The instrumentation can digest XML to pass onto WAF
Motivation
Additional Notes
Contributor Checklist
type:
and (comp:
orinst:
) labels in addition to any usefull labelsclose
,fix
or any linking keywords when referencing an issue.Use
solves
instead, and assign the PR milestone to the issueJira ticket: APPSEC-58618