fossas / fossa-cli

Fast, portable and reliable dependency analysis for any codebase. Supports license & vulnerability scanning for large monoliths. Language-agnostic; integrates with 20+ build systems.
https://fossa.com
Other
1.29k stars 173 forks source link

Ane 1711 millhone jar cli program [1/3] #1442

Closed csasarak closed 4 months ago

csasarak commented 5 months ago

Overview

This PR adds functionality to millhone for analyzing a container tar file for Jars and reporting fingerprints. It is a lightly adapted version of code we already had in another project. It isn't really set up yet to fingerprint arbitrary jars but should be adaptable for that purpose quite easily.

I am going to stack a couple PRs. This one is just the Rust side of things. For a review, I'm mainly looking for a sanity check on what I have so far.

Acceptance criteria

Testing plan

My testing has been manual so far. I've tested with the following images: cassandra, jetty, gradle, and quay.io/keycloak/keycloak:25.0.1.

To test with an image from the root cli directory:

docker pull quay.io/keycloak/keycloak:25.0.1
docker save quay.io/keycloak/keycloak:25.0.1 > keycloak.tar
cargo run --bin millhone -- --log-to stderr analyze-jars keycloak.tar | jless

Note that this will take a bit of time as written. Building with --release significantly improves performance for this operation so that shouldn't be concern.

For now, I haven't added an automated test because I want to try to get everything working manually end-to-end with the CLI.

Risks

None. This is new functionality and doesn't touch any existing Millhone work.

Metrics

References

ANE-1711

Checklist