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

Preserve Linux source package name #126

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

tofay
Copy link
Contributor

@tofay tofay commented Jun 13, 2022

I've updated the LinuxComponent to include the source package name where possible.

Why?
Many Linux distributions (debian/alpine/mariner) publish CVE data against source package names only, so this is required for users to CVE check against the output of component-detection.

Note: Syft doesn't always provide the source package name (it doesn't appear to provide this for ubuntu packages when the source and binary package names are the same).

This builds on #88, but adds a new field to LinuxComponent instead of of making the Name of LinuxComponent be the source package name iff the distro publishes CVEs against source package name.

JamieMagee and others added 2 commits June 11, 2022 07:16
The package name does not always line up 100% with the upstream or source name. For example some Linux distributions suffix the major version to differentiate i.e. python2 and python3. These should both be mapped back to python.

This PR also adds `ResourceUtilities` with the `LoadTextAsync` method, and also bundles a `Resources` directory in test projects. This should make it easier to load mocks from files for tests. Instead of having to embed them in the C# source.
To allow clients to match against binary package name
or source package name, as some distributions publish
publish vulnerabilities against source package name.

Signed-off-by: Tom Fay <tomfay@microsoft.com>
@tofay tofay requested a review from a team as a code owner June 13, 2022 10:41
@tofay tofay requested a review from jcfiorenzano June 13, 2022 10:41
@cobya cobya added type:feature Feature (new functionality) detector:linux The Linux detector labels Jun 27, 2022
@cobya cobya requested a review from JamieMagee July 5, 2022 21:18
@cobya
Copy link
Contributor

cobya commented Jul 5, 2022

@JamieMagee you probably have the most context to review this

@tofay
Copy link
Contributor Author

tofay commented Nov 30, 2022

@JamieMagee before I rebase this, is this a change that you'd accept?

My team is currently working around this by discovering source packages where binary name != source name and registering them ourselves, but ideally we wouldn't have to.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
detector:linux The Linux detector type:feature Feature (new functionality)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants