Skip to content

Draft: Resolve "Support customizable timeouts for Git CLI 2FA via UI"

What does this MR do?

For #296669 (closed)

This change

  • adds a new column (named git_cli_session_expiry) to ApplicationSettings that holds the session expiry timeout (in minutes) for Git CLI operations when 2FA is enabled.
  • uses this value to enforce session timeouts for Git CLI operations
  • allows to set this value via the UI (via admin/application_settings/general -> Account and limit section)

Assumptions on this new value:

  • The default is 15 minutes.
  • The minimum allowed is 1 minute.
  • We do not currently allow setting unlimited/no expiry, but this change be easily changed later via easing the model validations.

Database changes

$ rails db:migrate

== 20210113051026 AddGitCliSessionExpiryToApplicationSettings: migrating ======
-- add_column(:application_settings, :git_cli_session_expiry, :integer, {:default=>15, :null=>false})
   -> 0.0047s
== 20210113051026 AddGitCliSessionExpiryToApplicationSettings: migrated (0.0047s)

$ rails db:rollback

== 20210113051026 AddGitCliSessionExpiryToApplicationSettings: reverting ======
-- remove_column(:application_settings, :git_cli_session_expiry, :integer, {:default=>15, :null=>false})
   -> 0.0020s
== 20210113051026 AddGitCliSessionExpiryToApplicationSettings: reverted (0.0044s)

Screenshots (strongly suggested)

Screen_Shot_2021-01-13_at_11.48.18_AM

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 Manoj M J [On PTO]

Merge request reports