-
Notifications
You must be signed in to change notification settings - Fork 94
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
fix(linux): add logic to parse the upstream package name #88
Conversation
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.
8d1c9ce
to
917d590
Compare
👋 Hi! It looks like you modified some files in the
If none of the above scenarios apply, feel free to ignore this comment 🙂 |
: package.Metadata.Source; | ||
break; | ||
case "RpmdbMetadata": | ||
name = package.Metadata.Name; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we can consistently choose either the binary package name or the source package name for all RPM based distros. Mariner publishes vulnerabilities under source package names, as does SUSE. But RHEL (also used for centos vulns) publish vulnerabilities under the binary package names.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, but we just need a more granular decision tree here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. (Though per my email, I'm not sure if component governance might have a need for both binary and source package name.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given that component-detection doesn't do vulnerability scanning itself, and supports usages other than vulnerability scanning (e.g SBOMs, ad-hoc inventory analysis) I don't think component-detection
- should discard the binary package name
- have the API for the Name field be dependent on the current CVE security behaviour of various distros
I've proposed an alternative in #126 which is to keep both binary and source package name.
Closing PR due to conflicts / overlap with #126 , and low priority, will revisit if prioritization increases. |
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 theLoadTextAsync
method, and also bundles aResources
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.