<div dir="ltr">I think there is a little misunderstanding over here, the key point about this problem is that you store your password as *plaintext* in the configuration file, maybe this password is also the password of many other systems. You can't stop the right person to do the right thing, if someone gets the encryped password, and he can also get into the box, then he is the right person, just like somebody gets your password <span class="">through </span><span class="">"brute force" attack, you can't stop him to do the right thing. If someone gets the entryped password, but he can not get into the box, he can do nothing, and this is our goal. So I think split the global configuration file to "general" and "secure" files, and encrypt the secure file is the right way to do this.</span><div><span class=""><br></span></div></div><div class="gmail_extra"><br><div class="gmail_quote">2016-04-26 16:05 GMT-05:00 Doug Hellmann <span dir="ltr"><<a href="mailto:doug@doughellmann.com" target="_blank">doug@doughellmann.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Excerpts from Morgan Fainberg's message of 2016-04-26 10:17:30 -0500:<br>
<div><div class="h5">> On Tue, Apr 26, 2016 at 9:24 AM, Jordan Pittier <<a href="mailto:jordan.pittier@scality.com">jordan.pittier@scality.com</a>><br>
> wrote:<br>
><br>
> ><br>
> ><br>
> > On Tue, Apr 26, 2016 at 3:32 PM, Daniel P. Berrange <<a href="mailto:berrange@redhat.com">berrange@redhat.com</a>><br>
> > wrote:<br>
> ><br>
> >> 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<br>
> >> as<br>
> >> > > plaintext, anyone who has the priviledge to read the configure file<br>
> >> can get<br>
> >> > > the real password, this may be a security problem that can't be<br>
> >> > > unacceptable for some people.<br>
> >><br>
> > It's not a security problem if your config files have the proper<br>
> > permissions.<br>
> ><br>
> ><br>
> >> > ><br>
> >> > > So the first solution comes to my mind is to encrypt these options<br>
> >> when<br>
> >> > > configuring them and decrypt them when reading them in oslo.config.<br>
> >> This is<br>
> >> > > a bit like apache/openldap did, but the difference is these softwares<br>
> >> 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<br>
> >> do<br>
> >> > > this work in oslo.config, for example the admin_password in<br>
> >> > > keystone_middleware section, we must feed the keystone with the<br>
> >> plaintext<br>
> >> > > password which will be hashed in keystone to compare with the stored<br>
> >> 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<br>
> >> place,<br>
> >> > > and decrypt them using the same key when reading them.<br>
> >><br>
> > The issue here is to find a "well secured place". We should not only move<br>
> > the problem somewhere else.<br>
> ><br>
> ><br>
> >> > ><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>
> >> 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>
> >><br>
> > This looks complicated. I like text files that I can quickly view and<br>
> > edit, if I am authorized to (through good old plain Linux permissions).<br>
> ><br>
> ><br>
> >><br>
> >> Regards,<br>
> >> Daniel<br>
> >><br>
> ><br>
> oslo.config already supports multiple configuration files. As long as the<br>
> configuration sections are appropriately combined (they should be? if not<br>
> there is a gap), we can rely on that feature to handle the split between<br>
> "secure" options and "general options". I am strongly against encrypting<br>
> the whole file (it doesn't really solve the problem that well). There is a<br>
<br>
</div></div>Yes, sorry, I wasn't clear but I assumed this was understood to be how we<br>
would do it -- have a secure file and encrypt that. Whether any single<br>
deployment decides to split that file or not is up to them. My point<br>
was just that we should treat the file, not an individual option within<br>
the file.<br>
<span class=""><br>
> history of having "secure" files and "generally viewable" config files<br>
> (prior art, such as gerrit having a "general" config and a "secure" config)<br>
> in many deployments. This also could be handled (decrypting the "secure"<br>
> file) by the startup scripts (systemd is *very* good at order of<br>
> operations/wait for signals); use of ramdisk and proper POSIX (and SELinux)<br>
> attributes can limit concerns about access of the "secure" file (mix in<br>
> some ramdisk, and a reboot of the system/systemd stopping the service, can<br>
> also clear the "sensitive" data). Expect that the data is ultimately<br>
> readable via direct memory access if the standard "best" practices are<br>
> insufficient.<br>
><br>
> There was already talk of having oslo.config supporting an "external store"<br>
> (direct access to hiera or similar?) for certain options. That may be<br>
> significantly better (and ultimately more controlled) than trying to wedge<br>
> encryption into configuration files.<br>
<br>
</span>It might. It has the same problem, though, of protecting the information<br>
used to access the values. Presumably the config library would need a<br>
URL and credentials to access the remote data. If that's visible, the<br>
data is as vulnerable as if it was just in the local file, right?<br>
<span class="HOEnZb"><font color="#888888"><br>
Doug<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
__________________________________________________________________________<br>
OpenStack Development Mailing List (not for usage questions)<br>
Unsubscribe: <a href="http://OpenStack-dev-request@lists.openstack.org?subject:unsubscribe" rel="noreferrer" target="_blank">OpenStack-dev-request@lists.openstack.org?subject:unsubscribe</a><br>
<a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" rel="noreferrer" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a><br>
</div></div></blockquote></div><br></div>