Skip to content

Adjust `Security::StoreReportService` to look up findings using UUIDv5

Summary

During work on #212322 (closed) it came to our attention that the current logic in Security::StoreReportService will result in entries for which our method of calculating UUIDv5 will yield duplicate values. This is would violate the CREATE UNIQUE INDEX index_vulnerability_occurrences_on_uuid ON vulnerability_occurrences USING btree (uuid); constraint present in the database.

We need to adjust the logic present in Security::StoreReportService#create_or_find_vulnerability_finding to match the following flowchart.

image

Implementation plan

  • backend Create find_finding_by_uuidv5
  • backend Create find_finding_by_find_params
  • backend Adjust create_or_find_vulnerability_finding so that it uses above methods to find any duplicate findings before creating new ones
Edited by Michał Zając