eclipse / steady

Analyses your Java applications for open-source dependencies with known vulnerabilities, using both static analysis and testing to determine code context and usage for greater accuracy. https://eclipse.github.io/steady/
Apache License 2.0
517 stars 123 forks source link

Added SpringBootAnalyzer #531

Closed henrikplate closed 2 years ago

henrikplate commented 2 years ago

Added SpringBootAnalyzer to inspect and instrument Spring Boot applications packaged as executable, self-contained JARs (with folders BOOT-INF/lib and BOOT-INF/classes). For example, a given executable target/foo.jar will be rewritten to target/vulas/target/foo-steady-instr.jar.

In this context, the following other improvements were implemented:

TODOs

henrikplate commented 2 years ago

@serenaponta I updated the JavaDoc of SpringBootAnalyzer, please merge if you're fine with the changes.

henrikplate commented 2 years ago

@serenaponta please wait a little more before merging, I might have found another problem in the meantime

henrikplate commented 2 years ago

Found it: If the appContext config settings were not provided as env. variables or system properties, i.e. when calling the instr goal on a project having the profile, they were not visible to AbstractInstrumentor and its sub classes, which called new VulasConfiguration(). Some of those sub classes, however, depend on having the application context, e.g. to read the change list of vulnerabilities.

Fixed by calling VulasConfiguration.getGlobal(), to which the profile/plugin configuration settings are added in AbstractVulasMojo.