Add new function for reading/writing encrypted config files
What does this MR do?
This introduces a new function that supports reading/writing encrypted config files using a new provided key in secrets.
Why
This is intended to be used to pass encrypted credentials to gitlab as part of work towards providing encrypted ldap credentials, without having them stored in plaintext. #238483 (closed)
Related MRs
This section was split off from the ldap credentials specific work so that we can review the introduction of the encryption functionality, new key, and support for future rotation seperately from the ldap credentials file itself.
- ldap encrypted credentials MR !45712 (merged)
- documentation MR !48090 (merged)
- omnibus MR for generating the secret omnibus-gitlab!4687 (merged)
- charts MR for generating the secret gitlab-org/charts/gitlab!1617 (merged)
- adding to usage data MR !48210 (merged)
Additional Details
- The base key is only generated if you have an env variable set. See the docs in this MR: !48090 (merged)
- There is internal support and tests for providing keys for rotation, as a forward looking item to show it can be supported, but I don't think we will actually handle the rotation story as part of this MR. We just want to ensure we can support it in the future.
Relates to #238483 (closed)
Screenshots
Does this MR meet the acceptance criteria?
Conformity
-
Changelog entry -
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
Edited by Andrew Kelly