As we start being used more in Enterprise environments we'll get more requests to separate passwords from regular configuration.
I also expect to hear some backlash about having passwords in plain text in configuration files.
Obviously, this is not only the problem of the Rails application, but all components we use as part of GitLab as a whole.
gitlab.rb is a configuration file but it is also a Ruby file.
I want to start a discussion about this, maybe we have some low hanging fruit we can handle.
I like the idea of keeping our current secrets in secrets.yml and then providing an optional secrets.yml.enc that could either be encrypted with a shared key in the Rails root or using a GPG keypair so that any developer or admin could modify it but not read it.
In ElectricFlow/ElectricCommander, such stuff is encrypted and decrypted using passkey file. Administrator could put cleartext password in the configuration files but it will be encrypted when it's read by the server. We may consider similar solution although ElectricFlow/ElectricCommander is built from Java.
@victorwu we are not only talking about user management here. This issue is aimed to cover different way of handling passwords not only for user accounts but for external and internal services and integrations. I think this is not only a Platform team task.
Chatted with @cpallares, the support request is to offer secure storage for all necessary integrations as well, such as LDAP and the database.
Moving from a bunch of passwords in gitlab.rb to a single password somewhere (file, environment var) is good but probably still not sufficient from a customer standpoint. @briann how common is using an asymmetric key to protect the KEK? Seems like an easy solution to me, and something you can easily fix if one gets lost by just replacing the public key and associated encrypted files.
We should also consider that whatever work we do here, also moves us towards a friendlier cloud native approach.
Chatted with @briann on this. Would like to make a proposal:
Rails related keys get protected by the new Rails 5.1 sekrets based protection. These would be anything GitLab Rails needs to consume. By doing this, we can prevent these keys from sitting on disk in an unencrypted format.
Keys for other products (Mattermost, Redis, etc.) are out of scope for now, as they anyway will most likely have to be written out to another location which is unencrypted. We can tackle these on a case by case basis in the future, if they offer an encrypted storage solution.
Does this sound reasonable?
Do we have the break of secrets, between Rails related items and third party apps?
@joshlambert@marin apologies, i put this into 9.4 without checking with you guys. if you need something done in CE, @marin are you able to create an issue and reference this one please. Happy to take scheduling on your lead.