feat(appsec): extend RASP callsite coverage to File-argument constructors of FileOutputStream and FileInputStream#11113
Draft
feat(appsec): extend RASP callsite coverage to File-argument constructors of FileOutputStream and FileInputStream#11113
Conversation
…ctors Add RASP callsite coverage for File-argument constructors that were previously not instrumented: - FileOutputStream(File) and FileOutputStream(File, boolean): call FileIORaspHelper.INSTANCE.beforeFileWritten(file.getPath()) - FileInputStream(File): call FileIORaspHelper.INSTANCE.beforeFileLoaded(file.getPath()) No IAST changes — the File-based constructors delegate path resolution to the JVM, so IAST taint tracking via the String constructor already covers those code paths at a higher level. Tests added following the existing RASP test pattern.
Contributor
|
Hi! 👋 Thanks for your pull request! 🎉 To help us review it, please make sure to:
If you need help, please check our contributing guidelines. |
BenchmarksStartupParameters
See matching parameters
SummaryFound 2 performance improvements and 0 performance regressions! Performance is the same for 56 metrics, 13 unstable metrics.
Startup time reports for insecure-bankgantt
title insecure-bank - global startup overhead: candidate=1.62.0-SNAPSHOT~b1e991e371, baseline=1.62.0-SNAPSHOT~61091f0e79
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.062 s) : 0, 1061614
Total [baseline] (8.832 s) : 0, 8832280
Agent [candidate] (1.056 s) : 0, 1056419
Total [candidate] (8.852 s) : 0, 8851886
section iast
Agent [baseline] (1.226 s) : 0, 1226082
Total [baseline] (9.545 s) : 0, 9544532
Agent [candidate] (1.229 s) : 0, 1229440
Total [candidate] (9.591 s) : 0, 9590746
gantt
title insecure-bank - break down per module: candidate=1.62.0-SNAPSHOT~b1e991e371, baseline=1.62.0-SNAPSHOT~61091f0e79
dateFormat X
axisFormat %s
section tracing
crashtracking [baseline] (1.236 ms) : 0, 1236
crashtracking [candidate] (1.217 ms) : 0, 1217
BytebuddyAgent [baseline] (636.704 ms) : 0, 636704
BytebuddyAgent [candidate] (630.492 ms) : 0, 630492
AgentMeter [baseline] (29.734 ms) : 0, 29734
AgentMeter [candidate] (29.372 ms) : 0, 29372
GlobalTracer [baseline] (250.481 ms) : 0, 250481
GlobalTracer [candidate] (248.633 ms) : 0, 248633
AppSec [baseline] (32.536 ms) : 0, 32536
AppSec [candidate] (32.574 ms) : 0, 32574
Debugger [baseline] (59.277 ms) : 0, 59277
Debugger [candidate] (59.45 ms) : 0, 59450
Remote Config [baseline] (612.873 µs) : 0, 613
Remote Config [candidate] (590.017 µs) : 0, 590
Telemetry [baseline] (8.013 ms) : 0, 8013
Telemetry [candidate] (8.049 ms) : 0, 8049
Flare Poller [baseline] (6.766 ms) : 0, 6766
Flare Poller [candidate] (9.828 ms) : 0, 9828
section iast
crashtracking [baseline] (1.233 ms) : 0, 1233
crashtracking [candidate] (1.225 ms) : 0, 1225
BytebuddyAgent [baseline] (804.251 ms) : 0, 804251
BytebuddyAgent [candidate] (808.487 ms) : 0, 808487
AgentMeter [baseline] (11.497 ms) : 0, 11497
AgentMeter [candidate] (11.245 ms) : 0, 11245
GlobalTracer [baseline] (238.683 ms) : 0, 238683
GlobalTracer [candidate] (238.205 ms) : 0, 238205
IAST [baseline] (27.563 ms) : 0, 27563
IAST [candidate] (26.644 ms) : 0, 26644
AppSec [baseline] (28.744 ms) : 0, 28744
AppSec [candidate] (30.291 ms) : 0, 30291
Debugger [baseline] (61.706 ms) : 0, 61706
Debugger [candidate] (64.542 ms) : 0, 64542
Remote Config [baseline] (1.755 ms) : 0, 1755
Remote Config [candidate] (559.107 µs) : 0, 559
Telemetry [baseline] (11.106 ms) : 0, 11106
Telemetry [candidate] (7.876 ms) : 0, 7876
Flare Poller [baseline] (3.391 ms) : 0, 3391
Flare Poller [candidate] (3.412 ms) : 0, 3412
Startup time reports for petclinicgantt
title petclinic - global startup overhead: candidate=1.62.0-SNAPSHOT~b1e991e371, baseline=1.62.0-SNAPSHOT~61091f0e79
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.059 s) : 0, 1058918
Total [baseline] (11.056 s) : 0, 11055730
Agent [candidate] (1.058 s) : 0, 1058000
Total [candidate] (11.014 s) : 0, 11014292
section appsec
Agent [baseline] (1.249 s) : 0, 1249094
Total [baseline] (11.14 s) : 0, 11140313
Agent [candidate] (1.262 s) : 0, 1262078
Total [candidate] (10.918 s) : 0, 10917651
section iast
Agent [baseline] (1.225 s) : 0, 1224925
Total [baseline] (11.289 s) : 0, 11289320
Agent [candidate] (1.226 s) : 0, 1226458
Total [candidate] (11.286 s) : 0, 11286277
section profiling
Agent [baseline] (1.191 s) : 0, 1190668
Total [baseline] (11.097 s) : 0, 11097095
Agent [candidate] (1.184 s) : 0, 1184160
Total [candidate] (11.057 s) : 0, 11057046
gantt
title petclinic - break down per module: candidate=1.62.0-SNAPSHOT~b1e991e371, baseline=1.62.0-SNAPSHOT~61091f0e79
dateFormat X
axisFormat %s
section tracing
crashtracking [baseline] (1.229 ms) : 0, 1229
crashtracking [candidate] (1.22 ms) : 0, 1220
BytebuddyAgent [baseline] (633.415 ms) : 0, 633415
BytebuddyAgent [candidate] (633.103 ms) : 0, 633103
AgentMeter [baseline] (29.339 ms) : 0, 29339
AgentMeter [candidate] (29.46 ms) : 0, 29460
GlobalTracer [baseline] (248.781 ms) : 0, 248781
GlobalTracer [candidate] (249.305 ms) : 0, 249305
AppSec [baseline] (32.342 ms) : 0, 32342
AppSec [candidate] (32.49 ms) : 0, 32490
Debugger [baseline] (59.968 ms) : 0, 59968
Debugger [candidate] (60.237 ms) : 0, 60237
Remote Config [baseline] (609.045 µs) : 0, 609
Remote Config [candidate] (601.547 µs) : 0, 602
Telemetry [baseline] (8.037 ms) : 0, 8037
Telemetry [candidate] (8.045 ms) : 0, 8045
Flare Poller [baseline] (9.014 ms) : 0, 9014
Flare Poller [candidate] (7.438 ms) : 0, 7438
section appsec
crashtracking [baseline] (1.214 ms) : 0, 1214
crashtracking [candidate] (1.218 ms) : 0, 1218
BytebuddyAgent [baseline] (661.918 ms) : 0, 661918
BytebuddyAgent [candidate] (676.53 ms) : 0, 676530
AgentMeter [baseline] (12.024 ms) : 0, 12024
AgentMeter [candidate] (11.968 ms) : 0, 11968
GlobalTracer [baseline] (249.688 ms) : 0, 249688
GlobalTracer [candidate] (248.365 ms) : 0, 248365
AppSec [baseline] (185.249 ms) : 0, 185249
AppSec [candidate] (185.253 ms) : 0, 185253
Debugger [baseline] (65.721 ms) : 0, 65721
Debugger [candidate] (66.336 ms) : 0, 66336
Remote Config [baseline] (606.848 µs) : 0, 607
Remote Config [candidate] (571.806 µs) : 0, 572
Telemetry [baseline] (8.458 ms) : 0, 8458
Telemetry [candidate] (7.899 ms) : 0, 7899
Flare Poller [baseline] (3.491 ms) : 0, 3491
Flare Poller [candidate] (3.45 ms) : 0, 3450
IAST [baseline] (24.554 ms) : 0, 24554
IAST [candidate] (24.128 ms) : 0, 24128
section iast
crashtracking [baseline] (1.226 ms) : 0, 1226
crashtracking [candidate] (1.215 ms) : 0, 1215
BytebuddyAgent [baseline] (801.7 ms) : 0, 801700
BytebuddyAgent [candidate] (805.903 ms) : 0, 805903
AgentMeter [baseline] (11.368 ms) : 0, 11368
AgentMeter [candidate] (11.206 ms) : 0, 11206
GlobalTracer [baseline] (239.298 ms) : 0, 239298
GlobalTracer [candidate] (238.171 ms) : 0, 238171
AppSec [baseline] (31.217 ms) : 0, 31217
AppSec [candidate] (26.517 ms) : 0, 26517
Debugger [baseline] (63.089 ms) : 0, 63089
Debugger [candidate] (65.253 ms) : 0, 65253
Remote Config [baseline] (1.734 ms) : 0, 1734
Remote Config [candidate] (534.416 µs) : 0, 534
Telemetry [baseline] (10.079 ms) : 0, 10079
Telemetry [candidate] (7.843 ms) : 0, 7843
Flare Poller [baseline] (3.464 ms) : 0, 3464
Flare Poller [candidate] (3.383 ms) : 0, 3383
IAST [baseline] (25.714 ms) : 0, 25714
IAST [candidate] (27.351 ms) : 0, 27351
section profiling
ProfilingAgent [baseline] (94.793 ms) : 0, 94793
ProfilingAgent [candidate] (94.682 ms) : 0, 94682
crashtracking [baseline] (1.179 ms) : 0, 1179
crashtracking [candidate] (1.177 ms) : 0, 1177
BytebuddyAgent [baseline] (694.327 ms) : 0, 694327
BytebuddyAgent [candidate] (689.926 ms) : 0, 689926
AgentMeter [baseline] (9.158 ms) : 0, 9158
AgentMeter [candidate] (9.068 ms) : 0, 9068
GlobalTracer [baseline] (208.324 ms) : 0, 208324
GlobalTracer [candidate] (207.198 ms) : 0, 207198
AppSec [baseline] (32.909 ms) : 0, 32909
AppSec [candidate] (32.861 ms) : 0, 32861
Debugger [baseline] (66.363 ms) : 0, 66363
Debugger [candidate] (65.813 ms) : 0, 65813
Remote Config [baseline] (589.602 µs) : 0, 590
Remote Config [candidate] (576.735 µs) : 0, 577
Telemetry [baseline] (7.847 ms) : 0, 7847
Telemetry [candidate] (7.832 ms) : 0, 7832
Flare Poller [baseline] (3.581 ms) : 0, 3581
Flare Poller [candidate] (3.562 ms) : 0, 3562
Profiling [baseline] (95.366 ms) : 0, 95366
Profiling [candidate] (95.259 ms) : 0, 95259
LoadParameters
See matching parameters
SummaryFound 2 performance improvements and 1 performance regressions! Performance is the same for 15 metrics, 18 unstable metrics.
Request duration reports for petclinicgantt
title petclinic - request duration [CI 0.99] : candidate=1.62.0-SNAPSHOT~b1e991e371, baseline=1.62.0-SNAPSHOT~61091f0e79
dateFormat X
axisFormat %s
section baseline
no_agent (17.516 ms) : 17339, 17693
. : milestone, 17516,
appsec (18.806 ms) : 18618, 18994
. : milestone, 18806,
code_origins (17.851 ms) : 17676, 18026
. : milestone, 17851,
iast (19.073 ms) : 18885, 19261
. : milestone, 19073,
profiling (18.515 ms) : 18331, 18698
. : milestone, 18515,
tracing (17.964 ms) : 17792, 18137
. : milestone, 17964,
section candidate
no_agent (17.948 ms) : 17767, 18128
. : milestone, 17948,
appsec (18.666 ms) : 18479, 18853
. : milestone, 18666,
code_origins (18.081 ms) : 17902, 18260
. : milestone, 18081,
iast (17.82 ms) : 17645, 17994
. : milestone, 17820,
profiling (19.464 ms) : 19265, 19663
. : milestone, 19464,
tracing (18.152 ms) : 17971, 18333
. : milestone, 18152,
Request duration reports for insecure-bankgantt
title insecure-bank - request duration [CI 0.99] : candidate=1.62.0-SNAPSHOT~b1e991e371, baseline=1.62.0-SNAPSHOT~61091f0e79
dateFormat X
axisFormat %s
section baseline
no_agent (1.257 ms) : 1245, 1269
. : milestone, 1257,
iast (3.305 ms) : 3258, 3352
. : milestone, 3305,
iast_FULL (5.892 ms) : 5832, 5952
. : milestone, 5892,
iast_GLOBAL (3.68 ms) : 3615, 3745
. : milestone, 3680,
profiling (2.082 ms) : 2062, 2103
. : milestone, 2082,
tracing (1.835 ms) : 1820, 1850
. : milestone, 1835,
section candidate
no_agent (1.279 ms) : 1266, 1292
. : milestone, 1279,
iast (3.235 ms) : 3186, 3284
. : milestone, 3235,
iast_FULL (5.827 ms) : 5769, 5885
. : milestone, 5827,
iast_GLOBAL (3.652 ms) : 3588, 3715
. : milestone, 3652,
profiling (2.073 ms) : 2054, 2093
. : milestone, 2073,
tracing (1.875 ms) : 1860, 1891
. : milestone, 1875,
DacapoParameters
See matching parameters
SummaryFound 1 performance improvements and 0 performance regressions! Performance is the same for 10 metrics, 1 unstable metrics.
Execution time for tomcatgantt
title tomcat - execution time [CI 0.99] : candidate=1.62.0-SNAPSHOT~b1e991e371, baseline=1.62.0-SNAPSHOT~61091f0e79
dateFormat X
axisFormat %s
section baseline
no_agent (1.492 ms) : 1480, 1503
. : milestone, 1492,
appsec (3.861 ms) : 3637, 4084
. : milestone, 3861,
iast (2.288 ms) : 2218, 2358
. : milestone, 2288,
iast_GLOBAL (2.326 ms) : 2256, 2396
. : milestone, 2326,
profiling (2.109 ms) : 2053, 2165
. : milestone, 2109,
tracing (2.09 ms) : 2036, 2144
. : milestone, 2090,
section candidate
no_agent (1.495 ms) : 1484, 1507
. : milestone, 1495,
appsec (2.56 ms) : 2504, 2615
. : milestone, 2560,
iast (2.296 ms) : 2225, 2366
. : milestone, 2296,
iast_GLOBAL (2.332 ms) : 2261, 2402
. : milestone, 2332,
profiling (2.537 ms) : 2370, 2703
. : milestone, 2537,
tracing (2.083 ms) : 2029, 2138
. : milestone, 2083,
Execution time for biojavagantt
title biojava - execution time [CI 0.99] : candidate=1.62.0-SNAPSHOT~b1e991e371, baseline=1.62.0-SNAPSHOT~61091f0e79
dateFormat X
axisFormat %s
section baseline
no_agent (14.895 s) : 14895000, 14895000
. : milestone, 14895000,
appsec (14.775 s) : 14775000, 14775000
. : milestone, 14775000,
iast (18.492 s) : 18492000, 18492000
. : milestone, 18492000,
iast_GLOBAL (18.115 s) : 18115000, 18115000
. : milestone, 18115000,
profiling (14.761 s) : 14761000, 14761000
. : milestone, 14761000,
tracing (15.275 s) : 15275000, 15275000
. : milestone, 15275000,
section candidate
no_agent (15.461 s) : 15461000, 15461000
. : milestone, 15461000,
appsec (14.81 s) : 14810000, 14810000
. : milestone, 14810000,
iast (18.624 s) : 18624000, 18624000
. : milestone, 18624000,
iast_GLOBAL (17.955 s) : 17955000, 17955000
. : milestone, 17955000,
profiling (14.881 s) : 14881000, 14881000
. : milestone, 14881000,
tracing (14.674 s) : 14674000, 14674000
. : milestone, 14674000,
|
…, RandomAccessFile, Files.* and FileChannel Extends RASP callsite instrumentation (APPSEC-61874) beyond FileInputStream/FileOutputStream to all remaining Java file I/O APIs that were not covered. No IAST changes. New callsites: - FileReaderCallSite: FileReader(String/File) + Java 11+ Charset variants → beforeFileLoaded - FileWriterCallSite: FileWriter(String/File/boolean) + Java 11+ Charset variants → beforeFileWritten - RandomAccessFileCallSite: RandomAccessFile(String/File, mode) → beforeFileLoaded for "r", both beforeFileLoaded + beforeFileWritten for "rw"/"rws"/"rwd" - FilesCallSite: all Files.* read and write methods (newOutputStream, copy(IS,Path), write, writeString, newBufferedWriter, move, newInputStream, readAllBytes, readAllLines, readString, newBufferedReader, lines) - FileChannelCallSite: FileChannel.open(Path, ...) → fires both read and write callbacks Extended callsites: - PathCallSite: add resolve(Path) and resolveSibling(Path) → beforeFileLoaded - PathsCallSite: add Path.of(String[], URI) (Java 11+) → beforeFileLoaded FileIORaspHelper: add beforeRandomAccessFileOpened(path, mode) helper Relates to #11084 and #11113
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What Does This Do
Extends the RASP callsite coverage introduced in #11084 to include constructors that take a
java.io.Fileargument, which were previously not instrumented:FileOutputStream(File)andFileOutputStream(File, boolean)— now publishserver.io.fs.file_writeviaFileIORaspHelper.INSTANCE.beforeFileWritten(file.getPath())FileInputStream(File)— now publishesserver.io.fs.fileviaFileIORaspHelper.INSTANCE.beforeFileLoaded(file.getPath())No IAST changes — the
File-based constructors delegate path resolution to the JVM, so IAST taint tracking via theStringconstructors already covers those code paths at a higher level.Coverage gap closed
FileOutputStream(String)FileOutputStream(String, boolean)FileOutputStream(File)FileOutputStream(File, boolean)FileInputStream(String)FileInputStream(File)Contributor Checklist
type:and (comp:orinst:) labels in addition to any other useful labelsclose,fix, or any linking keywords when referencing an issueUse
solvesinstead, and assign the PR milestone to the issueJira Ticket: APPSEC-61874