Exploit prevention for SSRF (in java.net.URL)#7373
Conversation
BenchmarksStartupParameters
See matching parameters
SummaryFound 1 performance improvements and 0 performance regressions! Performance is the same for 46 metrics, 16 unstable metrics.
Startup time reports for petclinicgantt
title petclinic - global startup overhead: candidate=1.39.0-SNAPSHOT~4d8ccf9360, baseline=1.39.0-SNAPSHOT~63ccd4c8fc
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.058 s) : 0, 1057671
Total [baseline] (10.325 s) : 0, 10324598
Agent [candidate] (1.052 s) : 0, 1051731
Total [candidate] (10.474 s) : 0, 10473986
section appsec
Agent [baseline] (1.173 s) : 0, 1172773
Total [baseline] (10.481 s) : 0, 10481108
Agent [candidate] (1.178 s) : 0, 1178328
Total [candidate] (10.509 s) : 0, 10509124
section iast
Agent [baseline] (1.184 s) : 0, 1184259
Total [baseline] (10.923 s) : 0, 10923449
Agent [candidate] (1.17 s) : 0, 1170417
Total [candidate] (10.797 s) : 0, 10796950
section profiling
Agent [baseline] (1.245 s) : 0, 1245155
Total [baseline] (10.655 s) : 0, 10654708
Agent [candidate] (1.243 s) : 0, 1243401
Total [candidate] (10.619 s) : 0, 10619333
gantt
title petclinic - break down per module: candidate=1.39.0-SNAPSHOT~4d8ccf9360, baseline=1.39.0-SNAPSHOT~63ccd4c8fc
dateFormat X
axisFormat %s
section tracing
BytebuddyAgent [baseline] (676.722 ms) : 0, 676722
BytebuddyAgent [candidate] (672.379 ms) : 0, 672379
GlobalTracer [baseline] (308.097 ms) : 0, 308097
GlobalTracer [candidate] (306.461 ms) : 0, 306461
AppSec [baseline] (51.092 ms) : 0, 51092
AppSec [candidate] (51.169 ms) : 0, 51169
Remote Config [baseline] (686.39 µs) : 0, 686
Remote Config [candidate] (662.887 µs) : 0, 663
Telemetry [baseline] (7.527 ms) : 0, 7527
Telemetry [candidate] (7.538 ms) : 0, 7538
section appsec
BytebuddyAgent [baseline] (680.145 ms) : 0, 680145
BytebuddyAgent [candidate] (683.443 ms) : 0, 683443
GlobalTracer [baseline] (300.803 ms) : 0, 300803
GlobalTracer [candidate] (302.557 ms) : 0, 302557
AppSec [baseline] (157.644 ms) : 0, 157644
AppSec [candidate] (158.17 ms) : 0, 158170
IAST [baseline] (21.449 ms) : 0, 21449
IAST [candidate] (19.798 ms) : 0, 19798
Remote Config [baseline] (596.055 µs) : 0, 596
Remote Config [candidate] (617.946 µs) : 0, 618
Telemetry [baseline] (9.338 ms) : 0, 9338
Telemetry [candidate] (10.062 ms) : 0, 10062
section iast
BytebuddyAgent [baseline] (787.955 ms) : 0, 787955
BytebuddyAgent [candidate] (777.304 ms) : 0, 777304
GlobalTracer [baseline] (298.101 ms) : 0, 298101
GlobalTracer [candidate] (296.117 ms) : 0, 296117
AppSec [baseline] (51.082 ms) : 0, 51082
AppSec [candidate] (50.051 ms) : 0, 50051
IAST [baseline] (24.997 ms) : 0, 24997
IAST [candidate] (23.281 ms) : 0, 23281
Remote Config [baseline] (576.79 µs) : 0, 577
Remote Config [candidate] (601.397 µs) : 0, 601
Telemetry [baseline] (8.003 ms) : 0, 8003
Telemetry [candidate] (9.58 ms) : 0, 9580
section profiling
BytebuddyAgent [baseline] (663.602 ms) : 0, 663602
BytebuddyAgent [candidate] (662.622 ms) : 0, 662622
GlobalTracer [baseline] (389.762 ms) : 0, 389762
GlobalTracer [candidate] (388.579 ms) : 0, 388579
AppSec [baseline] (52.164 ms) : 0, 52164
AppSec [candidate] (52.348 ms) : 0, 52348
Remote Config [baseline] (688.565 µs) : 0, 689
Remote Config [candidate] (688.398 µs) : 0, 688
Telemetry [baseline] (7.407 ms) : 0, 7407
Telemetry [candidate] (7.356 ms) : 0, 7356
ProfilingAgent [baseline] (94.458 ms) : 0, 94458
ProfilingAgent [candidate] (94.657 ms) : 0, 94657
Profiling [baseline] (94.482 ms) : 0, 94482
Profiling [candidate] (94.681 ms) : 0, 94681
Startup time reports for insecure-bankgantt
title insecure-bank - global startup overhead: candidate=1.39.0-SNAPSHOT~4d8ccf9360, baseline=1.39.0-SNAPSHOT~63ccd4c8fc
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.05 s) : 0, 1050024
Total [baseline] (8.508 s) : 0, 8508098
Agent [candidate] (1.055 s) : 0, 1055045
Total [candidate] (8.514 s) : 0, 8514002
section iast
Agent [baseline] (1.174 s) : 0, 1174487
Total [baseline] (8.987 s) : 0, 8987493
Agent [candidate] (1.171 s) : 0, 1170934
Total [candidate] (8.966 s) : 0, 8965782
section iast_HARDCODED_SECRET_DISABLED
Agent [baseline] (1.184 s) : 0, 1183829
Total [baseline] (8.981 s) : 0, 8981291
Agent [candidate] (1.178 s) : 0, 1178061
Total [candidate] (8.976 s) : 0, 8975807
section iast_TELEMETRY_OFF
Agent [baseline] (1.175 s) : 0, 1175341
Total [baseline] (8.989 s) : 0, 8988607
Agent [candidate] (1.164 s) : 0, 1164358
Total [candidate] (9.003 s) : 0, 9003086
gantt
title insecure-bank - break down per module: candidate=1.39.0-SNAPSHOT~4d8ccf9360, baseline=1.39.0-SNAPSHOT~63ccd4c8fc
dateFormat X
axisFormat %s
section tracing
BytebuddyAgent [baseline] (668.475 ms) : 0, 668475
BytebuddyAgent [candidate] (673.273 ms) : 0, 673273
GlobalTracer [baseline] (308.477 ms) : 0, 308477
GlobalTracer [candidate] (308.665 ms) : 0, 308665
AppSec [baseline] (51.333 ms) : 0, 51333
AppSec [candidate] (51.477 ms) : 0, 51477
Remote Config [baseline] (691.354 µs) : 0, 691
Remote Config [candidate] (654.562 µs) : 0, 655
Telemetry [baseline] (7.59 ms) : 0, 7590
Telemetry [candidate] (7.45 ms) : 0, 7450
section iast
BytebuddyAgent [baseline] (781.752 ms) : 0, 781752
BytebuddyAgent [candidate] (777.651 ms) : 0, 777651
GlobalTracer [baseline] (295.731 ms) : 0, 295731
GlobalTracer [candidate] (296.368 ms) : 0, 296368
AppSec [baseline] (54.575 ms) : 0, 54575
AppSec [candidate] (50.915 ms) : 0, 50915
IAST [baseline] (21.335 ms) : 0, 21335
IAST [candidate] (22.404 ms) : 0, 22404
Remote Config [baseline] (597.673 µs) : 0, 598
Remote Config [candidate] (584.184 µs) : 0, 584
Telemetry [baseline] (7.053 ms) : 0, 7053
Telemetry [candidate] (9.53 ms) : 0, 9530
section iast_HARDCODED_SECRET_DISABLED
BytebuddyAgent [baseline] (787.032 ms) : 0, 787032
BytebuddyAgent [candidate] (782.617 ms) : 0, 782617
GlobalTracer [baseline] (298.651 ms) : 0, 298651
GlobalTracer [candidate] (298.084 ms) : 0, 298084
AppSec [baseline] (48.922 ms) : 0, 48922
AppSec [candidate] (48.725 ms) : 0, 48725
IAST [baseline] (25.362 ms) : 0, 25362
IAST [candidate] (23.16 ms) : 0, 23160
Remote Config [baseline] (589.282 µs) : 0, 589
Remote Config [candidate] (609.385 µs) : 0, 609
Telemetry [baseline] (9.656 ms) : 0, 9656
Telemetry [candidate] (11.314 ms) : 0, 11314
section iast_TELEMETRY_OFF
BytebuddyAgent [baseline] (781.594 ms) : 0, 781594
BytebuddyAgent [candidate] (774.364 ms) : 0, 774364
GlobalTracer [baseline] (296.76 ms) : 0, 296760
GlobalTracer [candidate] (296.202 ms) : 0, 296202
AppSec [baseline] (52.855 ms) : 0, 52855
AppSec [candidate] (49.386 ms) : 0, 49386
IAST [baseline] (22.953 ms) : 0, 22953
IAST [candidate] (23.155 ms) : 0, 23155
Remote Config [baseline] (603.846 µs) : 0, 604
Remote Config [candidate] (600.004 µs) : 0, 600
Telemetry [baseline] (7.079 ms) : 0, 7079
Telemetry [candidate] (7.181 ms) : 0, 7181
LoadParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 12 metrics, 16 unstable metrics. Request duration reports for petclinicgantt
title petclinic - request duration [CI 0.99] : candidate=1.39.0-SNAPSHOT~4d8ccf9360, baseline=1.39.0-SNAPSHOT~63ccd4c8fc
dateFormat X
axisFormat %s
section baseline
no_agent (1.362 ms) : 1343, 1382
. : milestone, 1362,
appsec (1.739 ms) : 1717, 1762
. : milestone, 1739,
appsec_no_iast (1.734 ms) : 1710, 1759
. : milestone, 1734,
iast (1.498 ms) : 1475, 1521
. : milestone, 1498,
profiling (1.494 ms) : 1469, 1518
. : milestone, 1494,
tracing (1.459 ms) : 1435, 1484
. : milestone, 1459,
section candidate
no_agent (1.33 ms) : 1311, 1349
. : milestone, 1330,
appsec (1.759 ms) : 1735, 1782
. : milestone, 1759,
appsec_no_iast (1.731 ms) : 1708, 1755
. : milestone, 1731,
iast (1.489 ms) : 1467, 1512
. : milestone, 1489,
profiling (1.481 ms) : 1457, 1506
. : milestone, 1481,
tracing (1.487 ms) : 1462, 1512
. : milestone, 1487,
Request duration reports for insecure-bankgantt
title insecure-bank - request duration [CI 0.99] : candidate=1.39.0-SNAPSHOT~4d8ccf9360, baseline=1.39.0-SNAPSHOT~63ccd4c8fc
dateFormat X
axisFormat %s
section baseline
no_agent (367.235 µs) : 348, 386
. : milestone, 367,
iast (485.639 µs) : 464, 507
. : milestone, 486,
iast_FULL (551.696 µs) : 529, 574
. : milestone, 552,
iast_GLOBAL (505.825 µs) : 483, 528
. : milestone, 506,
iast_HARDCODED_SECRET_DISABLED (480.01 µs) : 459, 501
. : milestone, 480,
iast_INACTIVE (460.08 µs) : 437, 483
. : milestone, 460,
iast_TELEMETRY_OFF (481.216 µs) : 460, 503
. : milestone, 481,
tracing (443.618 µs) : 423, 464
. : milestone, 444,
section candidate
no_agent (369.407 µs) : 350, 389
. : milestone, 369,
iast (479.224 µs) : 457, 501
. : milestone, 479,
iast_FULL (559.675 µs) : 539, 581
. : milestone, 560,
iast_GLOBAL (503.886 µs) : 482, 526
. : milestone, 504,
iast_HARDCODED_SECRET_DISABLED (485.616 µs) : 464, 508
. : milestone, 486,
iast_INACTIVE (449.146 µs) : 428, 470
. : milestone, 449,
iast_TELEMETRY_OFF (476.213 µs) : 454, 498
. : milestone, 476,
tracing (443.588 µs) : 423, 464
. : milestone, 444,
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 biojavagantt
title biojava - execution time [CI 0.99] : candidate=1.39.0-SNAPSHOT~4d8ccf9360, baseline=1.39.0-SNAPSHOT~63ccd4c8fc
dateFormat X
axisFormat %s
section baseline
no_agent (15.164 s) : 15164000, 15164000
. : milestone, 15164000,
appsec (15.276 s) : 15276000, 15276000
. : milestone, 15276000,
iast (18.973 s) : 18973000, 18973000
. : milestone, 18973000,
iast_GLOBAL (17.671 s) : 17671000, 17671000
. : milestone, 17671000,
profiling (16.009 s) : 16009000, 16009000
. : milestone, 16009000,
tracing (15.115 s) : 15115000, 15115000
. : milestone, 15115000,
section candidate
no_agent (14.879 s) : 14879000, 14879000
. : milestone, 14879000,
appsec (15.198 s) : 15198000, 15198000
. : milestone, 15198000,
iast (18.564 s) : 18564000, 18564000
. : milestone, 18564000,
iast_GLOBAL (17.879 s) : 17879000, 17879000
. : milestone, 17879000,
profiling (15.903 s) : 15903000, 15903000
. : milestone, 15903000,
tracing (15.24 s) : 15240000, 15240000
. : milestone, 15240000,
Execution time for tomcatgantt
title tomcat - execution time [CI 0.99] : candidate=1.39.0-SNAPSHOT~4d8ccf9360, baseline=1.39.0-SNAPSHOT~63ccd4c8fc
dateFormat X
axisFormat %s
section baseline
no_agent (1.459 ms) : 1448, 1470
. : milestone, 1459,
appsec (2.232 ms) : 2198, 2267
. : milestone, 2232,
iast (1.966 ms) : 1925, 2008
. : milestone, 1966,
iast_GLOBAL (2.015 ms) : 1973, 2058
. : milestone, 2015,
profiling (1.867 ms) : 1833, 1901
. : milestone, 1867,
tracing (1.847 ms) : 1814, 1879
. : milestone, 1847,
section candidate
no_agent (1.462 ms) : 1450, 1473
. : milestone, 1462,
appsec (2.22 ms) : 2185, 2254
. : milestone, 2220,
iast (1.959 ms) : 1917, 2000
. : milestone, 1959,
iast_GLOBAL (2.031 ms) : 1987, 2075
. : milestone, 2031,
profiling (1.875 ms) : 1839, 1911
. : milestone, 1875,
tracing (1.838 ms) : 1806, 1870
. : milestone, 1838,
|
jandro996
left a comment
There was a problem hiding this comment.
LGTM
Great Job! I've added a minor comment related with naming
There was a problem hiding this comment.
So this is a Set comparison? Why not use Sets?
There was a problem hiding this comment.
Yep, changed!, thanks for the input.
There was a problem hiding this comment.
Done!, thanks
There was a problem hiding this comment.
It seems questionable to let this exception propagate.
Why not return an empty List.
There was a problem hiding this comment.
In case of failure fetching the call sites for the instrumenter it makes no sense to continue and it's better to let the AgentInstaller take care of the error:
[dd.trace 2024-08-07 11:16:20:637 +0200] [main] ERROR datadog.trace.agent.tooling.AgentInstaller - Failed to load - instrumentation.class=datadog.trace.instrumentation.iastinstrumenter.IastInstrumentation
java.io.UncheckedIOException: Problem loading call sites
6c3abd6 to
83336f3
Compare
smola
left a comment
There was a problem hiding this comment.
LGTM, provided that previous comments are addressed.
4e135cd to
60b804f
Compare
9920b1c to
16a7bf8
Compare
a67ca4e to
be799c5
Compare
be799c5 to
9dc7948
Compare
What Does This Do
Adds support for SSRF protection via RASP to network connections started via
java.net.URL:server.io.net.urladdressMotivation
Additional Notes
Since
java.net.URLis a JVM class and having it instrumented with byte-buddy might hurt performance, we have decided to use call sites to be able to skip internal URL callsContributor Checklist
type:and (comp:orinst:) labels in addition to any usefull labelsclose,fixor any linking keywords when referencing an issue.Use
solvesinstead, and assign the PR milestone to the issueJira ticket: APPSEC-46823