<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Mar 28, 2017 at 2:44 PM, Christopher James Halse Rogers <span dir="ltr"><<a href="mailto:christopher.halse.rogers@canonical.com" target="_blank">christopher.halse.rogers@canonical.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><br><div class="gmail_quote"><div><div class="h5"><div dir="ltr">On Tue, 28 Mar 2017 at 22:31 Pekka Paalanen <<a href="mailto:ppaalanen@gmail.com" target="_blank">ppaalanen@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Tue, 28 Mar 2017 16:20:28 +0900<br class="m_5128158739054045702gmail_msg">
Carsten Haitzler (The Rasterman) <<a href="mailto:raster@rasterman.com" class="m_5128158739054045702gmail_msg" target="_blank">raster@rasterman.com</a>> wrote:<br class="m_5128158739054045702gmail_msg">
<br class="m_5128158739054045702gmail_msg">
> On Wed, 22 Mar 2017 13:59:43 +0200 Pekka Paalanen <<a href="mailto:ppaalanen@gmail.com" class="m_5128158739054045702gmail_msg" target="_blank">ppaalanen@gmail.com</a>> said:<br class="m_5128158739054045702gmail_msg">
><br class="m_5128158739054045702gmail_msg">
> > > == Authentication/Identification ==<br class="m_5128158739054045702gmail_msg">
> > > The goal is to filter clients based on some white/blacklist, so that e.g.<br class="m_5128158739054045702gmail_msg">
> > > xdotool can access this interface but others cannot.<br class="m_5128158739054045702gmail_msg">
> ><br class="m_5128158739054045702gmail_msg">
> > Hi,<br class="m_5128158739054045702gmail_msg">
> ><br class="m_5128158739054045702gmail_msg">
> > if one allows a generic tool that essentially exposes everything at<br class="m_5128158739054045702gmail_msg">
> > will, there isn't much point in authenticating that program, because<br class="m_5128158739054045702gmail_msg">
> > any other program can simply call it.<br class="m_5128158739054045702gmail_msg">
><br class="m_5128158739054045702gmail_msg">
> This is where right now I might lean to some environment variable with a<br class="m_5128158739054045702gmail_msg">
> cookie/key the compositor provides *and that may change from session to session<br class="m_5128158739054045702gmail_msg">
> or on demand).<br class="m_5128158739054045702gmail_msg">
><br class="m_5128158739054045702gmail_msg">
> So compositor might putenv() then fork() + exec() something like a terminal<br class="m_5128158739054045702gmail_msg">
> app.. and then this terminal app and anything run from it inherits this env<br class="m_5128158739054045702gmail_msg">
> var... and thus now has the secret key to provide...<br class="m_5128158739054045702gmail_msg">
><br class="m_5128158739054045702gmail_msg">
> This also allows the compositor to run any such process that passes the<br class="m_5128158739054045702gmail_msg">
> key/cookie along to other processes/tools it determines are safe. It would<br class="m_5128158739054045702gmail_msg">
> require the compositor have a "safe user initiated or approved" way to run such<br class="m_5128158739054045702gmail_msg">
> things.<br class="m_5128158739054045702gmail_msg">
<br class="m_5128158739054045702gmail_msg">
Hi,<br class="m_5128158739054045702gmail_msg">
<br class="m_5128158739054045702gmail_msg">
that doesn't sound too bad. Initially the cookie could be passed in the<br class="m_5128158739054045702gmail_msg">
env, until something better comes around. Also the restrictions and<br class="m_5128158739054045702gmail_msg">
privileges carried with a cookie could vary based on how it was<br class="m_5128158739054045702gmail_msg">
generated, e.g. cookies created for a container could be invalid for<br class="m_5128158739054045702gmail_msg">
clients outside that specific container. Or require matching to SElinux<br class="m_5128158739054045702gmail_msg">
or SMACK or whatever attributes. Or none of these at first. Completely<br class="m_5128158739054045702gmail_msg">
up to the compositor.<br class="m_5128158739054045702gmail_msg">
<br class="m_5128158739054045702gmail_msg">
So now we need a spec for the cookie. An opaque binary blob with<br class="m_5128158739054045702gmail_msg">
variable size, limited by some maximum size? 1 kB max?<br class="m_5128158739054045702gmail_msg">
<br class="m_5128158739054045702gmail_msg">
(To ensure e.g. Wayland can relay the maximum sized cookie in one<br class="m_5128158739054045702gmail_msg">
message.)<br class="m_5128158739054045702gmail_msg">
<br class="m_5128158739054045702gmail_msg">
This could be the generic starting point for all privileged interfaces,<br class="m_5128158739054045702gmail_msg">
Wayland and others. How the client will get the cookie in the first<br class="m_5128158739054045702gmail_msg">
place is left undefined. The cookie should probably be optional too, in<br class="m_5128158739054045702gmail_msg">
case another scheme already grants the privileges.<br class="m_5128158739054045702gmail_msg">
<br class="m_5128158739054045702gmail_msg">
Giulio, how about incorporating such a cookie scheme in your<br class="m_5128158739054045702gmail_msg">
restricted_registry design?<br class="m_5128158739054045702gmail_msg">
<br class="m_5128158739054045702gmail_msg">
OTOH, a spec that uses cookies but does not tell where you might get<br class="m_5128158739054045702gmail_msg">
one, is that useful? Do we have to spec the env variable?<br></blockquote><div><br></div></div></div><div>FWIW, an HMAC cookie is how we handle various privileged actions in Mir (raise window, drag & drop [because most of D&D is handled out-of-compositor]), so this would be easy to integrate for us.<br></div></div></div>
</blockquote></div><br></div><div class="gmail_extra">I am interested in the security concerns here, but are there reliable barriers between different processes run by the same user in the same desktop session? What is the threat model y'all are defending against?<br><br></div><div class="gmail_extra">-Jordan<br></div></div>