<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Apr 26, 2016 at 9:24 AM, Jordan Pittier <span dir="ltr"><<a href="mailto:jordan.pittier@scality.com" target="_blank">jordan.pittier@scality.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote"><span class="">On Tue, Apr 26, 2016 at 3:32 PM, Daniel P. Berrange <span dir="ltr"><<a href="mailto:berrange@redhat.com" target="_blank">berrange@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div>On Tue, Apr 26, 2016 at 08:19:23AM -0500, Doug Hellmann wrote:<br>
> Excerpts from Guangyu Suo's message of 2016-04-26 07:28:42 -0500:<br>
> > Hello, oslo team<br>
> ><br>
> > For now, some sensitive options like password or token are configured as<br>
> > plaintext, anyone who has the priviledge to read the configure file can get<br>
> > the real password, this may be a security problem that can't be<br>
> > unacceptable for some people.<br></div></div></blockquote></span><div>It's not a security problem if your config files have the proper permissions. </div><span class=""><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div>
> ><br>
> > So the first solution comes to my mind is to encrypt these options when<br>
> > configuring them and decrypt them when reading them in oslo.config. This is<br>
> > a bit like apache/openldap did, but the difference is these softwares do a<br>
> > salt hash to the password, this is a one-way encryption that can't be<br>
> > decrypted, these softwares can recognize the hashed value. But if we do<br>
> > this work in oslo.config, for example the admin_password in<br>
> > keystone_middleware section, we must feed the keystone with the plaintext<br>
> > password which will be hashed in keystone to compare with the stored hashed<br>
> > password, thus the encryped value in oslo.config must be decryped to<br>
> > plaintext. So we should encrypt these options using symmetrical or<br>
> > unsymmetrical method with a key, and put the key in a well secured place,<br>
> > and decrypt them using the same key when reading them.<br></div></div></blockquote></span><div>The issue here is to find a "well secured place". We should not only move the problem somewhere else.</div><span class=""><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div>
> ><br>
> > Of course, this feature should be default closed. Any ideas?<br>
><br>
> Managing the encryption keys has always been the issue blocking<br>
> implementing this feature when it has come up in the past. We can't have<br>
> oslo.config rely on a separate OpenStack service for key management,<br>
> because presumably that service would want to use oslo.config and then<br>
> we have a dependency cycle.<br>
><br>
> So, we need a design that lets us securely manage those encryption keys<br>
> before we consider adding encryption. If we solve that, it's then<br>
> probably simpler to encrypt an entire config file instead of worrying<br>
> about encrypting individual values (something like how ansible vault<br>
> works).<br>
<br>
</div></div>IMHO encrypting oslo config files is addressing the wrong problem.<br>
Rather than having sensitive passwords stored in the main config<br>
files, we should have them stored completely separately by a secure<br>
password manager of some kind. The config file would then merely<br>
contain the name or uuid of an entry in the password manager. The<br>
service (eg nova-compute) would then query that password manager<br>
to get the actual sensitive password data it requires. At this point<br>
oslo.config does not need to know/care about encryption of its data<br>
as there's no longer sensitive data stored.<br></blockquote></span><div>This looks complicated. I like text files that I can quickly view and edit, if I am authorized to (through good old plain Linux permissions).</div><span class=""><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Regards,<br>
Daniel<br></blockquote></span></div></div></div></blockquote><div><br></div><div>oslo.config already supports multiple configuration files. As long as the configuration sections are appropriately combined (they should be? if not there is a gap), we can rely on that feature to handle the split between <br></div><div>"secure" options and "general options". I am strongly against encrypting the whole file (it doesn't really solve the problem that well). There is a history of having "secure" files and "generally viewable" config files (prior art, such as gerrit having a "general" config and a "secure" config) in many deployments. This also could be handled (decrypting the "secure" file) by the startup scripts (systemd is *very* good at order of operations/wait for signals); use of ramdisk and proper POSIX (and SELinux) attributes can limit concerns about access of the "secure" file (mix in some ramdisk, and a reboot of the system/systemd stopping the service, can also clear the "sensitive" data). Expect that the data is ultimately readable via direct memory access if the standard "best" practices are insufficient.<br><br></div><div>There was already talk of having oslo.config supporting an "external store" (direct access to hiera or similar?) for certain options. That may be significantly better (and ultimately more controlled) than trying to wedge encryption into configuration files.<br></div></div><br></div></div>