Skip to content

Add column git_two_factor_session_expiry to app settings

What does this MR do?

First step towards implementing #296669 (closed)

This MR adds a new column named git_two_factor_session_expiry to application_settings table, which will be used to specify the Git session timeout when 2FA is enabled (in minutes)

The default value has been set to 15 because the current, hard-coded default is 15 (https://gitlab.com/gitlab-org/gitlab/-/blob/578ab1bbaa099c14404146197bfeafe6f904abe3/lib/gitlab/auth/otp/session_enforcer.rb#L8)

Migration log

$ rake db:migrate

== 20210128044930 AddGitTwoFactorSessionExpiryToApplicationSettings: migrating
-- add_column(:application_settings, :git_two_factor_session_expiry, :integer, {:default=>15, :null=>false})
   -> 0.0051s
== 20210128044930 AddGitTwoFactorSessionExpiryToApplicationSettings: migrated (0.0052s)

$ rake db:rollback

== 20210128044930 AddGitTwoFactorSessionExpiryToApplicationSettings: reverting
-- remove_column(:application_settings, :git_two_factor_session_expiry, :integer, {:default=>15, :null=>false})
   -> 0.0023s
== 20210128044930 AddGitTwoFactorSessionExpiryToApplicationSettings: reverted (0.0048s)

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 Alper Akgun

Merge request reports