<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style id="owaParaStyle" type="text/css">P {margin-top:0;margin-bottom:0;}</style>
</head>
<body ocsi="0" fpstyle="1">
<div style="direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;">Trusts are a part of the solution, yes, but without finer grained roles, the trust model doesn't help too much. You still must delegate far too much access at present. :/<br>
<br>
Thanks,<br>
Kevin<br>
<div style="font-family: Times New Roman; color: #000000; font-size: 16px">
<hr tabindex="-1">
<div style="direction: ltr;" id="divRpF73702"><font face="Tahoma" size="2" color="#000000"><b>From:</b> Jamie Lennox [jamielennox@gmail.com]<br>
<b>Sent:</b> Saturday, November 21, 2015 9:49 PM<br>
<b>To:</b> OpenStack Development Mailing List (not for usage questions)<br>
<b>Subject:</b> Re: [openstack-dev] [keystone] Case for renewability of tokens, increasing expiration time<br>
</font><br>
</div>
<div></div>
<div>
<div dir="ltr"><br>
<div class="gmail_extra">I realize this has been mostly closed up, but just a few additions.<br>
<br>
</div>
<div class="gmail_extra">
<div class="gmail_quote">On 19 November 2015 at 08:06, Dolph Mathews <span dir="ltr">
<<a href="mailto:dolph.mathews@gmail.com" target="_blank">dolph.mathews@gmail.com</a>></span> wrote:<br>
<div> </div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex; border-left:1px #ccc solid; padding-left:1ex">
<div dir="ltr">
<div class="gmail_extra">
<div class="gmail_quote"><span>On Tue, Nov 17, 2015 at 2:56 PM, Lindsay Pallickal
<span dir="ltr"><<a href="mailto:pallickal@gmail.com" target="_blank">pallickal@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex; border-left-width:1px; border-left-color:rgb(204,204,204); border-left-style:solid; padding-left:1ex">
<div dir="ltr"><br>
<div class="gmail_extra"><br>
<div class="gmail_quote"><span>On Tue, Nov 17, 2015 at 5:31 AM, Dolph Mathews <span dir="ltr">
<<a href="mailto:dolph.mathews@gmail.com" target="_blank">dolph.mathews@gmail.com</a>></span> wrote:<br>
</span>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex; border-left-width:1px; border-left-color:rgb(204,204,204); border-left-style:solid; padding-left:1ex">
<span><span><br>
<br>
On Tuesday, November 17, 2015, Lindsay Pallickal <<a href="mailto:pallickal@gmail.com" target="_blank">pallickal@gmail.com</a>> wrote:<br>
</span><span>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex; border-left-width:1px; border-left-color:rgb(204,204,204); border-left-style:solid; padding-left:1ex">
<div dir="ltr">
<div><br>
</div>
<div>It looks like expiration is done this way to limit the damage from stolen tokens, but if a token were stolen, it could be stolen from the same location a username and password will now have to sit, to get around having to re-supply them manually once an
hour. Yes, forcing re-auth hourly with a username and password, at the Keystone level, can limit damage if any of the core Openstack services are compromised for the mass theft of tokens. But limited damage will depend just as much on how quickly the compromise
is detected. The more time an attacker has in the system, the less his actions will be hampered by a lack of token renewals. VMs can be compromised, and data exported or destroyed given just a small window.</div>
</div>
</blockquote>
<div><br>
</div>
</span></span><span>
<div>This first part of this is only a "maybe", not a completely true assertion. There are *many* more opportunities for individual tokens to be exposed than for the credentials used to create them. In the case if a mass token compromise, which I consider to
be a completely different scenario, token expiration probably isn't going it be any help because there's probably always a fresher token available to the attacker, anyway, until the exploit is closed. Instead, keystone has several means of quickly revoking tokens
in bulk (revocation events, truncating the UUID token table, restarting the memcache token backend, or rotating all your Fernet keys away... all depending on your deployment).</div>
</span></blockquote>
<div><br>
</div>
<div>The token does get sent a lot more often than the username/password credentials, but as long as both are sent via SSL/TLS, shouldn't the opportunity for exposure be similar? Although, I could see it being easier to accidentally send a token in the clear,
or in a way vulnerable to a mitm (ignoring ssl cert issues), as there are frequently more bits of code in the client that deal using a token, versus a just few bits to secure when deal with logging in. Tokens get passed around to far more services with potential
vulnerabilities as well, but I see that as a separate issue. I agree with your comment that token expiration will not really help in a mass compromise scenario.</div>
</div>
</div>
</div>
</blockquote>
<div><br>
</div>
</span>
<div>Similar, yes, but with a couple significant differences. Off the top of my head:</div>
<div><br>
</div>
<div>In keystone's v2 API, bearer tokens are a part of the URL in token validation calls and token revocation calls. Of course, access logs are everywhere and many deployments do these operations over HTTP! The v3 API relegates them to headers, at least. I
wonder if it would be possible to have keystoneauth / keystoneclient log a client-side warning when it's asked to send a bearer token over HTTP?</div>
<div><br>
</div>
<div>And certainly, the number of possible attack vectors on a bearer token being passed around to a bunch of services is increased by an order of magnitude.</div>
<span></span></div>
</div>
</div>
</blockquote>
<div><br>
OpenStack is also fairly free with its tokens. You send it to every service and every service that needs to do work elsewhere forwards it to someone else. At least keeping the token system the only service that your username/password is ever exposed to is keystone.
An attacker able to compromise another service still has a lot of power due to the bearer-ness of tokens but they didn't get your user/pass.<br>
<br>
</div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex; border-left:1px #ccc solid; padding-left:1ex">
<div dir="ltr">
<div class="gmail_extra">
<div class="gmail_quote"><span>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex; border-left-width:1px; border-left-color:rgb(204,204,204); border-left-style:solid; padding-left:1ex">
<div dir="ltr">
<div class="gmail_extra">
<div class="gmail_quote"><span>
<div><br>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex; border-left-width:1px; border-left-color:rgb(204,204,204); border-left-style:solid; padding-left:1ex">
<span>
<div> <br>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex; border-left-width:1px; border-left-color:rgb(204,204,204); border-left-style:solid; padding-left:1ex">
<div dir="ltr">
<div><br>
</div>
<div>On the other hand, if a user facing application, or a long running service supporting one, needs the API and is to remain convenient, they have to store usernames and passwords. Sometimes that long running service is connected to the outside world and
faces security threats, such as when relaying Openstack API requests to their respective internal network endpoints - similar to what Horizon does. I wonder if I use Horizon continuously, whether it will force me to manually re-authenticate hourly, and if
not, how it is getting around this problem, with or without storing the username and password.</div>
</div>
</blockquote>
</span></blockquote>
</span></div>
</div>
</div>
</blockquote>
</span></div>
</div>
</div>
</blockquote>
<div><br>
</div>
<div>The solution that was developed for this situation in heat was trusts. With this you delegate certain roles to the service user from the original user to act on your behalf. This lets those service users perform actions on behalf of users after the initial
request has expired. Now there are similarly all sorts of security implications to trusts, the ability to steal trust ids, who sets them up, whats delegated, however if done right they are a much more secure alternative than simply soring user/pass as at least
they are already project and role restricted.<br>
<br>
<br>
</div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex; border-left:1px #ccc solid; padding-left:1ex">
<div dir="ltr">
<div class="gmail_extra">
<div class="gmail_quote"><span>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex; border-left-width:1px; border-left-color:rgb(204,204,204); border-left-style:solid; padding-left:1ex">
<div dir="ltr">
<div class="gmail_extra">
<div class="gmail_quote"><span>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex; border-left-width:1px; border-left-color:rgb(204,204,204); border-left-style:solid; padding-left:1ex">
<span>
<div><br>
</div>
</span>
<div>Bearer tokens are simply not the right solution to this use case. Unless horizon were to store your credentials client-side, you will be logged out after your keystone.conf [token] expiration passes.</div>
</blockquote>
<div><br>
</div>
</span>
<div>I just checked and Horizon re-requests login after an hour, despite activity. So yeah, Horizon is not storing credentials, which is good.</div>
</div>
</div>
</div>
</blockquote>
<div><br>
</div>
</span>
<div>Good to hear the confirmation that's still true - it's been a long while since I've looked at that code, and I almost guarantee we don't test that behavior anywhere.</div>
<span>
<div> </div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex; border-left-width:1px; border-left-color:rgb(204,204,204); border-left-style:solid; padding-left:1ex">
<div dir="ltr">
<div class="gmail_extra">
<div class="gmail_quote"><span>
<div> </div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex; border-left-width:1px; border-left-color:rgb(204,204,204); border-left-style:solid; padding-left:1ex">
<span>
<div> </div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex; border-left-width:1px; border-left-color:rgb(204,204,204); border-left-style:solid; padding-left:1ex">
<div dir="ltr">
<div><br>
</div>
<div>I suspect it is more probable to button up security closer to the core of Openstack, rather than relying on many third party API consuming apps/services to secure even more compromising credentials. Perhaps effort could be put into auditing for atypical
mass token renewal events, like a sudden increase, or accumulating rate of renewal requests in proportion with the number of tokens streamed into compromised state.</div>
<div><br>
</div>
<div>Allowing a maximum of 3 hours, in 1 hour renewal increments via Keystone, and making that configurable, would be a good compromise for user/outside facing apps/apis. Reducing temptation to adopt the security burden of storing usernames and passwords, especially
on a server exposed to the outside or in storage that is outside (cookies & local storage), could itself be a security boon.<br>
</div>
</div>
</blockquote>
<div><br>
</div>
</span>
<div>Have you tried setting keystone.conf [token] expiration to 10800 (3 hours, in seconds)? If so, why doesn't this satisfy your use case? And why expect ordinary users to do busy work to hit the same token lifespan that an attacker will trivially achieve
anyway?</div>
<div>
<div>
<div> </div>
</div>
</div>
</blockquote>
<div><br>
</div>
</span>
<div>I wish I had seen that expiration setting earlier. Just what I needed, thank you.</div>
</div>
</div>
</div>
</blockquote>
<div><br>
</div>
</span>
<div>Awesome!</div>
<div> </div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex; border-left-width:1px; border-left-color:rgb(204,204,204); border-left-style:solid; padding-left:1ex">
<span>
<div dir="ltr">
<div class="gmail_extra">
<div class="gmail_quote">
<div><br>
</div>
<div>In retrospect, it does not make sense to force users to do the busy work of renewal when an attacker could just do the same. Even if the token has expired a earlier due to non-renewal, causing an intruder misses the window, it will only be a matter of
time before a fresh token is available through the same vector. I think a 3 hour expiration window will not add a lot of risk, and the option is already built in, so all is well. Thanks again.</div>
<span><font color="#888888">
<div><br>
</div>
<div>Lindsay</div>
</font></span></div>
</div>
</div>
<br>
</span>__________________________________________________________________________<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>
<br>
</blockquote>
</div>
<br>
</div>
</div>
<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>
<br>
</blockquote>
</div>
<br>
</div>
</div>
</div>
</div>
</div>
</body>
</html>