-
Notifications
You must be signed in to change notification settings - Fork 291
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
Add IAST taint tracking for DB values #8072
base: master
Are you sure you want to change the base?
Conversation
internal-api/src/main/java/datadog/trace/api/iast/TaintableDb.java
Outdated
Show resolved
Hide resolved
BenchmarksStartupParameters
See matching parameters
SummaryFound 0 performance improvements and 5 performance regressions! Performance is the same for 53 metrics, 5 unstable metrics.
Startup time reports for petclinicgantt
title petclinic - global startup overhead: candidate=1.45.0-SNAPSHOT~75b3a8b07f, baseline=1.45.0-SNAPSHOT~46b5986f6a
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.059 s) : 0, 1058575
Total [baseline] (10.39 s) : 0, 10389510
Agent [candidate] (1.053 s) : 0, 1053106
Total [candidate] (10.337 s) : 0, 10336649
section appsec
Agent [baseline] (1.185 s) : 0, 1184926
Total [baseline] (10.717 s) : 0, 10717162
Agent [candidate] (1.194 s) : 0, 1194160
Total [candidate] (10.694 s) : 0, 10693824
section iast
Agent [baseline] (1.184 s) : 0, 1184411
Total [baseline] (10.977 s) : 0, 10976577
Agent [candidate] (1.194 s) : 0, 1193860
Total [candidate] (11.052 s) : 0, 11052092
section profiling
Agent [baseline] (1.271 s) : 0, 1270503
Total [baseline] (10.767 s) : 0, 10767096
Agent [candidate] (1.287 s) : 0, 1287265
Total [candidate] (10.892 s) : 0, 10892376
gantt
title petclinic - break down per module: candidate=1.45.0-SNAPSHOT~75b3a8b07f, baseline=1.45.0-SNAPSHOT~46b5986f6a
dateFormat X
axisFormat %s
section tracing
BytebuddyAgent [baseline] (715.653 ms) : 0, 715653
BytebuddyAgent [candidate] (712.82 ms) : 0, 712820
GlobalTracer [baseline] (257.368 ms) : 0, 257368
GlobalTracer [candidate] (255.489 ms) : 0, 255489
AppSec [baseline] (57.886 ms) : 0, 57886
AppSec [candidate] (57.349 ms) : 0, 57349
Remote Config [baseline] (684.451 µs) : 0, 684
Remote Config [candidate] (685.254 µs) : 0, 685
Telemetry [baseline] (11.963 ms) : 0, 11963
Telemetry [candidate] (11.807 ms) : 0, 11807
section appsec
BytebuddyAgent [baseline] (728.473 ms) : 0, 728473
BytebuddyAgent [candidate] (734.383 ms) : 0, 734383
GlobalTracer [baseline] (252.339 ms) : 0, 252339
GlobalTracer [candidate] (254.305 ms) : 0, 254305
AppSec [baseline] (170.47 ms) : 0, 170470
AppSec [candidate] (170.782 ms) : 0, 170782
Remote Config [baseline] (665.148 µs) : 0, 665
Remote Config [candidate] (657.923 µs) : 0, 658
Telemetry [baseline] (8.311 ms) : 0, 8311
Telemetry [candidate] (7.803 ms) : 0, 7803
IAST [baseline] (19.571 ms) : 0, 19571
IAST [candidate] (22.355 ms) : 0, 22355
section iast
BytebuddyAgent [baseline] (833.843 ms) : 0, 833843
BytebuddyAgent [candidate] (840.082 ms) : 0, 840082
GlobalTracer [baseline] (247.502 ms) : 0, 247502
GlobalTracer [candidate] (247.675 ms) : 0, 247675
AppSec [baseline] (57.895 ms) : 0, 57895
AppSec [candidate] (57.65 ms) : 0, 57650
Remote Config [baseline] (660.421 µs) : 0, 660
Remote Config [candidate] (655.514 µs) : 0, 656
Telemetry [baseline] (8.488 ms) : 0, 8488
Telemetry [candidate] (8.461 ms) : 0, 8461
IAST [baseline] (21.069 ms) : 0, 21069
IAST [candidate] (24.197 ms) : 0, 24197
section profiling
BytebuddyAgent [baseline] (700.745 ms) : 0, 700745
BytebuddyAgent [candidate] (710.347 ms) : 0, 710347
GlobalTracer [baseline] (370.18 ms) : 0, 370180
GlobalTracer [candidate] (374.278 ms) : 0, 374278
AppSec [baseline] (53.982 ms) : 0, 53982
AppSec [candidate] (54.429 ms) : 0, 54429
Remote Config [baseline] (645.736 µs) : 0, 646
Remote Config [candidate] (669.078 µs) : 0, 669
Telemetry [baseline] (7.784 ms) : 0, 7784
Telemetry [candidate] (7.9 ms) : 0, 7900
ProfilingAgent [baseline] (95.48 ms) : 0, 95480
ProfilingAgent [candidate] (97.486 ms) : 0, 97486
Profiling [baseline] (95.504 ms) : 0, 95504
Profiling [candidate] (97.51 ms) : 0, 97510
Startup time reports for insecure-bankgantt
title insecure-bank - global startup overhead: candidate=1.45.0-SNAPSHOT~75b3a8b07f, baseline=1.45.0-SNAPSHOT~46b5986f6a
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.054 s) : 0, 1053517
Total [baseline] (8.625 s) : 0, 8625280
Agent [candidate] (1.054 s) : 0, 1053538
Total [candidate] (8.619 s) : 0, 8618518
section iast
Agent [baseline] (1.175 s) : 0, 1175487
Total [baseline] (9.264 s) : 0, 9264180
Agent [candidate] (1.192 s) : 0, 1192463
Total [candidate] (9.215 s) : 0, 9215047
section iast_HARDCODED_SECRET_DISABLED
Agent [baseline] (1.178 s) : 0, 1178446
Total [baseline] (9.176 s) : 0, 9175536
Agent [candidate] (1.181 s) : 0, 1181377
Total [candidate] (9.165 s) : 0, 9164740
section iast_TELEMETRY_OFF
Agent [baseline] (1.172 s) : 0, 1172309
Total [baseline] (9.19 s) : 0, 9189538
Agent [candidate] (1.177 s) : 0, 1176687
Total [candidate] (9.198 s) : 0, 9198497
gantt
title insecure-bank - break down per module: candidate=1.45.0-SNAPSHOT~75b3a8b07f, baseline=1.45.0-SNAPSHOT~46b5986f6a
dateFormat X
axisFormat %s
section tracing
BytebuddyAgent [baseline] (712.088 ms) : 0, 712088
BytebuddyAgent [candidate] (713.142 ms) : 0, 713142
GlobalTracer [baseline] (255.717 ms) : 0, 255717
GlobalTracer [candidate] (255.654 ms) : 0, 255654
AppSec [baseline] (58.114 ms) : 0, 58114
AppSec [candidate] (59.404 ms) : 0, 59404
Remote Config [baseline] (684.867 µs) : 0, 685
Remote Config [candidate] (689.017 µs) : 0, 689
Telemetry [baseline] (11.989 ms) : 0, 11989
Telemetry [candidate] (9.734 ms) : 0, 9734
section iast
BytebuddyAgent [baseline] (826.83 ms) : 0, 826830
BytebuddyAgent [candidate] (837.277 ms) : 0, 837277
GlobalTracer [baseline] (246.119 ms) : 0, 246119
GlobalTracer [candidate] (248.374 ms) : 0, 248374
AppSec [baseline] (57.663 ms) : 0, 57663
AppSec [candidate] (58.288 ms) : 0, 58288
IAST [baseline] (20.932 ms) : 0, 20932
IAST [candidate] (24.203 ms) : 0, 24203
Remote Config [baseline] (663.976 µs) : 0, 664
Remote Config [candidate] (656.557 µs) : 0, 657
Telemetry [baseline] (8.445 ms) : 0, 8445
Telemetry [candidate] (8.545 ms) : 0, 8545
section iast_HARDCODED_SECRET_DISABLED
BytebuddyAgent [baseline] (828.436 ms) : 0, 828436
BytebuddyAgent [candidate] (828.815 ms) : 0, 828815
GlobalTracer [baseline] (246.734 ms) : 0, 246734
GlobalTracer [candidate] (246.36 ms) : 0, 246360
AppSec [baseline] (58.083 ms) : 0, 58083
AppSec [candidate] (57.908 ms) : 0, 57908
IAST [baseline] (21.187 ms) : 0, 21187
IAST [candidate] (24.173 ms) : 0, 24173
Remote Config [baseline] (646.005 µs) : 0, 646
Remote Config [candidate] (664.89 µs) : 0, 665
Telemetry [baseline] (8.458 ms) : 0, 8458
Telemetry [candidate] (8.484 ms) : 0, 8484
section iast_TELEMETRY_OFF
BytebuddyAgent [baseline] (824.279 ms) : 0, 824279
BytebuddyAgent [candidate] (825.503 ms) : 0, 825503
GlobalTracer [baseline] (246.046 ms) : 0, 246046
GlobalTracer [candidate] (246.099 ms) : 0, 246099
AppSec [baseline] (57.459 ms) : 0, 57459
AppSec [candidate] (57.582 ms) : 0, 57582
IAST [baseline] (20.732 ms) : 0, 20732
IAST [candidate] (23.453 ms) : 0, 23453
Remote Config [baseline] (660.5 µs) : 0, 660
Remote Config [candidate] (650.431 µs) : 0, 650
Telemetry [baseline] (8.266 ms) : 0, 8266
Telemetry [candidate] (8.4 ms) : 0, 8400
LoadParameters
See matching parameters
SummaryFound 1 performance improvements and 2 performance regressions! Performance is the same for 8 metrics, 17 unstable metrics.
Request duration reports for insecure-bankgantt
title insecure-bank - request duration [CI 0.99] : candidate=1.45.0-SNAPSHOT~75b3a8b07f, baseline=1.45.0-SNAPSHOT~46b5986f6a
dateFormat X
axisFormat %s
section baseline
no_agent (379.839 µs) : 359, 400
. : milestone, 380,
iast (491.01 µs) : 469, 513
. : milestone, 491,
iast_FULL (651.744 µs) : 630, 673
. : milestone, 652,
iast_GLOBAL (517.333 µs) : 496, 539
. : milestone, 517,
iast_HARDCODED_SECRET_DISABLED (491.982 µs) : 471, 513
. : milestone, 492,
iast_INACTIVE (446.747 µs) : 426, 468
. : milestone, 447,
iast_TELEMETRY_OFF (474.766 µs) : 453, 496
. : milestone, 475,
tracing (448.274 µs) : 427, 469
. : milestone, 448,
section candidate
no_agent (377.309 µs) : 358, 397
. : milestone, 377,
iast (496.92 µs) : 475, 518
. : milestone, 497,
iast_FULL (743.016 µs) : 721, 765
. : milestone, 743,
iast_GLOBAL (557.441 µs) : 535, 580
. : milestone, 557,
iast_HARDCODED_SECRET_DISABLED (499.532 µs) : 478, 521
. : milestone, 500,
iast_INACTIVE (458.73 µs) : 436, 481
. : milestone, 459,
iast_TELEMETRY_OFF (487.68 µs) : 466, 509
. : milestone, 488,
tracing (448.068 µs) : 427, 469
. : milestone, 448,
Request duration reports for petclinicgantt
title petclinic - request duration [CI 0.99] : candidate=1.45.0-SNAPSHOT~75b3a8b07f, baseline=1.45.0-SNAPSHOT~46b5986f6a
dateFormat X
axisFormat %s
section baseline
no_agent (1.359 ms) : 1339, 1379
. : milestone, 1359,
appsec (1.765 ms) : 1739, 1790
. : milestone, 1765,
appsec_no_iast (1.764 ms) : 1740, 1788
. : milestone, 1764,
iast (1.505 ms) : 1482, 1528
. : milestone, 1505,
profiling (1.566 ms) : 1541, 1591
. : milestone, 1566,
tracing (1.488 ms) : 1463, 1513
. : milestone, 1488,
section candidate
no_agent (1.346 ms) : 1326, 1365
. : milestone, 1346,
appsec (1.737 ms) : 1712, 1762
. : milestone, 1737,
appsec_no_iast (1.75 ms) : 1726, 1774
. : milestone, 1750,
iast (1.513 ms) : 1488, 1538
. : milestone, 1513,
profiling (1.509 ms) : 1485, 1532
. : milestone, 1509,
tracing (1.482 ms) : 1458, 1506
. : milestone, 1482,
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.45.0-SNAPSHOT~75b3a8b07f, baseline=1.45.0-SNAPSHOT~46b5986f6a
dateFormat X
axisFormat %s
section baseline
no_agent (15.296 s) : 15296000, 15296000
. : milestone, 15296000,
appsec (14.99 s) : 14990000, 14990000
. : milestone, 14990000,
iast (19.181 s) : 19181000, 19181000
. : milestone, 19181000,
iast_GLOBAL (17.984 s) : 17984000, 17984000
. : milestone, 17984000,
profiling (15.129 s) : 15129000, 15129000
. : milestone, 15129000,
tracing (14.927 s) : 14927000, 14927000
. : milestone, 14927000,
section candidate
no_agent (15.324 s) : 15324000, 15324000
. : milestone, 15324000,
appsec (15.092 s) : 15092000, 15092000
. : milestone, 15092000,
iast (18.87 s) : 18870000, 18870000
. : milestone, 18870000,
iast_GLOBAL (18.199 s) : 18199000, 18199000
. : milestone, 18199000,
profiling (15.743 s) : 15743000, 15743000
. : milestone, 15743000,
tracing (14.784 s) : 14784000, 14784000
. : milestone, 14784000,
Execution time for tomcatgantt
title tomcat - execution time [CI 0.99] : candidate=1.45.0-SNAPSHOT~75b3a8b07f, baseline=1.45.0-SNAPSHOT~46b5986f6a
dateFormat X
axisFormat %s
section baseline
no_agent (1.474 ms) : 1463, 1486
. : milestone, 1474,
appsec (2.354 ms) : 2312, 2396
. : milestone, 2354,
iast (2.105 ms) : 2052, 2158
. : milestone, 2105,
iast_GLOBAL (2.139 ms) : 2086, 2193
. : milestone, 2139,
profiling (1.983 ms) : 1939, 2027
. : milestone, 1983,
tracing (1.942 ms) : 1901, 1982
. : milestone, 1942,
section candidate
no_agent (1.478 ms) : 1467, 1490
. : milestone, 1478,
appsec (2.354 ms) : 2312, 2396
. : milestone, 2354,
iast (2.089 ms) : 2037, 2142
. : milestone, 2089,
iast_GLOBAL (2.15 ms) : 2095, 2204
. : milestone, 2150,
profiling (1.99 ms) : 1946, 2034
. : milestone, 1990,
tracing (1.932 ms) : 1892, 1972
. : milestone, 1932,
|
implements Instrumenter.ForTypeHierarchy { | ||
|
||
public IastResultSetInstrumentation() { | ||
super("jdbc", "resultset"); |
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.
super("jdbc", "resultset"); | |
super("jdbc", "jdbc-resultset", "iast-resultset"); |
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.
Just so that we have an IAST specific switch to disable at some point.
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.
Changed!
What Does This Do
This PR introduces a solution to taint database values. The goal is to detect potential security vulnerabilities, specifically SQL Injection and XSS as a first step. Key changes include:
sql.row.value
ResultSet
methods that return aString
ResultSet
will be given by this environment variable:DD_IAST_DB_ROWS_TO_TAINT
(default1
)Motivation
This will increase the number of detections for the first two types of vulnerabilities (SQL Injection and XSS). Apart from that, this will improve our propagation taint tracking.
Additional Notes
See the RFC where this change is documented: RFC
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-55328