Skip to content
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

CycloneDX metadata's target component is "." instead of the component name #1238

Closed
bardenstein opened this issue Oct 3, 2022 · 10 comments
Closed
Labels
changelog-ignore Don't include this issue in the release changelog

Comments

@bardenstein
Copy link

What happened:
Instead of naming the component and version, the generator puts the local file path (e.g. instead of being my-app, it’s a '.' , or could even be users/myname/code/my-app.

What you expected to happen:
The generator should automatically and accurately fill out the name of the component and version of the code being described, not just by the (relative) path.

How to reproduce it (as minimally and precisely as possible):
Run the Syft generator on a repo to generate a CDX SBOM

Anything else we need to know?:
Here's the CDX spec: https://cyclonedx.org/docs/1.4/json/#metadata_component

Environment:

  • Output of syft version:
  • OS (e.g: cat /etc/os-release or similar):
@bardenstein bardenstein added the bug Something isn't working label Oct 3, 2022
@kzantow
Copy link
Contributor

kzantow commented Oct 3, 2022

Hi @bardenstein -- do you happen to have a specific repo to use to reproduce this issue?

@bardenstein
Copy link
Author

https://github.com/alexthemark/example-unmet-peer-dep

Generates:
"metadata": {
"timestamp": "2022-10-03T12:27:41-04:00",
"tools": [
{
"vendor": "anchore",
"name": "syft",
"version": "0.58.0"
}
],
"component": {
"bom-ref": "af63bd4c8601b7f1",
"type": "file",
"name": "."
}
},

where I would expect it to name the component example-amplify-app@1.0.0 per the package.json

@kzantow kzantow added this to OSS Oct 3, 2022
@kzantow kzantow moved this to Parking Lot (Comments or Progress) in OSS Oct 3, 2022
@kzantow
Copy link
Contributor

kzantow commented Oct 3, 2022

Thank you @bardenstein -- we'll add this to the backlog, agree it seems like something to fix 👍

@bardenstein
Copy link
Author

Thanks @kzantow. We're all for building SBOMs that are complete and to spec! :)

@ArgTang
Copy link

ArgTang commented Oct 5, 2022

@kzantow could a cmd flag to manually overwrite the name be added? if the project is structured so the auto resolver is not correct, it would be nice to manually set it

note: name is "." with spdx as well.

@bardenstein
Copy link
Author

Manual overwrite wouldn't work for some of our solutions, where we have Github Actions that reference/add Syft to specific repos. We'd want something automatic.

@ArgTang
Copy link

ArgTang commented Oct 6, 2022

@bardenstein i agree that auto discovery will be best. but i dont see how a --name <appname> would not work in a CI job if for some reason autoresolve dont work for a specific project?

@kzantow
Copy link
Contributor

kzantow commented Oct 6, 2022

Unfortunately, I don't think just having a name (or even a name and version) would be sufficient, there's a lot more information we need to generate a viable SBOM and especially to then scan it with Grype.

@tgerla tgerla removed the status in OSS Aug 31, 2023
@tgerla tgerla added changelog-ignore Don't include this issue in the release changelog and removed bug Something isn't working labels Aug 31, 2023
@tgerla
Copy link
Contributor

tgerla commented Aug 31, 2023

We now have the --source-name and --source-version options that should allow you to hint to Syft the actual name and version for the target component for these situations. We'll close this issue but please re-open or open another one if this doesn't work out for you.

@tgerla tgerla closed this as completed Aug 31, 2023
@github-project-automation github-project-automation bot moved this to Done in OSS Aug 31, 2023
@wagoodman
Copy link
Contributor

I've opened up #2084 to more generically capture what I think the ask is here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog-ignore Don't include this issue in the release changelog
Projects
Archived in project
Development

No branches or pull requests

5 participants