Skip to content

Delete orphaned operational vulnerabilities

What does this MR do and why?

This MR removes orphaned operational vulnerabilities (vulnerabilities with report_type: custom or cluster_image_scanning without findings).

Records to be removed

SELECT 
  * 
FROM 
  "vulnerabilities" 
WHERE 
  "vulnerabilities"."report_type" IN (7, 99) 
  AND NOT EXISTS (
    SELECT 
    FROM 
      "vulnerability_occurrences" 
    WHERE 
      "vulnerability_occurrences"."vulnerability_id" = "vulnerabilities"."id"
  );
Orphaned vulnerabilities to be removed: ~11019
Total number of vulnerabilities (with report_type = 7 (cluster image scanning) or 99 (custom)): ~1963825
Percentage of vulnerabilities to be removed: ~0.56%

https://console.postgres.ai/gitlab/gitlab-production-tunnel-pg12/sessions/12430/commands/43905****

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #366948 (closed)

Edited by Alan (Maciej) Paruszewski

Merge request reports