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

Vulnerability Detector - Improve default CNA selection #25096

Open
3 tasks
sebasfalcone opened this issue Aug 7, 2024 · 0 comments
Open
3 tasks

Vulnerability Detector - Improve default CNA selection #25096

sebasfalcone opened this issue Aug 7, 2024 · 0 comments
Labels
level/task type/enhancement New feature or request

Comments

@sebasfalcone
Copy link
Member

Description

Currently, if no CNA can be determined for a given package, we default to the NVD.

As explained here:

This brings problems with packages whose information is not expressed in the feed Global map

Current behaviour

If no CNA can be determined in the selector:

auto cnaName {m_databaseFeedManager->getCnaNameByFormat(ctx->packageFormat().data())};
if (cnaName.empty())
{
cnaName = m_databaseFeedManager->getCnaNameBySource(ctx->packageSource().data());
if (cnaName.empty())
{
cnaName =
m_databaseFeedManager->getCnaNameByPrefix(ctx->packageVendor().data(), ctx->osPlatform().data());
if (cnaName.empty())
{
cnaName = m_databaseFeedManager->getCnaNameByContains(ctx->packageVendor().data(),
ctx->osPlatform().data());

The NVD is used:

if (cnaName.empty())
{
return DEFAULT_CNA;
}

Agent OS Associated Feed Default CNA
RHEL RHEL NVD
CentOS RHEL NVD
Ubuntu Canonical NVD
Linux Mint Canonical NVD
Windows NVD NVD

Proposed solution

If no CNA can be determined in the selector, use the feed associated with the agent OS instead of the NVD:

Agent OS Associated Feed Default CNA
RHEL RHEL RHEL
CentOS RHEL RHEL
Ubuntu Canonical Canonical
Linux Mint Canonical Canonical
Windows NVD NVD

DoD

  • New logic to the getCNA method added
  • Maps updated (if needed)
  • Tests updated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
level/task type/enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant