[go: up one dir, main page]

Skip to content

Add vulnerabilities risk score finder

What does this MR do and why?

  1. Adds risk score aggregation query to Search::Elastic::VulnerabilityAggregations
  2. Uses the above query in Search::Elastic::VulnerabilityQueryBuilder
  3. Creates Security::VulnerabilityElasticRiskScoresFinder which uses the above query to fetch project/group risk scores.

Logic -

Project/Group Risk Score = min(1.0, (ΣVulnerability_risk_score + (ΣVulnerability_age_in_month) x 0.005) × 1/√(number_of_vulnerabilities))

Keeping that in mind if we look at the score formula closely vulnerability_age_in_months is nothing but -

Σ(current_time - created_at) which can be simplified further to

Num_vulnerabilities*current_epoch_time - Σcreated_at_in_epoch_time

We can then use this simplification to calculate total risk scores without using scripts. More info on the issue - #571079 (comment 2816510162)

References

Relates to - #571079

Screenshots or screen recordings

Before After

How to set up and validate locally

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Rushik Subba

Merge request reports

Loading