Skip to content

Support setting customizable timeouts for git CLI 2FA via UI & API

What does this MR do?

For #296669 (closed)

This feature will be available only in GitLab Premium and above.

This change

  • uses the value in ApplicationSettings#git_two_factor_session_expiry 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)
  • allows to set this value via the settings API

Assumptions on this new value:

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

Screenshots (strongly suggested)

Screen_Shot_2021-01-28_at_2.30.46_PM

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

Merge request reports

Loading