-
Notifications
You must be signed in to change notification settings - Fork 599
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Support generating sbom for specific pnpm workspace packages #2574
Comments
Hi, @mc-alt, there are a few things to mention here, so let me start by suggesting a few options with what is available today: are you able to scan the subdirectories directly? If you wanted separate SBOMs, I'd think just scanning like I could definitely see some sort of enhancements we could implement -- namely looking outside the requested directory to attempt to find some additional That said, would you be able to provide some public repo(s) with a similar setup that we could have a look at? |
Thanks for the response I ended up creating a script that
Hacky script here: This seems to work for us Note: this would not be performant if not for the way pnpm's cache and linking approach works Unfortunately I've been pulled on to other things, but I will try and find time to prepare a public example repository for a setup like ours |
@mc-alt glad you are figured with your script! I think the interesting thing to take out of this is that there may be something missing in the syft ecosystem in terms of "scanning 1 thing and generating N many SBOMs", which is outside of the scope of syft, but may be hinting at a separate tool that wraps syft. This is similar to (but not the same as) #562 . The new use case highlight here is "what is the prescription for using syft in a mono repo setting?". This probably warrants some discussion. |
Another example of something that a user might want to perform a similar scan is a maven multi-module project, where a subdirectory contains something like a deployable web application and a user wants to include parent and sibling directories to properly resolve modules and parent poms with relative paths. This seems to boil down to separating the set of files included in the source from the target directory to catalog. Today, for example, a user running a directory scan uses: It seems there may be a path forward for this, but certainly more investigation is needed. |
What would you like to be added:
(Hi, loving the tool, thanks for all your efforts)
We have a pnpm monorepo using the workspaces functionality.
I am able to prepare an sbom at the top level, but I need to be able to limit the sbom contents to only those materials that go into a specific sub package (this would include materials for the other workspace packages that get included in this package, but not anything belonging to packages that don't get included).
Why is this needed:
I am not currently able to generate an accurate sbom for the different sub packages in my project
Additional context:
Folder structure:
I would like to be able to create separate sboms for sub-package-1 and sub-package-2
Sorry if there is already a way to do this, or some post-processing of the top level sbom I could be doing - I haven't been able to find anything
The text was updated successfully, but these errors were encountered: