dependency-track icon indicating copy to clipboard operation
dependency-track copied to clipboard

Implement sort by Affected Projects in Vulnerabilities list

Open valentijnscholten opened this issue 1 year ago • 3 comments

Current Behavior

Currently the list of all vulnerabilities cannot be sorted by affected project count.

Proposed Behavior

Allow sorting the list of vulnerabilities by affected project count, as requested in https://github.com/DependencyTrack/frontend/issues/122

There can be several reasons to work on the most occurring vulnerabilities:

  • triage them to make the state of the portfolio more accurate / up-to-date
  • upgrade the affected component across the whole portfolio to reduce the risk of the portfolio
  • ...

For us it's not uncommon to work on a specific vulnerability and have someone fix / upgrade the component in all the projects in the portfolio. Being able to sort on affected projects count will help to work on the most common vulnerabilities.

Checklist

valentijnscholten avatar Nov 24 '22 16:11 valentijnscholten

I had a brief look into this today.

The affectedProjectCount is a non-persistent field, therefore not sortable/orderable via JDO natively.

setchy avatar Jan 30 '24 18:01 setchy

It doesn't have to be a persistent field, sorting can be done on aggregated values. Currently it's not possible however because the datamodel is not fully normalized and relationschips are missing in places, mainly around aliases. Maybe with a huge custom SQL query which might contain database specific pieces to make it work.

valentijnscholten avatar Jan 31 '24 09:01 valentijnscholten

Thanks @valentijnscholten for the info.

setchy avatar Feb 02 '24 00:02 setchy