Skip to content
Snippets Groups Projects

Adjust `Security::StoreReportService` to look up findings using UUIDv5, attempt 2

What does this MR do?

Adjusts the logic present in Security::StoreReportService#create_or_find_vulnerability_finding to match the following flowchart so that we use UUIDv5 whenever possible.

image

Query details

Selecting a Vulnerabilities::Finding by UUID

https://postgres.ai/console/gitlab/gitlab-production-tunnel/sessions/1758/commands/5930

Sample query
SELECT * FROM vulnerability_occurrences WHERE project_id = 23762767 AND uuid = '6892fc62-ed64-5494-bb8d-83e418f9deda' LIMIT 1;
Full execution plan
 Limit  (cost=0.56..3.58 rows=1 width=1131) (actual time=15.098..15.099 rows=0 loops=1)
   Buffers: shared read=4
   I/O Timings: read=15.031
   ->  Index Scan using index_vulnerability_occurrences_on_uuid on public.vulnerability_occurrences  (cost=0.56..3.58 rows=1 width=1131) (actual time=15.096..15.097 rows=0 loops=1)
         Index Cond: ((vulnerability_occurrences.uuid)::text = '6892fc62-ed64-5494-bb8d-83e418f9deda'::text)
         Filter: (vulnerability_occurrences.project_id = 23762767)
         Rows Removed by Filter: 0
         Buffers: shared read=4
         I/O Timings: read=15.031
Summary
Time: 15.297 ms
  - planning: 0.167 ms
  - execution: 15.130 ms
    - I/O read: 15.031 ms
    - I/O write: N/A

Shared buffers:
  - hits: 0 from the buffer pool
  - reads: 4 (~32.00 KiB) from the OS file cache, including disk I/O
  - dirtied: 0
  - writes: 0

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • [-] Label as security and @ mention @gitlab-com/gl-security/appsec
  • [-] The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • [-] Security reports checked/validated by a reviewer from the AppSec team

Related to #292236 (closed)

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • assigned to @Quintasan and unassigned @mayra-cabrera

  • assigned to @mayra-cabrera and unassigned @Quintasan

  • Alex Kalderimis
  • assigned to @Quintasan and unassigned @alexkalderimis

  • Mayra Cabrera approved this merge request

    approved this merge request

  • added databaseapproved label and removed databasereviewed label

  • Michał Zając resolved all threads

    resolved all threads

  • Michał Zając assigned to @minac and unassigned @Quintasan

    assigned to @minac and unassigned @Quintasan

  • Mehmet Emin INAC assigned to @Quintasan and unassigned @minac

    assigned to @Quintasan and unassigned @minac

  • Michał Zając added 4232 commits

    added 4232 commits

    Compare with previous version

  • Michał Zając added 269 commits

    added 269 commits

    Compare with previous version

  • assigned to @dzaporozhets and unassigned @Quintasan

  • changed milestone to %13.10

  • requested review from @dzaporozhets

  • @Quintasan thanks, the code looks good. My only suggestion would be to move v5 string building in some sort of method so we ensure its the same across all specs. I see it was already suggested in !52231 (comment 510158719). I believe it should be in same MR though as it directly related to the new code introduced here.

  • P.S. Great chart!

  • Michał Zając added 1014 commits

    added 1014 commits

    Compare with previous version

  • Michał Zając added 138 commits

    added 138 commits

    Compare with previous version

  • Author Maintainer

    @dzaporozhets I added a helper method for the UUID calculation, back to you.

  • assigned to @dzaporozhets and unassigned @Quintasan

  • Dmytro Zaporozhets (DZ) approved this merge request

    approved this merge request

  • Dmytro Zaporozhets (DZ) resolved all threads

    resolved all threads

  • Dmytro Zaporozhets (DZ) enabled an automatic merge when the pipeline for d8ccd6f3 succeeds

    enabled an automatic merge when the pipeline for d8ccd6f3 succeeds

  • mentioned in commit 8b6129e7

  • added workflowstaging label and removed workflowin review label

  • added workflowcanary label and removed workflowstaging label

  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Please register or sign in to reply
    Loading