<div dir="ltr">One of the challenges with nova (and I'm working from some earlier conversations, not a first-hand reading of the code) is that we can't restrict file operations to any particular corner of the filesystem, because the location of the libvirt data is stored (only) in the database, and the database is writeable by "unprivileged" nova code.  My understanding is that it's considered a feature that the libvirt data directory can be changed at some point, and old instances will continue to operate in their old location just fine.<div><br></div><div>There's a number of ways to improve that (restrict to a list of configured dirs; limit access to dirs owned by a particular (non-root) uid/gid; etc) but any translation of the nova file-manipulation code to something more secure will rapidly run up against this "so how do we work out what should actually be allowed?" policy discussion.  The conclusion of that discussion will probably require broader nova changes than simply adopting privsep - just fyi.</div><div><br></div><div> - Gus</div></div><br><div class="gmail_quote"><div dir="ltr">On Fri, 10 Jun 2016 at 09:51 Tony Breeds <<a href="mailto:tony@bakeyournoodle.com">tony@bakeyournoodle.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Fri, Jun 10, 2016 at 08:24:34AM +1000, Michael Still wrote:<br>
> On Fri, Jun 10, 2016 at 7:18 AM, Tony Breeds <<a href="mailto:tony@bakeyournoodle.com" target="_blank">tony@bakeyournoodle.com</a>><br>
> wrote:<br>
><br>
> > On Wed, Jun 08, 2016 at 08:10:47PM -0500, Matt Riedemann wrote:<br>
> ><br>
> > > Agreed, but it's the worked example part that we don't have yet,<br>
> > > chicken/egg. So we can drop the hammer on all new things until someone<br>
> > does<br>
> > > it, which sucks, or hope that someone volunteers to work the first<br>
> > example.<br>
> ><br>
> > I'll work with gus to find a good example in nova and have patches up<br>
> > before<br>
> > the mid-cycle.  We can discuss next steps then.<br>
> ><br>
><br>
> Sorry to be a pain, but I'd really like that example to be non-trivial if<br>
> possible. One of the advantages of privsep is that we can push the logic<br>
> down closer to the privileged code, instead of just doing something "close"<br>
> and then parsing. I think reinforcing that idea in the sample code is<br>
> important.<br>
<br>
I think *any* change will show that.  I wanted to pick something achievable in<br>
the short timeframe.<br>
<br>
The example I'm thinking of is nova/virt/libvirt/utils.py:update_mtime()<br>
<br>
 * It will provide a lot of the boiler plate<br>
 * Show that we can now now replace an exec with pure python code.<br>
 * Show how you need to retrieve data from a trusted source on the priviledged<br>
   side<br>
 * Migrate testing<br>
 * Remove an entry from compute.filters<br>
<br>
Once that's implace chown() in the same file is probably a quick fix.<br>
<br>
Is it super helpful? does it have a measurable impact on performance, security?<br>
The answer is probably "no"<br>
<br>
I still think it has value.<br>
<br>
Handling qemu-img is probably best done by creating os-qemu (or similar) and<br>
designing from the ground up with provsep in mind.  Glance and Cinder would<br>
benefit from that also.  That howveer is waaay to big for this cycle.<br>
<br>
Yours Tony.<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>
Message  protected by MailGuard: e-mail anti-virus, anti-spam and content filtering.<a href="http://www.mailguard.com.au/mg" rel="noreferrer" target="_blank">http://www.mailguard.com.au/mg</a><br>
Click here to report this message as spam:<br>
<a href="https://console.mailguard.com.au/ras/1OBOU7cIz8/WIVtx4TniRa9AoBchPxBc/0.62" rel="noreferrer" target="_blank">https://console.mailguard.com.au/ras/1OBOU7cIz8/WIVtx4TniRa9AoBchPxBc/0.62</a><br>
<br>
</blockquote></div>