Add sync for vulnerability ES index whenever the undetected_since is updated

TL;DR

Add sync for vulnerability ES index whenever the undetected_since is updated.

Acceptance Criteria

  • ES sync is triggered when undetected_since is updated in: ee/app/services/security/ingestion/mark_as_resolved_service.rb and ee/app/services/vulnerabilities/starboard_vulnerability_resolve_service.rb and ee/app/services/security/ingestion/tasks/ingest_vulnerabilities/mark_resolved_as_detected.rb ***
  • Vulnerability IDs are extracted and passed correctly to Vulnerabilities::EsHelper.sync_elasticsearch
  • ES index contains the correct undetected_since timestamp matching PostgreSQL

Implementation details

Example MR: Handle ES sync cases for risk score updation (!209304 - merged) • Rushik Subba • 18.6

  • Update ee/app/services/security/ingestion/mark_as_resolved_service.rb with Vulnerabilities::EsHelper.sync_elasticsearch
  • Update ee/app/services/vulnerabilities/starboard_vulnerability_resolve_service.rb with Vulnerabilities::EsHelper.sync_elasticsearch
  • Update ee/app/services/security/ingestion/tasks/ingest_vulnerabilities/mark_resolved_as_detected.rb with Vulnerabilities::EsHelper.sync_elasticsearch
  • Make sure we are passing vulnerability ids to the helper. Currently we do not have ids in the services mentioned, so before calling the helper we need to extract ids from vulnerabilities that we are dealing with.

*** Please double check at the time of implementation if there is any more places where we should do this.

Dependencies

Edited by Lorenz van Herwaarden