Skip to content

Draft: Select limited user columns for gitlab git auth

Drew Blessing requested to merge dblessing_select_star_exploration into master

What does this MR do?

Related to (but does not close) #325332 (closed)

Explores whether it's feasible to limit the columns selected for Gitlab::Auth class - used by Git and JWT.

Existing Query

SELECT "users".* 
FROM "users" 
WHERE (LOWER("users"."username") = LOWER('root')) 
LIMIT 1

Proposed Query

SELECT "users"."id", "users"."name", "users"."username", "users"."email", 
"users"."confirmed_at", "users"."locked_at", "users"."state", "users"."user_type",
 "users"."admin", "users"."auditor", "users"."encrypted_password", 
"users"."otp_required_for_login", "users"."last_activity_on", "users"."projects_limit", 
"users"."accepted_term_id", "users"."managed_group_id", "users"."password_expires_at", "users"."confirmation_sent_at" 
FROM "users" WHERE (LOWER("users"."username") = LOWER('root')) 
LIMIT 1

Screenshots (strongly suggested)

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
Edited by Drew Blessing

Merge request reports

Loading