-
Notifications
You must be signed in to change notification settings - Fork 593
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add '--version' param for Syft (for when project version is unclear) #1399
Comments
@bardenstein -- there is already a |
@jedevc -- is this something that would be useful for your usage? (and if we did modify |
@kzantow it's less about printing the version of syft, but about adding 'version' data to an SBOM, given that the syft generator doesn't have any context about the version of a software project when its run. Here's the full story:
What we'd love to see is some param so I could run something like: |
Yes, @bardenstein I understand the ask here -- the point is that there already is a |
@kzantow Got it. For SBOM consistency and matching the spec, having the target version number in its own "version" field (as supposed to being lumped in with name) would be ideal. Is that something the syft team is willing to add on or build out? Understand not wanting to conflict the nomenclature of the existing --version command. More broadly, it could be helpful to have an 'add' command, that allows a user to add in field:value pairs within the SBOM to incorporate other relevant context. |
Agreed, I think it would be good if version info could be "somewhere in the sbom". Though actually, I think (in the context of buildkit-syft-scanner) we probably won't aim for the idea of a "globally unique name", more one that is locally unique within the context of the image (e.g. the image stage name, or the name of the local context). This is for the same reason that we have to do moby/buildkit#3258 with layers in buildkit - we don't know the name of the image (or even if there is an image name) until the very end of the export, so we'll likely place logic for naming explicitly in there (though we'll try and set
Hm, so this is challenging. I like the succinctness, but this means that because this value is parsed explicitly, we have to avoid |
We just discussed this as a team and we think that this would be a useful feature to add but we would need a better option than "--version" since that is usually used to report to the version of the tool itself. Something like "--pkg-version" or "--name-version" might work. |
@jedevc, what if we parsed out the last @ in the --name parameter? That would allow you to have an @ in the package name and also include a version. Happy to hear your thoughts. |
@tgerla yup that seems good to me 🎉 |
Quick implementation note:
|
i'd actually like an extension of this - a metadata name,value facility, so we could pass in for example:
or perhaps with a delimiter:
imho we should be able to pass in any of the top-level tags in cases where syft is not identifying them correctly. maybe even have a csv file or somesuch as input? |
Hi @sej7278 -- I've implemented this feature request with the |
What would you like to be added:
Like the --name param, add an optional --version param so denote the version of a project (e.g. 1.0, 1.0.1, etc.)
Why is this needed:
If we run syft on a python project, for example, we can manually hardcode the name of the project, but the resulting SBOM doesn't have any metadata on the version. So if we update the project and create an updated SBOM, we can't easily tell which SBOM relates to which version.
Additional context:
The text was updated successfully, but these errors were encountered: