Skip to content
Snippets Groups Projects

Add tracking info to Secret Detection

Merged Vishwa Bhat requested to merge vbhat/secret-detection-fingerprint into master
Files
4
@@ -3,7 +3,20 @@
module Security
module Ingestion
module Tasks
# This task is responsible for updating `uuid` DB column of:
# - vulnerability_occurrences table (via UpdateVulnerabilityUuids::VulnerabilityFindings task)
# - vulnerability_feedback table (via UpdateVulnerabilityUuids::VulnerabilityFeedback task)
# - vulnerability_reads table (via UpdateVulnerabilityUuids::VulnerabilityReads task)
# with the `uuid` value of the latest finding in the pipeline. This is done to avoid the duplication of creating
# newly identified findings which are the same vulnerabilities by definition and location but have a different
# fingerprint algorithm.
#
# This task currently updates the findings of the following analyzers:
# - Semgrep SAST Analyzer (semgrep)
# - Secret Detection Analyzer (gitleaks)
class UpdateVulnerabilityUuids < AbstractTask
ALLOWED_SCANNERS = %w[semgrep gitleaks].freeze
def execute
return unless update_uuids?
@@ -46,7 +59,7 @@ def existing_uuids(finding_map_uuids)
end
def update_uuids?
scanners.include?("semgrep")
scanners.intersect?(ALLOWED_SCANNERS)
end
def update_uuids
Loading