Skip to content

Resolve "Introduce an optional expiration date for SSH keys"

What does this MR do?

For #36243 (closed)

This change gives the option to a user to set an (optional, non mandatory) expiry date for SSH keys when creating a new SSH key.

In this iteration, we are not enforcing this expiry or disrupting any workflow of the user, rather we are only providing information messages in the console when performing operations with an expired or soon-to-expire keys, so that users can generate new keys in its place.

In the coming iterations, we plan to enforce the expiry of keys.

Changes made:

  1. Users have the option to specify an expiry date when creating a new key, this is optional to specify, default is nil (Never expires)

Screenshot_2020-03-11_at_10.58.22_AM

  1. "!" icon in the keys page alongside a key when it is expired.

Screenshot_2020-03-11_at_10.55.51_AM

  1. The same partial is being reused in the admin/users SSH keys page.

Screenshot_2020-03-11_at_11.00.02_AM

  1. Console message "INFO: Your SSH key has expired. Please generate a new key" when using an expired key for git operations.

Screenshot_2020-03-05_at_4.23.21_PM

  1. Console message "INFO: Your SSH key will expire soon. Please generate a new key" when using a key set to expire in the next 7 days.

Screenshot_2020-03-05_at_4.22.23_PM

  1. expires_at attribute is now exposed via the API for keys.

Unchanged:

  1. No disruption to any git workflow, all operations are performed like before, even if the key has expired.
  2. No system-wide UI notifications or banners to notify the user of an expired key.
  3. No emails sent to the user about a soon to be expired key.

Screenshots

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