-
Notifications
You must be signed in to change notification settings - Fork 305
Extract RestEasy json body response schemas #9015
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: alejandro.gonzalez/api-sec-jersey-response-schema
Are you sure you want to change the base?
Extract RestEasy json body response schemas #9015
Conversation
BenchmarksStartupParameters
See matching parameters
SummaryFound 0 performance improvements and 1 performance regressions! Performance is the same for 43 metrics, 9 unstable metrics.
Startup time reports for petclinicgantt
title petclinic - global startup overhead: candidate=1.50.0-SNAPSHOT~f88d1cfe49, baseline=1.50.0-SNAPSHOT~6db7d82c6e
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.031 s) : 0, 1030501
Total [baseline] (10.605 s) : 0, 10604539
Agent [candidate] (1.034 s) : 0, 1033924
Total [candidate] (10.514 s) : 0, 10513929
section appsec
Agent [baseline] (1.179 s) : 0, 1179476
Total [baseline] (10.736 s) : 0, 10736161
Agent [candidate] (1.178 s) : 0, 1177601
Total [candidate] (10.674 s) : 0, 10673903
section iast
Agent [baseline] (1.155 s) : 0, 1154596
Total [baseline] (10.953 s) : 0, 10953194
Agent [candidate] (1.161 s) : 0, 1160514
Total [candidate] (10.851 s) : 0, 10851143
section profiling
Agent [baseline] (1.265 s) : 0, 1264857
Total [baseline] (10.969 s) : 0, 10968525
Agent [candidate] (1.271 s) : 0, 1270935
Total [candidate] (10.862 s) : 0, 10861676
gantt
title petclinic - break down per module: candidate=1.50.0-SNAPSHOT~f88d1cfe49, baseline=1.50.0-SNAPSHOT~6db7d82c6e
dateFormat X
axisFormat %s
section tracing
BytebuddyAgent [baseline] (689.387 ms) : 0, 689387
BytebuddyAgent [candidate] (688.264 ms) : 0, 688264
GlobalTracer [baseline] (242.67 ms) : 0, 242670
GlobalTracer [candidate] (241.993 ms) : 0, 241993
AppSec [baseline] (59.982 ms) : 0, 59982
AppSec [candidate] (61.115 ms) : 0, 61115
Debugger [baseline] (7.744 ms) : 0, 7744
Debugger [candidate] (6.248 ms) : 0, 6248
Remote Config [baseline] (679.37 µs) : 0, 679
Remote Config [candidate] (672.824 µs) : 0, 673
Telemetry [baseline] (8.989 ms) : 0, 8989
Telemetry [candidate] (11.901 ms) : 0, 11901
section appsec
BytebuddyAgent [baseline] (711.553 ms) : 0, 711553
BytebuddyAgent [candidate] (704.666 ms) : 0, 704666
GlobalTracer [baseline] (235.741 ms) : 0, 235741
GlobalTracer [candidate] (234.524 ms) : 0, 234524
IAST [baseline] (21.83 ms) : 0, 21830
IAST [candidate] (21.744 ms) : 0, 21744
AppSec [baseline] (175.652 ms) : 0, 175652
AppSec [candidate] (179.611 ms) : 0, 179611
Debugger [baseline] (5.939 ms) : 0, 5939
Debugger [candidate] (5.819 ms) : 0, 5819
Remote Config [baseline] (608.108 µs) : 0, 608
Remote Config [candidate] (636.657 µs) : 0, 637
Telemetry [baseline] (7.233 ms) : 0, 7233
Telemetry [candidate] (7.155 ms) : 0, 7155
section iast
BytebuddyAgent [baseline] (808.195 ms) : 0, 808195
BytebuddyAgent [candidate] (807.515 ms) : 0, 807515
GlobalTracer [baseline] (232.415 ms) : 0, 232415
GlobalTracer [candidate] (232.288 ms) : 0, 232288
IAST [baseline] (25.939 ms) : 0, 25939
IAST [candidate] (27.779 ms) : 0, 27779
AppSec [baseline] (52.612 ms) : 0, 52612
AppSec [candidate] (54.699 ms) : 0, 54699
Debugger [baseline] (5.915 ms) : 0, 5915
Debugger [candidate] (6.048 ms) : 0, 6048
Remote Config [baseline] (594.154 µs) : 0, 594
Remote Config [candidate] (615.525 µs) : 0, 616
Telemetry [baseline] (8.012 ms) : 0, 8012
Telemetry [candidate] (8.021 ms) : 0, 8021
section profiling
BytebuddyAgent [baseline] (674.212 ms) : 0, 674212
BytebuddyAgent [candidate] (674.607 ms) : 0, 674607
GlobalTracer [baseline] (359.766 ms) : 0, 359766
GlobalTracer [candidate] (358.947 ms) : 0, 358947
AppSec [baseline] (61.855 ms) : 0, 61855
AppSec [candidate] (64.551 ms) : 0, 64551
Debugger [baseline] (6.12 ms) : 0, 6120
Debugger [candidate] (6.24 ms) : 0, 6240
Remote Config [baseline] (702.836 µs) : 0, 703
Remote Config [candidate] (685.795 µs) : 0, 686
Telemetry [baseline] (8.12 ms) : 0, 8120
Telemetry [candidate] (8.214 ms) : 0, 8214
ProfilingAgent [baseline] (105.679 ms) : 0, 105679
ProfilingAgent [candidate] (107.005 ms) : 0, 107005
Profiling [baseline] (105.704 ms) : 0, 105704
Profiling [candidate] (107.03 ms) : 0, 107030
Startup time reports for insecure-bankgantt
title insecure-bank - global startup overhead: candidate=1.50.0-SNAPSHOT~f88d1cfe49, baseline=1.50.0-SNAPSHOT~6db7d82c6e
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.032 s) : 0, 1031598
Total [baseline] (8.562 s) : 0, 8561689
Agent [candidate] (1.027 s) : 0, 1026634
Total [candidate] (8.561 s) : 0, 8561367
section iast
Agent [baseline] (1.148 s) : 0, 1148092
Total [baseline] (9.19 s) : 0, 9189649
Agent [candidate] (1.152 s) : 0, 1151775
Total [candidate] (9.201 s) : 0, 9201419
gantt
title insecure-bank - break down per module: candidate=1.50.0-SNAPSHOT~f88d1cfe49, baseline=1.50.0-SNAPSHOT~6db7d82c6e
dateFormat X
axisFormat %s
section tracing
BytebuddyAgent [baseline] (690.34 ms) : 0, 690340
BytebuddyAgent [candidate] (683.657 ms) : 0, 683657
GlobalTracer [baseline] (243.282 ms) : 0, 243282
GlobalTracer [candidate] (240.35 ms) : 0, 240350
AppSec [baseline] (59.46 ms) : 0, 59460
AppSec [candidate] (58.864 ms) : 0, 58864
Debugger [baseline] (6.296 ms) : 0, 6296
Debugger [candidate] (6.255 ms) : 0, 6255
Remote Config [baseline] (674.112 µs) : 0, 674
Remote Config [candidate] (673.944 µs) : 0, 674
Telemetry [baseline] (10.591 ms) : 0, 10591
Telemetry [candidate] (13.476 ms) : 0, 13476
section iast
BytebuddyAgent [baseline] (803.345 ms) : 0, 803345
BytebuddyAgent [candidate] (801.42 ms) : 0, 801420
GlobalTracer [baseline] (231.098 ms) : 0, 231098
GlobalTracer [candidate] (230.589 ms) : 0, 230589
IAST [baseline] (26.57 ms) : 0, 26570
IAST [candidate] (29.422 ms) : 0, 29422
AppSec [baseline] (51.837 ms) : 0, 51837
AppSec [candidate] (52.51 ms) : 0, 52510
Debugger [baseline] (5.92 ms) : 0, 5920
Debugger [candidate] (5.955 ms) : 0, 5955
Remote Config [baseline] (594.888 µs) : 0, 595
Remote Config [candidate] (586.095 µs) : 0, 586
Telemetry [baseline] (7.998 ms) : 0, 7998
Telemetry [candidate] (7.929 ms) : 0, 7929
LoadParameters
See matching parameters
SummaryFound 6 performance improvements and 0 performance regressions! Performance is the same for 0 metrics, 6 unstable metrics.
Request duration reports for petclinicgantt
title petclinic - request duration [CI 0.99] : candidate=1.50.0-SNAPSHOT~f88d1cfe49, baseline=1.50.0-SNAPSHOT~6db7d82c6e
dateFormat X
axisFormat %s
section baseline
no_agent (12.236 ms) : 12124, 12348
. : milestone, 12236,
appsec (73.066 ms) : 72042, 74089
. : milestone, 73066,
code_origins (88.474 ms) : 86570, 90377
. : milestone, 88474,
iast (80.869 ms) : 79579, 82159
. : milestone, 80869,
profiling (63.816 ms) : 62932, 64699
. : milestone, 63816,
tracing (53.438 ms) : 52642, 54235
. : milestone, 53438,
section candidate
no_agent (8.088 ms) : 8065, 8111
. : milestone, 8088,
appsec (10.172 ms) : 10116, 10227
. : milestone, 10172,
code_origins (44.234 ms) : 43868, 44599
. : milestone, 44234,
iast (35.943 ms) : 35581, 36306
. : milestone, 35943,
profiling (7.694 ms) : 7665, 7724
. : milestone, 7694,
tracing (8.062 ms) : 8036, 8088
. : milestone, 8062,
DacapoParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 12 metrics, 0 unstable metrics. Execution time for tomcatgantt
title tomcat - execution time [CI 0.99] : candidate=1.50.0-SNAPSHOT~f88d1cfe49, baseline=1.50.0-SNAPSHOT~6db7d82c6e
dateFormat X
axisFormat %s
section baseline
no_agent (1.484 ms) : 1472, 1495
. : milestone, 1484,
appsec (2.407 ms) : 2358, 2456
. : milestone, 2407,
iast (2.194 ms) : 2133, 2255
. : milestone, 2194,
iast_GLOBAL (2.233 ms) : 2171, 2295
. : milestone, 2233,
profiling (2.034 ms) : 1984, 2084
. : milestone, 2034,
tracing (2.006 ms) : 1959, 2054
. : milestone, 2006,
section candidate
no_agent (1.476 ms) : 1465, 1488
. : milestone, 1476,
appsec (2.403 ms) : 2354, 2452
. : milestone, 2403,
iast (2.196 ms) : 2134, 2258
. : milestone, 2196,
iast_GLOBAL (2.236 ms) : 2174, 2299
. : milestone, 2236,
profiling (2.026 ms) : 1977, 2076
. : milestone, 2026,
tracing (2.01 ms) : 1962, 2058
. : milestone, 2010,
Execution time for biojavagantt
title biojava - execution time [CI 0.99] : candidate=1.50.0-SNAPSHOT~f88d1cfe49, baseline=1.50.0-SNAPSHOT~6db7d82c6e
dateFormat X
axisFormat %s
section baseline
no_agent (15.565 s) : 15565000, 15565000
. : milestone, 15565000,
appsec (14.714 s) : 14714000, 14714000
. : milestone, 14714000,
iast (18.461 s) : 18461000, 18461000
. : milestone, 18461000,
iast_GLOBAL (17.729 s) : 17729000, 17729000
. : milestone, 17729000,
profiling (15.708 s) : 15708000, 15708000
. : milestone, 15708000,
tracing (14.841 s) : 14841000, 14841000
. : milestone, 14841000,
section candidate
no_agent (15.537 s) : 15537000, 15537000
. : milestone, 15537000,
appsec (14.781 s) : 14781000, 14781000
. : milestone, 14781000,
iast (18.925 s) : 18925000, 18925000
. : milestone, 18925000,
iast_GLOBAL (17.974 s) : 17974000, 17974000
. : milestone, 17974000,
profiling (15.759 s) : 15759000, 15759000
. : milestone, 15759000,
tracing (15.079 s) : 15079000, 15079000
. : milestone, 15079000,
|
String jarPath = System.getProperty("datadog.smoketest.resteasy.jar.path") | ||
|
||
List<String> command = new ArrayList<>() | ||
command.add(javaPath()) | ||
command.add("-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005") | ||
command.addAll(defaultJavaProperties) | ||
command.addAll(defaultAppSecProperties) | ||
if (Platform.isJavaVersionAtLeast(17)) { | ||
command.addAll(["--add-opens", "java.base/java.lang=ALL-UNNAMED"]) | ||
} | ||
command.addAll(["-jar", jarPath, Integer.toString(httpPort)]) | ||
ProcessBuilder processBuilder = new ProcessBuilder(command) | ||
processBuilder.directory(new File(buildDirectory)) |
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.
suggestion, this code can be more groovy:
String jarPath = System.getProperty("datadog.smoketest.resteasy.jar.path") | |
List<String> command = new ArrayList<>() | |
command.add(javaPath()) | |
command.add("-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005") | |
command.addAll(defaultJavaProperties) | |
command.addAll(defaultAppSecProperties) | |
if (Platform.isJavaVersionAtLeast(17)) { | |
command.addAll(["--add-opens", "java.base/java.lang=ALL-UNNAMED"]) | |
} | |
command.addAll(["-jar", jarPath, Integer.toString(httpPort)]) | |
ProcessBuilder processBuilder = new ProcessBuilder(command) | |
processBuilder.directory(new File(buildDirectory)) | |
def jarPath = System.getProperty('datadog.smoketest.resteasy.jar.path') | |
def command = [ | |
javaPath(), | |
'-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005', | |
*defaultJavaProperties, | |
*defaultAppSecProperties | |
] | |
if (Platform.javaVersion >= 17) { | |
command += ['--add-opens', 'java.base/java.lang=ALL-UNNAMED'] | |
} | |
command += ['-jar', jarPath, "$httpPort"] | |
new ProcessBuilder(command).tap { | |
directory = new File(buildDirectory) | |
} |
@@ -10,6 +11,8 @@ public class App extends Application { | |||
|
|||
public App() { | |||
singletons.add(new Resource()); | |||
singletons.add(new org.jboss.resteasy.plugins.providers.StringTextStar()); // Writer for String |
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.
nitpick: Any reason to have fully qualified name here?
What Does This Do
Adds smoke test to probe that response body extraction for RestEasy JSON endpoints to enable automatic API schema discovery and protection by the Web Application Firewall (WAF) was covered with the instrumentation done in #9014
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: [PROJ-IDENT]