-
Notifications
You must be signed in to change notification settings - Fork 278
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
Collect and report RASP events (+Stack traces) #7162
Conversation
83a3a88
to
324d272
Compare
BenchmarksStartupParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 54 metrics, 17 unstable metrics. Startup time reports for petclinicgantt
title petclinic - global startup overhead: candidate=1.36.0-SNAPSHOT~86be898629, baseline=1.36.0-SNAPSHOT~24d82a55c1
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.069 s) : 0, 1069215
Total [baseline] (10.341 s) : 0, 10341000
Agent [candidate] (1.062 s) : 0, 1062417
Total [candidate] (10.378 s) : 0, 10378376
section appsec
Agent [baseline] (1.184 s) : 0, 1184282
Total [baseline] (10.424 s) : 0, 10423970
Agent [candidate] (1.182 s) : 0, 1181620
Total [candidate] (10.448 s) : 0, 10447626
section iast
Agent [baseline] (1.177 s) : 0, 1177035
Total [baseline] (10.693 s) : 0, 10693186
Agent [candidate] (1.177 s) : 0, 1177323
Total [candidate] (10.723 s) : 0, 10723340
section profiling
Agent [baseline] (1.272 s) : 0, 1272015
Total [baseline] (10.658 s) : 0, 10658233
Agent [candidate] (1.263 s) : 0, 1262617
Total [candidate] (10.702 s) : 0, 10702101
gantt
title petclinic - break down per module: candidate=1.36.0-SNAPSHOT~86be898629, baseline=1.36.0-SNAPSHOT~24d82a55c1
dateFormat X
axisFormat %s
section tracing
BytebuddyAgent [baseline] (670.581 ms) : 0, 670581
BytebuddyAgent [candidate] (665.265 ms) : 0, 665265
GlobalTracer [baseline] (305.03 ms) : 0, 305030
GlobalTracer [candidate] (303.9 ms) : 0, 303900
AppSec [baseline] (50.331 ms) : 0, 50331
AppSec [candidate] (50.349 ms) : 0, 50349
Logs Intake [baseline] (341.041 µs) : 0, 341
Logs Intake [candidate] (336.911 µs) : 0, 337
Remote Config [baseline] (687.798 µs) : 0, 688
Remote Config [candidate] (674.623 µs) : 0, 675
Telemetry [baseline] (7.627 ms) : 0, 7627
Telemetry [candidate] (7.57 ms) : 0, 7570
section appsec
BytebuddyAgent [baseline] (677.954 ms) : 0, 677954
BytebuddyAgent [candidate] (676.112 ms) : 0, 676112
GlobalTracer [baseline] (297.547 ms) : 0, 297547
GlobalTracer [candidate] (297.215 ms) : 0, 297215
AppSec [baseline] (153.815 ms) : 0, 153815
AppSec [candidate] (153.648 ms) : 0, 153648
Logs Intake [baseline] (332.861 µs) : 0, 333
Logs Intake [candidate] (318.659 µs) : 0, 319
Remote Config [baseline] (644.212 µs) : 0, 644
Remote Config [candidate] (643.736 µs) : 0, 644
Telemetry [baseline] (8.763 ms) : 0, 8763
Telemetry [candidate] (8.45 ms) : 0, 8450
IAST [baseline] (21.607 ms) : 0, 21607
IAST [candidate] (21.745 ms) : 0, 21745
section iast
BytebuddyAgent [baseline] (785.214 ms) : 0, 785214
BytebuddyAgent [candidate] (785.85 ms) : 0, 785850
GlobalTracer [baseline] (294.952 ms) : 0, 294952
GlobalTracer [candidate] (295.531 ms) : 0, 295531
AppSec [baseline] (47.189 ms) : 0, 47189
AppSec [candidate] (47.43 ms) : 0, 47430
Logs Intake [baseline] (306.806 µs) : 0, 307
Logs Intake [candidate] (309.212 µs) : 0, 309
Remote Config [baseline] (593.835 µs) : 0, 594
Remote Config [candidate] (2.1 ms) : 0, 2100
Telemetry [baseline] (9.263 ms) : 0, 9263
Telemetry [candidate] (7.042 ms) : 0, 7042
IAST [baseline] (26.139 ms) : 0, 26139
IAST [candidate] (25.702 ms) : 0, 25702
section profiling
ProfilingAgent [baseline] (97.839 ms) : 0, 97839
ProfilingAgent [candidate] (95.863 ms) : 0, 95863
BytebuddyAgent [baseline] (667.87 ms) : 0, 667870
BytebuddyAgent [candidate] (663.516 ms) : 0, 663516
GlobalTracer [baseline] (388.445 ms) : 0, 388445
GlobalTracer [candidate] (386.323 ms) : 0, 386323
AppSec [baseline] (51.9 ms) : 0, 51900
AppSec [candidate] (51.408 ms) : 0, 51408
Logs Intake [baseline] (344.255 µs) : 0, 344
Logs Intake [candidate] (337.107 µs) : 0, 337
Remote Config [baseline] (693.927 µs) : 0, 694
Remote Config [candidate] (693.849 µs) : 0, 694
Telemetry [baseline] (7.43 ms) : 0, 7430
Telemetry [candidate] (7.407 ms) : 0, 7407
Profiling [baseline] (97.864 ms) : 0, 97864
Profiling [candidate] (95.888 ms) : 0, 95888
Startup time reports for insecure-bankgantt
title insecure-bank - global startup overhead: candidate=1.36.0-SNAPSHOT~86be898629, baseline=1.36.0-SNAPSHOT~24d82a55c1
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.069 s) : 0, 1068999
Total [baseline] (8.565 s) : 0, 8565448
Agent [candidate] (1.06 s) : 0, 1059594
Total [candidate] (8.549 s) : 0, 8549499
section iast
Agent [baseline] (1.173 s) : 0, 1173219
Total [baseline] (8.999 s) : 0, 8998777
Agent [candidate] (1.175 s) : 0, 1175366
Total [candidate] (8.979 s) : 0, 8978959
section iast_HARDCODED_SECRET_DISABLED
Agent [baseline] (1.178 s) : 0, 1178032
Total [baseline] (9.037 s) : 0, 9037274
Agent [candidate] (1.178 s) : 0, 1178082
Total [candidate] (8.972 s) : 0, 8972290
section iast_TELEMETRY_OFF
Agent [baseline] (1.166 s) : 0, 1165699
Total [baseline] (8.966 s) : 0, 8966100
Agent [candidate] (1.161 s) : 0, 1161149
Total [candidate] (8.998 s) : 0, 8998452
gantt
title insecure-bank - break down per module: candidate=1.36.0-SNAPSHOT~86be898629, baseline=1.36.0-SNAPSHOT~24d82a55c1
dateFormat X
axisFormat %s
section tracing
BytebuddyAgent [baseline] (670.174 ms) : 0, 670174
BytebuddyAgent [candidate] (663.942 ms) : 0, 663942
GlobalTracer [baseline] (305.349 ms) : 0, 305349
GlobalTracer [candidate] (302.56 ms) : 0, 302560
AppSec [baseline] (50.242 ms) : 0, 50242
AppSec [candidate] (50.143 ms) : 0, 50143
Logs Intake [baseline] (336.644 µs) : 0, 337
Logs Intake [candidate] (333.443 µs) : 0, 333
Remote Config [baseline] (673.273 µs) : 0, 673
Remote Config [candidate] (673.249 µs) : 0, 673
Telemetry [baseline] (7.569 ms) : 0, 7569
Telemetry [candidate] (7.545 ms) : 0, 7545
section iast
BytebuddyAgent [baseline] (783.836 ms) : 0, 783836
BytebuddyAgent [candidate] (784.156 ms) : 0, 784156
GlobalTracer [baseline] (293.218 ms) : 0, 293218
GlobalTracer [candidate] (294.885 ms) : 0, 294885
AppSec [baseline] (46.841 ms) : 0, 46841
AppSec [candidate] (47.624 ms) : 0, 47624
IAST [baseline] (26.508 ms) : 0, 26508
IAST [candidate] (26.708 ms) : 0, 26708
Logs Intake [baseline] (300.627 µs) : 0, 301
Logs Intake [candidate] (1.045 ms) : 0, 1045
Remote Config [baseline] (1.364 ms) : 0, 1364
Remote Config [candidate] (657.69 µs) : 0, 658
Telemetry [baseline] (7.754 ms) : 0, 7754
Telemetry [candidate] (6.891 ms) : 0, 6891
section iast_HARDCODED_SECRET_DISABLED
BytebuddyAgent [baseline] (785.492 ms) : 0, 785492
BytebuddyAgent [candidate] (784.94 ms) : 0, 784940
GlobalTracer [baseline] (295.508 ms) : 0, 295508
GlobalTracer [candidate] (295.704 ms) : 0, 295704
AppSec [baseline] (47.229 ms) : 0, 47229
AppSec [candidate] (47.881 ms) : 0, 47881
IAST [baseline] (27.581 ms) : 0, 27581
IAST [candidate] (26.678 ms) : 0, 26678
Logs Intake [baseline] (311.593 µs) : 0, 312
Logs Intake [candidate] (305.576 µs) : 0, 306
Remote Config [baseline] (585.049 µs) : 0, 585
Remote Config [candidate] (605.778 µs) : 0, 606
Telemetry [baseline] (7.856 ms) : 0, 7856
Telemetry [candidate] (8.489 ms) : 0, 8489
section iast_TELEMETRY_OFF
BytebuddyAgent [baseline] (777.177 ms) : 0, 777177
BytebuddyAgent [candidate] (773.791 ms) : 0, 773791
GlobalTracer [baseline] (293.634 ms) : 0, 293634
GlobalTracer [candidate] (292.708 ms) : 0, 292708
AppSec [baseline] (49.033 ms) : 0, 49033
AppSec [candidate] (49.227 ms) : 0, 49227
IAST [baseline] (23.957 ms) : 0, 23957
IAST [candidate] (23.55 ms) : 0, 23550
Logs Intake [baseline] (300.873 µs) : 0, 301
Logs Intake [candidate] (297.337 µs) : 0, 297
Remote Config [baseline] (582.533 µs) : 0, 583
Remote Config [candidate] (583.812 µs) : 0, 584
Telemetry [baseline] (7.688 ms) : 0, 7688
Telemetry [candidate] (7.638 ms) : 0, 7638
LoadParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 11 metrics, 17 unstable metrics. Request duration reports for insecure-bankgantt
title insecure-bank - request duration [CI 0.99] : candidate=1.36.0-SNAPSHOT~86be898629, baseline=1.36.0-SNAPSHOT~24d82a55c1
dateFormat X
axisFormat %s
section baseline
no_agent (368.531 µs) : 348, 389
. : milestone, 369,
iast (484.343 µs) : 463, 506
. : milestone, 484,
iast_FULL (561.283 µs) : 540, 582
. : milestone, 561,
iast_GLOBAL (515.424 µs) : 493, 538
. : milestone, 515,
iast_HARDCODED_SECRET_DISABLED (482.794 µs) : 461, 504
. : milestone, 483,
iast_INACTIVE (456.548 µs) : 435, 478
. : milestone, 457,
iast_TELEMETRY_OFF (477.931 µs) : 456, 500
. : milestone, 478,
tracing (448.484 µs) : 427, 470
. : milestone, 448,
section candidate
no_agent (373.965 µs) : 354, 394
. : milestone, 374,
iast (485.055 µs) : 463, 507
. : milestone, 485,
iast_FULL (557.057 µs) : 536, 578
. : milestone, 557,
iast_GLOBAL (507.064 µs) : 486, 528
. : milestone, 507,
iast_HARDCODED_SECRET_DISABLED (484.332 µs) : 464, 505
. : milestone, 484,
iast_INACTIVE (453.661 µs) : 432, 475
. : milestone, 454,
iast_TELEMETRY_OFF (470.506 µs) : 450, 491
. : milestone, 471,
tracing (443.485 µs) : 422, 465
. : milestone, 443,
Request duration reports for petclinicgantt
title petclinic - request duration [CI 0.99] : candidate=1.36.0-SNAPSHOT~86be898629, baseline=1.36.0-SNAPSHOT~24d82a55c1
dateFormat X
axisFormat %s
section baseline
no_agent (1.338 ms) : 1319, 1357
. : milestone, 1338,
appsec (1.722 ms) : 1697, 1747
. : milestone, 1722,
appsec_no_iast (1.726 ms) : 1702, 1750
. : milestone, 1726,
iast (1.479 ms) : 1457, 1502
. : milestone, 1479,
profiling (1.477 ms) : 1452, 1502
. : milestone, 1477,
tracing (1.449 ms) : 1425, 1474
. : milestone, 1449,
section candidate
no_agent (1.326 ms) : 1306, 1346
. : milestone, 1326,
appsec (1.707 ms) : 1682, 1732
. : milestone, 1707,
appsec_no_iast (1.715 ms) : 1690, 1740
. : milestone, 1715,
iast (1.475 ms) : 1452, 1497
. : milestone, 1475,
profiling (1.487 ms) : 1462, 1511
. : milestone, 1487,
tracing (1.464 ms) : 1440, 1488
. : milestone, 1464,
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.36.0-SNAPSHOT~86be898629, baseline=1.36.0-SNAPSHOT~24d82a55c1
dateFormat X
axisFormat %s
section baseline
no_agent (15.034 s) : 15034000, 15034000
. : milestone, 15034000,
appsec (14.71 s) : 14710000, 14710000
. : milestone, 14710000,
iast (18.985 s) : 18985000, 18985000
. : milestone, 18985000,
iast_GLOBAL (18.048 s) : 18048000, 18048000
. : milestone, 18048000,
profiling (15.158 s) : 15158000, 15158000
. : milestone, 15158000,
tracing (15.034 s) : 15034000, 15034000
. : milestone, 15034000,
section candidate
no_agent (14.983 s) : 14983000, 14983000
. : milestone, 14983000,
appsec (14.996 s) : 14996000, 14996000
. : milestone, 14996000,
iast (18.853 s) : 18853000, 18853000
. : milestone, 18853000,
iast_GLOBAL (17.827 s) : 17827000, 17827000
. : milestone, 17827000,
profiling (15.116 s) : 15116000, 15116000
. : milestone, 15116000,
tracing (15.19 s) : 15190000, 15190000
. : milestone, 15190000,
Execution time for tomcatgantt
title tomcat - execution time [CI 0.99] : candidate=1.36.0-SNAPSHOT~86be898629, baseline=1.36.0-SNAPSHOT~24d82a55c1
dateFormat X
axisFormat %s
section baseline
no_agent (1.463 ms) : 1451, 1474
. : milestone, 1463,
appsec (2.23 ms) : 2195, 2264
. : milestone, 2230,
iast (1.982 ms) : 1940, 2024
. : milestone, 1982,
iast_GLOBAL (2.007 ms) : 1966, 2048
. : milestone, 2007,
profiling (1.857 ms) : 1823, 1890
. : milestone, 1857,
tracing (1.846 ms) : 1813, 1878
. : milestone, 1846,
section candidate
no_agent (1.466 ms) : 1454, 1477
. : milestone, 1466,
appsec (2.217 ms) : 2183, 2251
. : milestone, 2217,
iast (1.976 ms) : 1934, 2018
. : milestone, 1976,
iast_GLOBAL (2.03 ms) : 1988, 2072
. : milestone, 2030,
profiling (1.86 ms) : 1827, 1894
. : milestone, 1860,
tracing (1.836 ms) : 1803, 1869
. : milestone, 1836,
|
dd-java-agent/appsec/src/main/java/com/datadog/appsec/gateway/AppSecRequestContext.java
Outdated
Show resolved
Hide resolved
|
||
import datadog.trace.test.util.DDSpecification | ||
|
||
class ObjectFlattenerSpecification extends DDSpecification { |
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.
An object with a cycle in its graph can be a good test cases for the specification, e.g.
class VisitableClass {
String name
VisitableClass cycle
}
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 sorry, didn't get that. Processing circular (closed) loop, will lead to reaching stack limit. I'm talking about cases, when cycle
is pointing to the VisitableClass
object itselt.
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.
Yes, that's what I meant. The flattener should not break if given an object with a circular closed loop (perhaps it's not a problem any way)
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.
Added extra check to avoid errors in case of circular references
StackWalkerFactory.INSTANCE.walk( | ||
stream -> | ||
stream | ||
.filter(elem -> !elem.getClassName().startsWith("com.datadog")) |
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.
Should we include datadog.trace
too?
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've checked and seems datadog.trace
used only in tests and smoke tests. I'm not sure if it make sense to include this packages in exclusion filter. 🤔
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.
All the internal-api
module uses datadog.trace
, maybe I'm missing something here 😓
1100efd
to
86be898
Compare
86be898
to
4022538
Compare
What Does This Do
Implemented reporting RASP events and Stack traces.
generate_stack
action typerule_match
structure to report detected exploits (added support forresources
,params
anddb_types
)ObjectFlattener
for accurate serialisation of reported dataMotivation
This is part of Exploit prevention initiative (RASP)
Additional Notes
Jira ticket: APPSEC-46818