Adds ability to enforce SSH key expiration
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 -
Creates feature-flag rollout issue - #299092 (closed)
-
-
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)
Does this MR meet the acceptance criteria?
Conformity
-
Changelog entry- Behind default-off flag -
Documentation (if required) -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers -
Informed Infrastructure department of a default or new setting change, if applicable per definition of done
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