Skip to content

Adds ability to enforce SSH key expiration

Max Woolf requested to merge 250480-enforce-ssh-key-expiry into master

What does this MR do?

  • Adds application setting to enforce SSH key expiration
    • This causes expired SSH keys to no longer work. They can no longer push/pull commits.
  • Adds new validation for keys to be considered invalid
  • Adds documentation around new feature
  • Introduces new feature flag
  • Adds new licensed feature
  • Adds all relevent specs

Technical Approach

  • Adds a new EE-only validation to Key which will decide a Key is invalid if expiration enforcement is enabled and the key has expired.
  • This will cause the actor check in GitAccess to fail if the Key is now invalid.
  • This is not a breaking change as enforcement is disabled by default, even if the feature flag is enabled.

Database Review

Migrate

== 20210118111307 AddEnforceSshKeyExpirationToApplicationSettings: migrating ==
-- add_column(:application_settings, :enforce_ssh_key_expiration, :boolean, {:default=>false, :null=>false})
   -> 0.0021s
== 20210118111307 AddEnforceSshKeyExpirationToApplicationSettings: migrated (0.0022s)

Rollback

== 20210118111307 AddEnforceSshKeyExpirationToApplicationSettings: reverting ==
-- remove_column(:application_settings, :enforce_ssh_key_expiration, :boolean, {:default=>false, :null=>false})
   -> 0.0034s
== 20210118111307 AddEnforceSshKeyExpirationToApplicationSettings: reverted (0.0056s)

Screenshots (strongly suggested)

Screenshot_2021-01-25_at_11.04.08

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

Related to #250480 (closed)

Edited by Max Woolf

Merge request reports