-
Notifications
You must be signed in to change notification settings - Fork 375
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Java reachability: Analyze uber .jar files (#1494)
Followup to #1480 This adds support for analyzing uber .jar files by: - Unpacking the .jar - Finding the main class from META-INF/MANIFEST.MF - Building a map of class -> Maven jar by extracting the list of Maven dependencies from META-INF/maven/**/pom.properties files (using OSV-Scalibr), downloading the .jar files and unpacking them to discover .class files. - Enumerating class reachability from the main class. - Determining the list of reachable Maven dependencies by using the class -> Maven jar map we built. Usage: ``` go run ./cmd/reachable -verbose /path/to/file.jar ... 2025/01/14 13:50:52 INFO Reachable dep=io.swagger.parser.v3:swagger-parser-v3 2025/01/14 13:50:52 INFO Reachable dep=com.dorkbox:Desktop 2025/01/14 13:50:52 INFO Reachable dep=ch.qos.logback:logback-core 2025/01/14 13:50:52 INFO Reachable dep=commons-io:commons-io 2025/01/14 13:50:52 INFO Not reachable dep=com.dorkbox:NetworkUtils 2025/01/14 13:50:52 INFO Not reachable dep=io.swagger.parser.v3:swagger-parser 2025/01/14 13:50:52 INFO Not reachable dep=io.swagger.parser.v3:swagger-parser-v2-converter 2025/01/14 13:50:52 INFO Not reachable dep=com.reprezen.kaizen:openapi-parser ... ```
- Loading branch information
1 parent
2e9d96a
commit 0809439
Showing
4 changed files
with
383 additions
and
55 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,14 @@ | ||
module github.com/google/osv-scanner/experimental/javareach | ||
|
||
go 1.23 | ||
|
||
require ( | ||
github.com/google/osv-scalibr v0.1.5 | ||
golang.org/x/sync v0.7.0 | ||
) | ||
|
||
require ( | ||
github.com/gobwas/glob v0.2.3 // indirect | ||
github.com/package-url/packageurl-go v0.1.2 // indirect | ||
go.uber.org/multierr v1.11.0 // indirect | ||
) |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= | ||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= | ||
github.com/gobwas/glob v0.2.3 h1:A4xDbljILXROh+kObIiy5kIaPYD8e96x1tgBhUI5J+Y= | ||
github.com/gobwas/glob v0.2.3/go.mod h1:d3Ez4x06l9bZtSvzIay5+Yzi0fmZzPgnTbPcKjJAkT8= | ||
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= | ||
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= | ||
github.com/google/osv-scalibr v0.1.5 h1:72HA+yhxk/fFUotxJgXIIEpDlYfuAP0BeM4m3PbGDWE= | ||
github.com/google/osv-scalibr v0.1.5/go.mod h1:fvnB14pFjAupxDoCLUgdMg2rHu6v86BgKGQHzgTFrTg= | ||
github.com/package-url/packageurl-go v0.1.2 h1:0H2DQt6DHd/NeRlVwW4EZ4oEI6Bn40XlNPRqegcxuo4= | ||
github.com/package-url/packageurl-go v0.1.2/go.mod h1:uQd4a7Rh3ZsVg5j0lNyAfyxIeGde9yrlhjF78GzeW0c= | ||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= | ||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= | ||
github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= | ||
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= | ||
go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= | ||
go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= | ||
golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= | ||
golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= | ||
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= | ||
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= |
Oops, something went wrong.