Skip to content

Add ability to search instanceSecurityDashboard.projects GraphQL query

What does this MR do?

Add the search ability to the InstanceSecurityDashboard.projects GraphQL query

Screenshots (strongly suggested)

Screen_Shot_2021-05-27_at_11.31.31_AM

Screen_Shot_2021-05-27_at_11.26.43_AM

Does this MR meet the acceptance criteria?

Database performance

from !62933 (comment 598537990)

SELECT 
  "projects".* 
FROM 
  "projects" 
  LEFT JOIN project_features ON projects.id = project_features.project_id 
WHERE 
  "projects"."id" IN (
    SELECT 
      "users_security_dashboard_projects"."project_id" 
    FROM 
      "users_security_dashboard_projects" 
    WHERE 
      "users_security_dashboard_projects"."user_id" = 8748283
  ) 
  AND (
    "project_features"."security_and_compliance_access_level" > 0 
    OR "project_features"."security_and_compliance_access_level" IS NULL
  ) 
  AND (
    (
      "projects"."path" ILIKE '%Shell%' 
      OR "projects"."name" ILIKE '%Shell%'
    ) 
    OR "projects"."description" ILIKE '%Shell%'
  )
ORDER BY projects.id
LIMIT 100

cold:

Time: 79.008 ms
  - planning: 12.758 ms
  - execution: 66.250 ms
    - I/O read: 57.567 ms
    - I/O write: 0.000 ms

Shared buffers:
  - hits: 2387 (~18.60 MiB) from the buffer pool
  - reads: 1306 (~10.20 MiB) from the OS file cache, including disk I/O
  - dirtied: 21 (~168.00 KiB)
  - writes: 0

https://gitlab.slack.com/archives/CLJMDRD8C/p1623356285239000 Details and visualization: https://postgres.ai/console/gitlab/gitlab-production-tunnel-pg12/sessions/4543/commands/15974

warm:

Time: 13.606 ms
  - planning: 7.344 ms
  - execution: 6.262 ms
    - I/O read: 0.000 ms
    - I/O write: 0.000 ms

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

https://gitlab.slack.com/archives/CLJMDRD8C/p1623356400241500

Details and visualization: https://postgres.ai/console/gitlab/gitlab-production-tunnel-pg12/sessions/4543/commands/15975

Conformity

Availability and Testing

Security

Does this MR contain changes to processing or storing of credentials or tokens, authorization and authentication methods or other items described in the security review guidelines? If not, then delete this Security section.

  • 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 #321966 (closed)

Edited by Toon Claes

Merge request reports

Loading