anchore / syft

CLI tool and library for generating a Software Bill of Materials from container images and filesystems
Apache License 2.0
5.73k stars 526 forks source link

feat: report unknowns in sbom #2998

Open kzantow opened 3 days ago

kzantow commented 3 days ago

This PR adds information to the file model which allows surfacing "unknowns". Previously, when scanning a source, Syft runs a number of catalogers which create packages from the files found. If an error happens, packages simply would not be created, and some logging about the error would occur. With this change, many of these errors are returned and added as context to the files output in the SBOM. Examples of "unknowns" included by this PR:

This PR has a set of post-cataloging steps that perform the following:

NOTE: if you would like to experiment with this, you can select the locations and unknowns from the Syft JSON like this:

go run ./cmd/syft maven:latest -o json | jq '.files.[]|select(.unknowns)|{location,unknowns}'

TODO:

Fixes: #518