<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Daniel P. Berrangé</title>
	<atom:link href="http://berrange.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://berrange.com</link>
	<description>Writing about photography, open source software, virtualization &#38; more</description>
	<lastBuildDate>Tue, 03 Apr 2012 20:26:48 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Digikam/KDE in Fedora 16 switching UI theme on its own ?</title>
		<link>http://berrange.com/posts/2012/04/03/digikamkde-in-fedora-16-switching-ui-theme-on-its-own/</link>
		<comments>http://berrange.com/posts/2012/04/03/digikamkde-in-fedora-16-switching-ui-theme-on-its-own/#comments</comments>
		<pubDate>Tue, 03 Apr 2012 20:26:00 +0000</pubDate>
		<dc:creator>Daniel Berrange</dc:creator>
				<category><![CDATA[Fedora]]></category>
		<category><![CDATA[Photography]]></category>
		<category><![CDATA[digikam]]></category>
		<category><![CDATA[fedora]]></category>
		<category><![CDATA[kde]]></category>
		<category><![CDATA[themes]]></category>

		<guid isPermaLink="false">http://berrange.com/?p=648</guid>
		<description><![CDATA[I use the wonderful Digikam application for managing my photos on Fedora 16. I don&#8217;t mind that I&#8217;m running a KDE based application under GNOME shell, since it themes itself to match &#38; its featureset easily beats any other open source desktop photo management application. Normally the UI theme when running Digikam under GNOME looks [...]]]></description>
			<content:encoded><![CDATA[<p>I use the wonderful <a href="http://www.digikam.org/">Digikam</a> application for managing my photos on Fedora 16. I don&#8217;t mind that I&#8217;m running a KDE based application under GNOME shell, since it themes itself to match &amp; its featureset easily beats any other open source desktop photo management application. Normally the UI theme when running Digikam under GNOME looks like this:</p>
<p><a href="http://berrange.com/wp-content/uploads/2012/04/Screenshot-at-2012-04-02-214732.png"><img class="aligncenter size-full wp-image-650" title="Normal Digikam Theme under GNOME" src="http://berrange.com/wp-content/uploads/2012/04/Screenshot-at-2012-04-02-214732.png" alt="Normal Digikam Theme under GNOME" width="500" height="400" /></a></p>
<p>And then a strange thing happened last week. When I launched Digikam on my laptop the UI style suddenly changed to this:</p>
<p><a href="http://berrange.com/wp-content/uploads/2012/04/Screenshot-at-2012-04-02-214641.png"><img class="aligncenter size-full wp-image-649" title="Alternative Digikam theme" src="http://berrange.com/wp-content/uploads/2012/04/Screenshot-at-2012-04-02-214641.png" alt="" width="500" height="400" /></a></p>
<p>Notice in particular the different tree view expander icons and the different scrollbars. More interestingly though, the overall UI felt more responsive when interacting with Digikam. Next time I launched Digikam, it was back to the &#8220;normal&#8221; GNOME compatible theme. Wierd. And now just last night the same behaviour occurred on my other laptop &#8211; Digikam launched in a different theme, but upon restart, went back to the original theme. WTF ?</p>
<p>I tried playing with the &#8216;Themes&#8217; menu in Digikam itself and all I can change is the colour scheme, not the widget styling. Trying  to change the KDE application theme in KDE Control Center had precisely zero effect on the Digikam theme.</p>
<p>Can anyone explain this behaviour ? Is there some trick to controlling KDE application themes when running under GNOME on Fedora 16 ? Most importantly how I can get back this alternative Digikam theme? I really liked how responsive it felt to interact with, compared to the standard GNOME-like theme.</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://berrange.com/posts/2012/04/03/digikamkde-in-fedora-16-switching-ui-theme-on-its-own/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Announce: Release of Entangle v0.3.2 – An app for tethered camera control &amp; capture</title>
		<link>http://berrange.com/posts/2012/04/03/announce-release-of-entangle-v0-3-2-an-app-for-tethered-camera-control-capture/</link>
		<comments>http://berrange.com/posts/2012/04/03/announce-release-of-entangle-v0-3-2-an-app-for-tethered-camera-control-capture/#comments</comments>
		<pubDate>Tue, 03 Apr 2012 19:59:35 +0000</pubDate>
		<dc:creator>Daniel Berrange</dc:creator>
				<category><![CDATA[Entangle]]></category>
		<category><![CDATA[Fedora]]></category>
		<category><![CDATA[Photography]]></category>
		<category><![CDATA[entangle]]></category>
		<category><![CDATA[fedora]]></category>
		<category><![CDATA[photography]]></category>
		<category><![CDATA[tethered capture]]></category>
		<category><![CDATA[transifex]]></category>
		<category><![CDATA[translation]]></category>

		<guid isPermaLink="false">http://berrange.com/?p=644</guid>
		<description><![CDATA[I am pleased to announce a new release 0.3.2 of Entangle is available for download from the usual location: http://entangle-photo.org/download/ This release has focused almost exclusively on i18n, integrating with the Fedora Transifex team for translations Major code style cleanup Mark all translatable strings in code &#38; UI files Register with Transifex for translations via [...]]]></description>
			<content:encoded><![CDATA[<p>I am pleased to announce a new release 0.3.2 of Entangle is available for download from the usual location:</p>
<ul>
<li><a href="http://entangle-photo.org/download/">http://entangle-photo.org/download/</a></li>
</ul>
<p>This release has focused almost exclusively on i18n, integrating with the Fedora Transifex team for translations</p>
<ul>
<li>Major code style cleanup</li>
<li>Mark all translatable strings in code &amp; UI files</li>
<li>Register with Transifex for translations via Fedora team</li>
<li>Pull in translations (German, Polish, Ukrainian, Japanese: full, Spanish, Chinese: partial).</li>
<li>Add m4 macros for compiler warnings, missing from previous release dist.</li>
</ul>
<p>There are a great many languages with no coverage here, so if you are able to help out, please join the Fedora translation team:</p>
<ul>
<li><a href="https://fedora.transifex.net/projects/p/entangle/">https://fedora.transifex.net/projects/p/entangle/</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://berrange.com/posts/2012/04/03/announce-release-of-entangle-v0-3-2-an-app-for-tethered-camera-control-capture/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Native IPv6 connectivity for home broadband line</title>
		<link>http://berrange.com/posts/2012/03/22/native-ipv6-connectivity-for-home-broadband-line/</link>
		<comments>http://berrange.com/posts/2012/03/22/native-ipv6-connectivity-for-home-broadband-line/#comments</comments>
		<pubDate>Thu, 22 Mar 2012 21:43:42 +0000</pubDate>
		<dc:creator>Daniel Berrange</dc:creator>
				<category><![CDATA[Fedora]]></category>
		<category><![CDATA[dsl]]></category>
		<category><![CDATA[enta]]></category>
		<category><![CDATA[ipv6]]></category>
		<category><![CDATA[openwrt]]></category>
		<category><![CDATA[pppoe]]></category>
		<category><![CDATA[sixxs]]></category>
		<category><![CDATA[ukfsn]]></category>

		<guid isPermaLink="false">http://berrange.com/?p=630</guid>
		<description><![CDATA[Many years ago now I setup IPv6 across all my machines, both at home and public servers. Back then (2007), only 1 of my 3 ISPs (Bytemark) was offering any IPv6 support at all, so for my Linode server I used a static tunnel from Hurricane Internet, and for home connectivity a dynamic tunnel from [...]]]></description>
			<content:encoded><![CDATA[<p>Many <a href="http://berrange.com/posts/2007/08/16/how-i-learned-to-stop-worrying-and-love-ipv6/">years ago</a> now I setup IPv6 across all my machines, both at home and public servers. Back then (2007), only 1 of my 3 ISPs (<a href="http://www.bytemark.co.uk/">Bytemark</a>) was offering any IPv6 support at all, so for my <a href="http://linode.com">Linode</a> server I used a static tunnel from <a href="http://tunnelbroker.net/">Hurricane Internet</a>, and for home connectivity a dynamic tunnel from <a href="http://sixxs.net">Sixxs</a>. Now, 5 years on, the situation has improved somewhat. Linode offer IPv6 as standard with any virtual machine hosted on their network. I get my home DSL connectivity from <a href="http://ukfsn.org/">UKFSN</a>, who resell <a href="http://www.enta.net/">Enta.net</a> services and sometime last year I learnt that they are providing IPv6 service to their customers.</p>
<p>In my home network, I used a LinkSys modem for the ADSL PPP login. A separate OpenWRT 54GL provides the LAN/WLAN subnet, and routes traffic to the subnet used by the LinkSys modem. While OpenWRT supports IPv6 very well, my LinkSys modem has zero support. So over the past 5 years, the LinkSys has done the IPv4 PPP login, while the aiccu tunnel daemon on my OpenWRT machine does the IPv6 tunnel login. This was never ideal, but functionally it works fine. With native IPv6 connectivity though, the PPP client is responsible for both IPv4 and IPv6 connectivity. So I faced the problem of how to enable this given, that the LinkSys ADSL modem has zero IPv6 support.</p>
<p>The answer to this conundrum is to move the responsibility for the PPP login off the ADSL modem entirely, by putting it into &#8220;Bridged&#8221; mode. In such a setup, the modem is solely responsible for negotiating the DSL link on the line. It then forwards all traffic from the DSL link to its LAN port, using the <a href="https://en.wikipedia.org/wiki/Point-to-point_protocol_over_Ethernet">PPPoE</a> (PPP-over-Ethernet) protocol. The OpenWRT box now runs the PPP daemon to establish the IP layer connectivity to the DSL ISP. This sounds complicated, but it is all surprisingly easy to configure.</p>
<ul>
<li>On the LinkSys router, find the DSL setup options and change the mode from &#8220;PPPoA&#8221; to &#8220;Bridged&#8221;. The loginname/password details are now irrelevant here (and indeed grayed out on my router admin page)</li>
<li>On the OpenWRT router, edit the /etc/config/network section and add PPPoE config section, taking care to add the &#8216;ipv6=1&#8242; option. Contrary to instructions from my ISP, I didn&#8217;t need to configure any IPv6 address/subnet on the ppp0 interface, it is automatically handled via link-local addresses.
<pre>config 'interface' 'wan'
	option 'ifname' 'eth0.1'
	option 'proto' 'pppoe'
	option 'username' 'NNNNNNN@adsllogin.co.uk'
	option 'password' 'XXXXXXX'
	option 'defaultroute' '1'
	option 'peerdns' '1'
	option 'ipv6' '1'</pre>
</li>
<li>Restart networking on the OpenWRT box (/etc/init.d/network restart). If all went to plan the OpenWRT box now has a login to the DSL ISP with both IPv4 and IPv6 connectivity
<pre>ppp0      Link encap:Point-to-Point Protocol
          inet addr:XX.YY.ZZ.AA  P-t-P:BB.CC.DD.EE  Mask:255.255.255.255
          inet6 addr: fe80::XXXX:YYYY::ZZZZ/10 Scope:Link
          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1492  Metric:1
          RX packets:169629 errors:0 dropped:0 overruns:0 frame:0
          TX packets:120721 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:3
          RX bytes:228671985 (218.0 MiB)  TX bytes:11603336 (11.0 MiB)</pre>
</li>
<li>Provide IPv6 connectivity to the LAN using RADVD. With OpenWRT this is trivially achieved by editing /etc/config/radvd. UKFSN/Enta provided me with a /56 subnet for local LAN use. I just allocated the first /64 of this to my LAN for now. The rest I will for creating various subnets between virtual machines I test with
<pre>config prefix
	option interface	'lan'
	option prefix           '2001:XXXX:YYYY:ZZZZ::/64'
	option AdvOnLink	1
	option AdvAutonomous	1
	option AdvRouterAddr	0
	option ignore		0</pre>
</li>
<li>Don&#8217;t forget to ensure that a firewall is up for the IPv6 link &#8211; there&#8217;s no NAT to &#8220;protect&#8221; you, so you want to setup a &#8220;deny all&#8221; rule for incoming connectivity on the &#8220;ppp0&#8243; device.
</ul>
<p>The upshot is that 5 years on from my initial setup, I now have native IPv6 connectivity everywhere. No more IPv6-in-IPv4 tunnels required. I&#8217;ve not compared the download speeds of my native IPv6 connection against the Sixxs IPv6 tunnel I used previously, but I can say that the ping times have improved. Previously IPv6 pings were about 10ms slower than IPv4 pings. Now the ping times are identical, which is nice :-)</p>
]]></content:encoded>
			<wfw:commentRss>http://berrange.com/posts/2012/03/22/native-ipv6-connectivity-for-home-broadband-line/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Getting started hacking on OpenStack Nova</title>
		<link>http://berrange.com/posts/2012/03/09/getting-started-hacking-on-openstack-nova/</link>
		<comments>http://berrange.com/posts/2012/03/09/getting-started-hacking-on-openstack-nova/#comments</comments>
		<pubDate>Fri, 09 Mar 2012 11:37:17 +0000</pubDate>
		<dc:creator>Daniel Berrange</dc:creator>
				<category><![CDATA[Fedora]]></category>
		<category><![CDATA[libvirt]]></category>
		<category><![CDATA[OpenStack]]></category>
		<category><![CDATA[Virt Tools]]></category>
		<category><![CDATA[gerrit]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[openstack]]></category>

		<guid isPermaLink="false">http://berrange.com/?p=619</guid>
		<description><![CDATA[In recent months I have spent more of my time working on projects immediately above/related to the core libvirt library, such as libvirt-glib, libosinfo and virt-sandbox. To that list I have now added OpenStack, where my goal is to ensure that the libvirt driver is following all the best practices and start to take advantage [...]]]></description>
			<content:encoded><![CDATA[<p>In recent months I have spent more of my time working on projects immediately above/related to the core libvirt library, such as libvirt-glib, libosinfo and virt-sandbox. To that list I have now added OpenStack, where my goal is to ensure that the libvirt driver is following all the best practices and start to take advantage of libosinfo for optimizing virtual hardware configuration. I&#8217;m familiar with hacking on python so that&#8217;s no big issue, but what is new about OpenStack is dealing with Gerrit.  For the sake of reference, here were the steps I went through on Fedora 16 for my first patch (a tweak to the tools/install_venv.sh file)</p>
<ol>
<li>Get the initial Nova GIT checkout
<pre>$ mkdir $HOME/src/cloud
$ cd $HOME/src/cloud
$ git clone git://github.com/openstack/nova.git
$ cd nova</pre>
</li>
<li>Install some basic pre-reqs, and ensure python-distutils-extra is not present since that conflicts with part of the openstack build system
<pre>$ sudo yum install gcc python-pep8 python-virtualenv m2crypto libvirt libvirt-python libxslt-devel libxml2-devel
$ sudo yum remove python-distutils-extra</pre>
</li>
<li>Visit the <a href="https://review.openstack.org/" rel="nofollow">OpenStack Gerrit Website</a>, and follow &#8216;Sign In&#8217; link which redirects to LaunchPad for authentication</li>
<li>Back on Gerrit site, now signed in, follow &#8216;Settings&#8217; link, select &#8216;SSH Public Keys&#8217; page, and paste your SSH public key (eg contents of <code>$HOME/.ssh/id_rsa.pub</code>)</li>
<li>Test SSH connectivity from the CLI
<pre>$ ssh -p 29418 berrange@review.openstack.org
The authenticity of host '[review.openstack.org]:29418 ([173.203.103.119]:29418)' can't be established.
RSA key fingerprint is ee:2f:ac:1b:f8:25:d0:39:be:55:02:c7:76:5e:39:53.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '[review.openstack.org]:29418,[173.203.103.119]:29418' (RSA) to the list of known hosts.

**** Welcome to Gerrit Code Review ****

Hi Daniel Berrange, you have successfully connected over SSH.

Unfortunately, interactive shells are disabled.
To clone a hosted Git repository, use:

git clone ssh://berrange@review.openstack.org:29418/REPOSITORY_NAME.git

Connection to review.openstack.org closed.</pre>
</li>
<li>Install commit hook to ensure &#8216;ChangeId&#8217; fields get added to your commits
<pre>$ scp -p -P 29418 berrange@review.openstack.org:hooks/commit-msg .git/hooks/</pre>
</li>
<li>Add the gerrit remote to GIT config
<pre>$ git remote add gerrit ssh://berrange@review.openstack.org:29418/openstack/nova.git</pre>
</li>
<li>Start a new branch for your work
<pre>$ git checkout -b venv-install-fixes</pre>
</li>
<li>Make whatever code changes you need todo
<pre>$ vi tools/virtual_venv.py
$ git add -u

(Don't forget to add yourself to Authors if this is your first change)</pre>
</li>
<li>Commit the changes, checking the commit message gets a &#8216;Change-Id&#8217; line added just prior to the signed-off-by line
<pre>$ git commit -s
$ git show
commit fd682a28fb4591c65f20129d4bfb4eccf1232cb8
Author: Daniel P. Berrange &lt;berrange@redhat.com&gt;
Date: Thu Jan 5 13:15:15 2012 +0000

Tell users what is about to be installed via sudo

Rather than just giving users the sudo password prompt immediately,
actually tell them what is about to be installed, so they know what
privileged action is being attempted.

Change-Id: Ic0c1de812be119384753895531a008075b13494e
Signed-off-by: Daniel P. Berrange &lt;berrange@redhat.com&gt;</pre>
<p>If the commit is fixing a OpenStack bug, then the commit message should include a line &#8220;BugXXXX&#8221; where XXXX is the bug number. Gerrit uses this to link to the bug tracker</li>
<li>Run the unit test suite, and the python pep8 syntax test suite; Be prepared to wait a long time
<pre>$ ./run_tests.sh
$ ./run_tests.sh --pep8</pre>
</li>
<li>Send the changes to Gerrit for review
<pre>$ git push gerrit HEAD:refs/for/master</pre>
</li>
<li>Wait for email notifications of review, or watch the <a href="https://review.openstack.org/" rel="nofollow">OpenStack Gerrit Website</a>.</li>
<li>If problems are found by reviewers, or the automated smoke stack tests. Repeat steps 9-&gt;l;12, but use &#8216;git commit &#8211;amend&#8217; to ensure you preserve the original &#8220;Change-Id&#8221; line in the commit message. This lets gerrit track followup patches.</li>
<li>If everything passes review &amp; testing, it will be automatically merged into master.</li>
</ol>
<p>There is also a GIT plugin  &#8220;git review&#8221; available in the git-review RPM, which can provide syntactic sugar for step 12, but personally I don&#8217;t find it adds significant value to be worth my while using.</p>
<p>I can see the attraction of Gerrit, but I personally still prefer the practice of using git send-email for reviewing on mailing lists. My problems with Gerrit are</p>
<ul>
<li>The email notifications sent out for new patches are almost worse than useless as an information source</li>
<li>While very pretty, the web UI for browsing the diffs is really quite cumbersome to use</li>
<li>Poor support for reviewing large patch series</li>
<li>Use of merge commits makes navigating GIT history cumbersome, forcing the use of the graphical gitk viewer tool</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://berrange.com/posts/2012/03/09/getting-started-hacking-on-openstack-nova/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Announce: Release of Entangle v0.3.1 – An app for tethered camera control &amp; capture</title>
		<link>http://berrange.com/posts/2012/02/13/announce-release-of-entangle-v0-3-1-an-app-for-tethered-camera-control-capture/</link>
		<comments>http://berrange.com/posts/2012/02/13/announce-release-of-entangle-v0-3-1-an-app-for-tethered-camera-control-capture/#comments</comments>
		<pubDate>Mon, 13 Feb 2012 22:25:08 +0000</pubDate>
		<dc:creator>Daniel Berrange</dc:creator>
				<category><![CDATA[Entangle]]></category>
		<category><![CDATA[Fedora]]></category>
		<category><![CDATA[Photography]]></category>
		<category><![CDATA[camera control]]></category>
		<category><![CDATA[entangle]]></category>
		<category><![CDATA[libgphoto2]]></category>
		<category><![CDATA[photography]]></category>
		<category><![CDATA[tethered capture]]></category>

		<guid isPermaLink="false">http://berrange.com/?p=613</guid>
		<description><![CDATA[I am pleased to announce a new release 0.3.1 of Entangle, a GTK3 desktop application for tethered camera control &#38; capture, is available for download from the usual location. This release has focused exclusively on bug fixing following the major refactoring that went into the previous release. If you were having trouble with the previous [...]]]></description>
			<content:encoded><![CDATA[<p>I am pleased to announce a new <a href="http://entangle-photo.org/download/sources/entangle-0.3.1.tar.gz">release 0.3.1</a> of <a href="http://entangle-photo.org">Entangle</a>, a GTK3 desktop application for tethered camera control &amp; capture, is available for download from<a href="http://entangle-photo.org/download/"> the usual location</a>. This release has focused exclusively on bug fixing following the major refactoring that went into the previous release. If you were having trouble with the previous release crashing, then I hope this new one should improve things significantly.</p>
<ul>
<li>Fix crash in handling camera control combo list</li>
<li>Add notice about need to set XDG_DATA_DIRS when installing into unusual directories</li>
<li>Add workaround to avoid immediate crash if schemas were not found in XDG_DATA_DIRS</li>
<li>Compile schema files after installation</li>
<li>Fix crash updating widget sensitivity</li>
<li>Fix crashes &amp; race conditions during capture of images</li>
<li>Fix infinite preview error message popups which can hang the window manager</li>
<li>Fix crash when retrying a failed connection attempt</li>
<li>Fix thread locking when hiding status display</li>
<li>Avoid running multiple threads for monitoring status</li>
<li>Fix initial sensitivity of camera control panels</li>
<li>Update README with new URLs for bugs/mailing lists</li>
</ul>
<p>Since the latest release I have also registered Entangle with <a href="http://gna.org">GNA!</a>, to get support for <a href="http://entangle-photo.org/communicate/">mailing lists</a> and <a href="http://entangle-photo.org/bugs/">bug tracking</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://berrange.com/posts/2012/02/13/announce-release-of-entangle-v0-3-1-an-app-for-tethered-camera-control-capture/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>GPG keysigning made easy with Pius</title>
		<link>http://berrange.com/posts/2012/02/10/gpg-keysigning-made-easy-with-pius/</link>
		<comments>http://berrange.com/posts/2012/02/10/gpg-keysigning-made-easy-with-pius/#comments</comments>
		<pubDate>Fri, 10 Feb 2012 10:53:06 +0000</pubDate>
		<dc:creator>Daniel Berrange</dc:creator>
				<category><![CDATA[Fedora]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Virt Tools]]></category>

		<guid isPermaLink="false">http://berrange.com/?p=604</guid>
		<description><![CDATA[A few months back the Red Hat KVM team held a mass keysigning party to setup a web of trust between each others keys. IIRC, there were approximately 20 people participating in this, which potentially meant alot of tedious typing of GPG commands, with the potential for error such tedium implies. Fortunately we had Jim [...]]]></description>
			<content:encoded><![CDATA[<p>A few months back the Red Hat KVM team held a mass keysigning party to setup a web of trust between each others keys. IIRC, there were approximately 20 people participating in this, which potentially meant alot of tedious typing of GPG commands, with the potential for error such tedium implies. Fortunately we had <a href="http://meyering.net/">Jim Meyering</a> on hand to give us some tips for facilitating/optimizing the process, the most important of which was to introduce us to the &#8216;<a href="http://www.phildev.net/pius/">Pius</a>&#8216; tool.  To quote from its website</p>
<blockquote><p><code>pius</code> (PGP Individual UID Signer) helps <em>attendees</em> of PGP keysigning parties. It is the main utility and allows you to quickly and easily sign each UID on a set of PGP keys. It is designed to take the pain out of the sign-all-the-keys part of PGP Keysigning Party while adding security to the process.</p>
<p>&#8230;</p>
<p>That can already be time consuming, but preferrably, you want to verify the identity in each UID, which means verifying the email addresses. There are a few ways to do this, but one of them is to sign each UID on the key individually (which requires import-sign-export-delete for each UID), encrypt-emailing that key to the email address in the UID. This can be incredibly time consuming.</p>
<p>That&#8217;s where pius comes in. Pius will do all the work for you &#8211; all you have to do is confirm the fingerprint for each key. It will then take care of signing each UID cleanly, minimizing the key, and using PGP/Mime email to send it, encrypted, to the email address in the UID.</p></blockquote>
<p>The steps Jim defined for us to follow using Pius were as follows</p>
<ol>
<li>Collate a list of everyone&#8217;s key IDs. Our list looked like this (cut down to save space)
<pre> # cat &gt; keyids.txt &lt;&lt;EOF
 4096R/000BEEEE 2010-06-14 Jim Meyering
 4096R/E1B768A0 2011-10-11 Richard W.M. Jones
 4096R/15104FDF 2011-10-11 Daniel P. Berrange
 ...
 EOF</pre>
</li>
<li>Download all the keys from a key server (it is assumed everyone has already uploaded their own key to a server)
<pre> # id_list=$(perl -nle 'm!^\d{4}R/(\S{8}) ! and print $1' keyids.txt)
 # gpg --recv-keys  $(echo $id_list)</pre>
</li>
<li>Generate a list of fingerprints for all keys that are to be signed
<pre> # gpg --fingerprint $(echo $id_list)</pre>
</li>
<li>Verify all the fingerprints and their owners&#8217; identities.<br /><strong>This is the security critical part</strong>. You generally want to meet the person face-to-face, verify their identity via some trusted means (passport, driving license, etc). They should read their key fingerprint out to you, and you should verify that it matches the fingerprint of that downloaded from the key server.</li>
<li>Use Pius to sign all the keys whose fingerprints were verified.
<pre>MAIL_HOST=smtp.your.mail.server.com
me=your@email.address.com   (eg dan@berrange.com)
my_id=XXXXXXXXXXX  (Your GPG Key ID eg  15104FDF)
# pius --mail-host=MAIL_HOST --no-pgp-mime --mail=$me --signer=$my_id $(echo $id_list)</pre>
</li>
</ol>
<p>What Pius does here is that for each key ID it is given, it will sign each individual identity (email address). The signature will be ascii-armoured and then sent to the email address associated with that identity. If a user has multiple email addresses on their key, they will receive one signature email per address. The email contains instructions for what the receipient should do. The email will look something like this</p>
<pre>From: eblake@redhat.com
To: berrange@redhat.com
Subject: Your signed PGP key

[-- Attachment #1 --]
[-- Type: text/plain, Encoding: 7bit, Size: 0.7K --]

Hello,

Attached is a copy of your PGP key (0x15104fdf) signed by my key
(0xa7a16b4a2527436a).

If your key has more than one UID, than this key only has the UID associated
with this email address (berrange@redhat.com) signed and you will receive
additional emails containing signatures of the other UIDs at the respective
email addresses.

Please take the attached message and decrypt it and then import it.
Something like this should work:

   gpg -d  | gpg --import

Then, don't forget to send it to a keyserver:

   gpg --keyserver pool.sks-keyservers.net --send-key 15104fdf

If you have any questions, let me know.

Generated by PIUS (http://www.phildev.net/pius/).

[-- Attachment #2: 15104fdf__berrange_at_redhat.com_ENCRYPTED.asc --]
[-- Type: application/octet-stream, Encoding: 7bit, Size: 4.6K --]</pre>
<p>The final thing, once everyone has dealt with the emails they received, is to refresh your local key database to pull down all the new signatures</p>
<pre>
# gpg --recv-keys  $(echo $id_list)
</pre>
<p>I should point out that Pius isn&#8217;t just for mass key signing parties. Even if you only have 1 single key you want to sign, it is still a very convenient tool to use. The simplified set of steps to go through would be</p>
<pre>
# gpg --recv-key XXXXXXXX
# gpg --fingerprint XXXXXXXX
# ...verify person's identity &#038; fingerprint
# pius --mail-host=MAIL_HOST --no-pgp-mime --mail=$me --signer=$my_id XXXXXXX
# ....some time later...
# gpg --recv-key XXXXXXXX
</pre>
<p>Thanks again to Jim Meyering for pointing out Pius and doing the organization for our key signing party &#038; defining the steps I describe above. BTW, Pius is available in Fedora from F16 onwards.</p>
]]></content:encoded>
			<wfw:commentRss>http://berrange.com/posts/2012/02/10/gpg-keysigning-made-easy-with-pius/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Libvirt sandbox at FOSDEM 2012</title>
		<link>http://berrange.com/posts/2012/02/05/libvirt-sandbox-at-fosdem-2012/</link>
		<comments>http://berrange.com/posts/2012/02/05/libvirt-sandbox-at-fosdem-2012/#comments</comments>
		<pubDate>Sun, 05 Feb 2012 17:29:23 +0000</pubDate>
		<dc:creator>Daniel Berrange</dc:creator>
				<category><![CDATA[Fedora]]></category>
		<category><![CDATA[libvirt]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Virt Tools]]></category>
		<category><![CDATA[libvirt-sandbox]]></category>

		<guid isPermaLink="false">http://berrange.com/?p=602</guid>
		<description><![CDATA[As mentioned previously, today I presented a talk at FOSDEM 2012, titled &#8220;Building application sandboxes on top of LXC and KVM with libvirt&#8221;.  As promised I have now uploaded the PDF slides for public access.  For further information about libvirt-sandbox, consult this previous blog post on the subject. Also keep an eye on this site [...]]]></description>
			<content:encoded><![CDATA[<p>As <a href="http://berrange.com/posts/2012/01/31/libvirt-libguestfs-more-at-fosdem-2012/">mentioned previously</a>, today I presented a talk at <a href="http://fosdem.org/2012/schedule/track/virtualization_and_cloud_devroom">FOSDEM 2012</a>, titled &#8220;Building application sandboxes on top of LXC and KVM with libvirt&#8221;.  As promised I have now <a href="http://people.redhat.com/berrange/fosdem-2012/">uploaded the PDF slides</a> for public access.  For further information about libvirt-sandbox, consult this <a href="http://berrange.com/posts/2012/01/17/building-application-sandboxes-with-libvirt-lxc-kvm/">previous blog post</a> on the subject. Also keep an eye on this site for further blog posts in the future. Thanks to everyone who attended the talk. I look forward to returning again in a year&#8217;s time for another update.</p>
]]></content:encoded>
			<wfw:commentRss>http://berrange.com/posts/2012/02/05/libvirt-sandbox-at-fosdem-2012/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>libvirt, libguestfs &amp; more at FOSDEM 2012</title>
		<link>http://berrange.com/posts/2012/01/31/libvirt-libguestfs-more-at-fosdem-2012/</link>
		<comments>http://berrange.com/posts/2012/01/31/libvirt-libguestfs-more-at-fosdem-2012/#comments</comments>
		<pubDate>Tue, 31 Jan 2012 10:39:05 +0000</pubDate>
		<dc:creator>Daniel Berrange</dc:creator>
				<category><![CDATA[Fedora]]></category>
		<category><![CDATA[libvirt]]></category>
		<category><![CDATA[Virt Tools]]></category>
		<category><![CDATA[boxes]]></category>
		<category><![CDATA[fosdem]]></category>
		<category><![CDATA[kvm]]></category>
		<category><![CDATA[libguestfs]]></category>
		<category><![CDATA[libvirt-sandbox]]></category>
		<category><![CDATA[povirt]]></category>
		<category><![CDATA[sandbox]]></category>

		<guid isPermaLink="false">http://berrange.com/?p=598</guid>
		<description><![CDATA[As many readers are no doubt aware, the FOSDEM 2012 conference is taking place this weekend in Brussels. This year I was organized enough to submit a proposal for a talk and was very happy to be accepted. My talk is titled &#8220;Building app sandboxes on top of LXC and KVM with libvirt&#8221; and is [...]]]></description>
			<content:encoded><![CDATA[<p>As many readers are no doubt aware, the <a href="http://fosdem.org/2012/">FOSDEM 2012</a> conference is taking place this weekend in Brussels. This year I was organized enough to submit a proposal for a talk and was very happy to be accepted. <a href="http://fosdem.org/2012/schedule/event/libvirt_lxc_kvm_sandboxes">My talk</a> is titled &#8220;<em>Building app sandboxes on top of LXC and KVM with libvirt</em>&#8221; and is part of the <a href="http://fosdem.org/2012/schedule/track/virtualization_and_cloud_devroom">Virtualization &amp; Cloud Dev Room</a>. As you can guess from the title, I will be talking in some detail about the libvirt-sandbox <a href="http://berrange.com/posts/2012/01/17/building-application-sandboxes-with-libvirt-lxc-kvm/">project I recently announced</a>. Richard Jones is also attending to provide <a href="http://fosdem.org/2012/schedule/event/libguestfs">a talk on libguestfs</a> and how it is used in cloud projects like OpenStack. There will be three talks covering different aspects of the <a href="http://ovirt.org/">oVirt project</a>, a general project overview, technical look at the management engine and a technical look at the node agent VDSM. Finally the GNOME Boxes project I <a href="http://berrange.com/posts/2011/11/22/gnome-3-desktop-virtualization-support-from-gnome-boxes-and-the-future-for-virt-manager/">mentioned</a> a few weeks ago will also be <a href="http://fosdem.org/2012/schedule/event/gnomeboxes">represented</a> in the <a href="http://fosdem.org/2012/schedule/track/crossdesktop_devroom">CrossDesktop devroom.</a></p>
<p>Besides these virtualization related speakers, there are a great many other Red Hat people attending FOSDEM this year, so we put together a small flyer <a href="http://people.redhat.com/duffy/fosdem/redhat-fosdem_2012.pdf">highlighting all the</a><a href="http://people.redhat.com/duffy/fosdem/redhat-fosdem_2012.pdf">ir talks</a>. In keeping with the spirit of FOSDEM, these talks will of course be community / technically focused, not corporate marketing ware :-) I look forward to meeting many people at FOSDEM this year, and if all goes well, make it a regular conference to attend.</p>
]]></content:encoded>
			<wfw:commentRss>http://berrange.com/posts/2012/01/31/libvirt-libguestfs-more-at-fosdem-2012/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rambling about the pain of dealing with passwords for online services</title>
		<link>http://berrange.com/posts/2012/01/23/rambling-about-the-pain-of-dealing-with-passwords-for-online-services/</link>
		<comments>http://berrange.com/posts/2012/01/23/rambling-about-the-pain-of-dealing-with-passwords-for-online-services/#comments</comments>
		<pubDate>Mon, 23 Jan 2012 21:25:43 +0000</pubDate>
		<dc:creator>Daniel Berrange</dc:creator>
				<category><![CDATA[Fedora]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://berrange.com/?p=592</guid>
		<description><![CDATA[Over the last 6 months or so, I&#8217;ve become increasingly paranoid about password usage for online web services. There have a been a number of high profile attacks against both the commercial world and open source project infrastructure, many of which have led to compromise of password databases. Indeed, it feels like my news feed [...]]]></description>
			<content:encoded><![CDATA[<p>Over the last 6 months or so, I&#8217;ve become increasingly paranoid about password usage for online web services. There have a been a number of high profile attacks against both the commercial world and open source project infrastructure, many of which have led to compromise of password databases. Indeed, it feels like my news feed has at least 1 article a week covering an attack &amp; user account compromise against some online service or other. And this is only the attacks that are detected and/or reported. Plenty more places don&#8217;t even realized they have been attacked yet, and there are likely plenty of cover-ups too. This leads me inescapably to my first axiom of password management:</p>
<ul>
<li><strong>Axiom #1: Your password(s) will be compromised. There is no &#8220;if&#8221;, only &#8220;when&#8221;</strong></li>
</ul>
<p>It follows from this, that it is the epitome of foolishness to use the same password for more than one site. Even if you are diligent to watch for news reports of site compromises &amp; quickly change your passwords across all other sites, you are wasting hours of time, and still vulnerable for the period between the attack taking place &amp; being reported in the media (if at all). Out of curiosity, I made a list of every website I could remember where I had registered an account of some kind. I was worried when the list got to 50, I was shocked when it went over 100, and I stopped counting thereafter.</p>
<p>There is a barrage of often conflicting suggestions about how to create strong passwords for accounts. Most websites simply say things like &#8220;<em>you must use a mixture of at least 8 letters, numbers and special symbols</em>&#8220;. Google have been trying to educate people about how to make up more easily remembered passwords, but XKCD <a href="https://www.xkcd.com/936/">points out the flaws</a> in these commonly suggested approaches. Even if you do decide upon some nice scheme for creating your passwords, you quickly come across many websites which will reject your carefully thought up &amp; remembered password. Compound this with the fact that many websites (typically financial ones) also require you to enter &#8220;passwords hints&#8221; based on questions that are supposedly easy to remember, but in fact turn out to be anything but. Now multiply by the number of sites you need passwords for (x100). This leads me inescapably to my second axiom of password management:</p>
<ul>
<li><strong>Axiom #2: It is beyond the capabilities of the human brain to remember enough strong passwords</strong></li>
</ul>
<p>There have been a great many proposals for shared authentication services, whether owned &amp; managed centrally by a corporation like Microsoft Passport, or completely decentralized &amp; vendor independent like OpenID. Today out of all the 100+ sites I use, I can count the number that allow OpenID login on the fingers of one hand. More recently the big social networks have been having some success with positioning themselves as the managers of your identity &amp; providers of authentication to other sites. I am not happy with the idea of any social network being the controller of not only my online identity, but also controller of access to every single website I register with. I don&#8217;t trust them with all this data, and they are an extremely high value target for any would be attackers if they control all your website logins. Letting them control all my logins, feels akin to just re-using the same password across every website. I know they have marginally stronger login procedures than most sites, by allowing you to authenticate individual clients used to login, but this isn&#8217;t enough to balance the downside. In fact I&#8217;m not really convinced that I want any online service to be the manager or all my login details for websites. It is just too big a single point of trust/failure.</p>
<p>A minority of online banking websites now provide you some form of hardware key token generator, or pin entry device to authenticate with. This is clearly not going to work for most websites, due to the cost &amp; distribution problem. Even within the limited scope of financial websites the practicality is limited &#8211; if every financial institution I dealt with had key token generators, I&#8217;d have a huge pile of hardware devices to look after ! I do like hardware authentication devices and <a href="http://berrange.com/posts/2011/12/18/multi-factor-ssh-authentication-using-yubikey-and-ssh-public-keys-together/">now use them for login</a> to any personal SSH servers that I manage, but with a few exceptions like Fedora, they are not a solution for the online password problem today or the forseable future. I am depressingly lead to my third axiom of password management:</p>
<ul>
<li><strong>Axiom #3: Widespread password authentication is here to stay for many, many years to come</strong></li>
</ul>
<p>Hmm, perhaps the problem is better described by mapping to the <a href="https://en.wikipedia.org/wiki/K%C3%BCbler-Ross_model">5 stages of grief</a></p>
<ol>
<li><strong>Denial</strong> &#8211; only careless people have their details compromised, i&#8217;ll be fine using the same 4-5 passwords across all sites</li>
<li><strong>Anger</strong> &#8211; how could $WEBSITE have been so badly run / protected, to let themselves be compromised</li>
<li><strong>Bargaining</strong> &#8211; if I just let Facebook handle all my logins, they&#8217;ll solve all the hard problems for me</li>
<li><strong>Depression</strong> &#8211; the industry will never get its act together &amp; solve authentication</li>
<li><strong>Acceptance</strong> &#8211; passwords are here to stay, what can I do to minimize my risks</li>
</ol>
<p>Well I think I am at step 5 now. I have accepted that passwords are here to stay, that sooner or later one or more of the sites I am registered with will be compromised, and it is impossible for me to remember enough passwords. My goal is thus to minimise the pain and damage.</p>
<p>My conclusion is that the only viable way to manage passwords today is to do the one thing everyone tells you never to do</p>
<ul>
<li><strong>Write down all the passwords</strong></li>
</ul>
<p>Of course this shouldn&#8217;t be taken too literally. I am not suggesting to put a post-it on the monitor with the passwords on it, rather I mean store the passwords in some secure location, which is in turn protected a master password. ie use a password manager application.</p>
<h3>Using KeePassX for managing passwords</h3>
<p>After looking at a few options on Linux, I ended up choosing <a href="http://www.keepassx.org/">KeePassX</a> as my password manager because it had a quite advanced set of features that appealed to me. Before anyone comments, I had discounted any usage of a password manager built into the web browser before even starting. The browser is a directly network facing process of great complexity and frequent security flaws &#8211; they just aren&#8217;t the right place to be storing all your valuable secrets. The features in KeepPassX that I liked were:</p>
<ul>
<li>Passwords are stored encrypted in a structured database</li>
<li>It is possible to specify many different metadata attributes with each password, username, site URL, title, comment, and more.</li>
<li>It can copy the password to the clipboard, allowing paste into web browser forms, avoiding the need to manually type in long password sequences</li>
<li>It automatically purges passwords from the clipboard after 30 seconds to minimise the window when it is visible</li>
<li>The database can be set to automatically lock itself against after 30 seconds, requiring the master password to be entered again to access further password entries</li>
<li>The password database can be secured using a password, or a keyfile, or both. The keyfile is just a plain file with random bytes stored somewhere (like a USB key)</li>
<li>An advanced password generator with many tunable options</li>
</ul>
<p>I have several laptops and I want the password database to be usable from either machine. At the same time though, the password database should not become a single point of failure / data loss, so there needs to be multiple copies of it.  Using a password database does have the downside that it becomes a nice single point of attack for the bad guys. It would thus be desirable to have separate password databases for websites used on a general day-to-day business vs security critical seldom used sites ie bank accounts, and other financial institutions. With this in mind the way I decided to use KeepPassX is as follows</p>
<ul>
<li>I purchased 4x USB stick 4 GB capacity for &lt; 5 GBP each, two coloured black and two coloured white</li>
<li>All 4 USB sticks were split into 2 partitions, each of 2 GB size.</li>
<li>The primary partition is formatted with a Fedora 16 LiveCD. This is to facilitate easy access to the passwords, should I find myself without one of my own Linux laptops close by</li>
<li>The second partition is setup with LUKS full disk encryption and formatted with ext4.</li>
<li>The partition with the encrypted filesystem is used to store the KeePassX database files and any other important files (GPG keys, SSH keys, etc)</li>
<li>The black coloured USB sticks are used to store a database for financial account details</li>
<li>The white coloured USB sticks are used to store a database for any other website logins</li>
<li>One USB stick of each colour is the designated backup. The backup sticks are kept<span class="st"> in the bottom of a locked <em>filing cabinet</em> stuck in a disused lavatory with a sign on the door saying &#8216;Beware of the <em>Leopard</em>.&#8217;</span></li>
<li>A shell script which will synchronize files between sticks, to be run periodically to ensure recent-ish backups</li>
</ul>
<p>With that all decided there merely followed the tedious task of logging into over 100 websites and changing my password on each one. I decided that my default policy would be to let KeePassX generate a new random password for each site made up of letters, numbers and special characters, with a length of 20 characters. Surprisingly the vast majority of sites coped just fine with these passwords. BugZilla turns out to be limited to 16 characters and a handful of ecommerce sites had even shorter limits, or refused to allow use of special characters!</p>
<h3>Using E-Mail &#8220;<em>plus addressing</em>&#8221; for accounts</h3>
<p>It is often said that when bad guys have compromised a website&#8217;s account database they will try to reuse the same email and password on a number of other high value sites. Since many people reuse passwords &amp; many sites allow login based off an email address, the bad guys will trivially gain access to a significant number of accounts on other non-compromised sites. I am already generating unique passwords for each site, but to add just one more roadblock, I decided that while changing passwords, I would also set a unique email address for every single site.</p>
<p>My exim mail server supports what is known as &#8220;plus addressing&#8221;, whereby you can append an arbitrary tag to the local part of an email address. For example given an address &#8220;<strong>fred@example.com</strong>&#8221; you have an infinite number of unique email address &#8220;<strong>fred+TAG@example.com</strong>&#8221; where &#8220;<strong>TAG</strong>&#8221; is any reasonable string. Sadly when I tried using plus addressing, I immediately hit problems, because many (broken) form data validation checks think &#8220;+&#8221; is not a valid character to use in email addresses, or worse they would accept the address but all email they sent would end up in a black hole. Fortunately, it is a trivial matter to reconfigure Exim to allow use of &#8216;-&#8217; as the separator for plus addressing, ie to allow &#8220;<strong>fred-TAG@example.com</strong>&#8220;.</p>
<p>Out of &gt; 100 websites I updated my account details on, only 1 rejected the use of &#8216;-&#8217; in my email address. So now more or less every account I am registered to has both a unique password and unique email address.</p>
<p>In the end, the main thing I an unhappy about is that using a password manager presents a single point of attack for a local computer virus/trojan. Given the frequency with which websites are being compromised these days &amp; the number of sites I need to remember passwords for, I think overall this is clearly still a net win. I will remain on the lookout though for ways to improve the security of the password manager database itself.</p>
]]></content:encoded>
			<wfw:commentRss>http://berrange.com/posts/2012/01/23/rambling-about-the-pain-of-dealing-with-passwords-for-online-services/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Building application sandboxes with libvirt, LXC &amp; KVM</title>
		<link>http://berrange.com/posts/2012/01/17/building-application-sandboxes-with-libvirt-lxc-kvm/</link>
		<comments>http://berrange.com/posts/2012/01/17/building-application-sandboxes-with-libvirt-lxc-kvm/#comments</comments>
		<pubDate>Tue, 17 Jan 2012 23:30:26 +0000</pubDate>
		<dc:creator>Daniel Berrange</dc:creator>
				<category><![CDATA[Fedora]]></category>
		<category><![CDATA[libvirt]]></category>
		<category><![CDATA[Virt Tools]]></category>
		<category><![CDATA[containers]]></category>
		<category><![CDATA[kvm]]></category>
		<category><![CDATA[libvirt-sandbox]]></category>
		<category><![CDATA[lxc]]></category>
		<category><![CDATA[sandbox]]></category>

		<guid isPermaLink="false">http://berrange.com/?p=584</guid>
		<description><![CDATA[I have mentioned in passing every now &#38; then over the past few months, that I have been working on a tool for creating application sandboxes using libvirt, LXC and KVM. Last Thursday, I finally got around to creating a first public release of a package that is now called libvirt-sandbox. Before continuing it is [...]]]></description>
			<content:encoded><![CDATA[<p>I have mentioned in passing every now &amp; then over the past few months, that I have been working on a tool for creating application sandboxes using libvirt, LXC and KVM. Last Thursday, I finally got around to creating a <a href="https://www.redhat.com/archives/libvir-list/2012-January/msg00516.html">first public release</a> of a package that is now called <em>libvirt-sandbox</em>. Before continuing it is probably worth defining what I consider the term &#8220;<em>application sandbox</em>&#8221; to mean. My working definition is that an &#8220;application sandbox&#8221; is simply a way to confine the execution environment of an application, limiting the access it has to OS resources. To me one notable point is that there is no need for a separate / special installation of the application to be confined. An application sandbox ought to be able to run any existing application installed in the OS.</p>
<h3>Background motivation &amp; prototype</h3>
<p>For a few Fedora releases, users have had the <a href="http://danwalsh.livejournal.com/28545.html">SELinux sandbox</a> command which will execute a command with a strictly confined SELinux context applied. It is also able to make limited use of the kernel filesystem namespace feature, to allow changes to the mount table inside the sandbox. For example, the common case is to put in place a different $HOME. The SELinux sandbox has been quite effective, but there is a limit to what can be done with SELinux policy alone, as evidenced by the need to create a setuid helper to enable use of the kernel namespace feature. Architecturally this gets even more problematic as new feature requests need to be dealt with.</p>
<p>As most readers are no doubt aware, libvirt provides a virtualization management API, with support for a wide variety of virtualization technologies. The KVM driver is easily the most advanced and actively developed driver for libvirt with a very wide array of features for machine based virtualization. In terms of container based virtualization, the LXC driver is the most advanced driver in libvirt, often getting new features &#8220;for free&#8221; since it shares alot of code with the KVM driver, in particular anything cgroup based. The LXC driver has always had the ability to pass arbitrary host filesystems through to the container, and the KVM driver gained similar capabilities last year with the inclusion of support for virtio 9p filesystems. One of the well known security features in libvirt is sVirt, which leverages MAC technology like SELinux to strictly confine the execution environment of QEMU. This has also now been adapted to work for the <a href="https://www.redhat.com/archives/libvir-list/2012-January/msg00418.html">LXC driver</a>.</p>
<p>Looking at the architecture of the SELinux sandbox command last year, it occurred to me that the core concepts mapped very well to the host filesystem passthrough &amp; sVirt features in libvirt&#8217;s KVM &amp; LXC drivers. In other words, it ought to be possible to create application sandboxes using the libvirt API and suitably advanced drivers like KVM or LXC. A few weeks hacking resulted in a proof of concept tool <a href="https://gitorious.org/virt-tools/virt-sandbox">virt-sandbox</a> which can run simple commands in sandboxes built on LXC or KVM.</p>
<h3>The libvirt-sandbox API</h3>
<p>A command line tool for running applications inside a sandbox is great, but even more useful would be an API for creating application sandboxes that programmers can use directly. While libvirt provides an API that is portable across different virtualization technologies, it cannot magically hide the differences in feature set or architecture between the technologies. Thus the decision was taken to create a new library called libvirt-sandbox that provides a higher level API for managing application sandboxes, built on top of libvirt. The virt-sandbox command from the proof of concept would then be re-implemented using this library API.</p>
<p>The libvirt-sandbox library is built using GObject to enable it to be accessible to any programming language via <a href="https://live.gnome.org/GObjectIntrospection">GObject Introspection</a>. The basic idea is that programmer simply defines the desired characteristics of the sandbox, such as the command to be executed, any arguments, filesystems to be exposed from host, any bind mounts, private networking configuration, etc. From this configuration description, libvirt-sandbox will decide upon &amp; construct a libvirt guest XML configuration that can actually provided the requested characteristics. In other words, the libvirt-sandbox API is providing a layer of policy avoid libvirt, to isolate the application developer from the implementation details of the underlying hypervisor.</p>
<p>Building sandboxes using LXC is quite straightforward, since application confinement is a core competency of LXC. Thus I will move straight to the KVM implementation, which is where the real fun is. Booting up an entire virtual machine probably sounds like quite a slow process, but it really need not be particularly if you have a well constrained hardware definition which avoids any need for probing. People also generally assume that running a KVM guest, means having a guest operating system install. This is absolutely something that is not acceptable for application sandboxing, and indeed not actually necessary. In a nutshell, libvirt-sandbox creates a new initrd image containing a custom init binary. This init binary simply loads the virtio-9p kernel module and then mounts the host OS&#8217; root filesystem as the guest&#8217;s root filesystem, readonly of course. It then hands off to a second boot strap process which runs the desired application binary and forwards I/O back to the host OS, until the sandboxed application exits. Finally the init process powers off the virtual machine. To get an idea of the overhead, the /bin/false binary can be executed inside a KVM sandbox with an overall execution time of 4 seconds. That is the total time for libvirt to start QEMU, QEMU to run its BIOS, the BIOS to load the kernel + initrd, the kenrel to boot up, /bin/false to run, and the kernel to shutdown &amp; QEMU to exit. I think 3 seconds is pretty impressive todo all that. This is a constant overhead, so for a long running command like an MP3 encoder, it disappears into the background noise. With sufficient optimization, I&#8217;m fairly sure we could get the overhead down to approx 2 seconds.</p>
<h3>Using the virt-sandbox command</h3>
<p>The Fedora review of the libvirt-sandbox package was nice &amp; straightforward, so the package is already available in rawhide for ready to test the <a href="https://fedoraproject.org/wiki/Features/VirtSandbox">VirtSandbox F17 feature</a>. The virt-sandbox command is provided by the libvirt-sandbox RPM package</p>
<p># yum install libvirt-sandbox</p>
<p>Assuming libvirt is already installed &amp; able to run either LXC or KVM guests, everything is ready to use immediately.</p>
<p>A first example is to run the &#8216;/bin/date&#8217; command inside a KVM sandbox:</p>
<pre>$ virt-sandbox -c qemu:///session  /bin/date
Thu Jan 12 22:30:03 GMT 2012</pre>
<p>You want proof that this really is running an entire KVM guest ? How about looking at the /proc/cpuinfo contents:</p>
<pre>$ virt-sandbox -c qemu:///session /bin/cat /proc/cpuinfo
processor	: 0
vendor_id	: GenuineIntel
cpu family	: 6
model		: 2
model name	: QEMU Virtual CPU version 1.0
stepping	: 3
cpu MHz		: 2793.084
cache size	: 4096 KB
fpu		: yes
fpu_exception	: yes
cpuid level	: 4
wp		: yes
flags		: fpu de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pse36 clflush mmx fxsr sse sse2 syscall nx lm up rep_good nopl pni cx16 hypervisor lahf_lm
bogomips	: 5586.16
clflush size	: 64
cache_alignment	: 64
address sizes	: 40 bits physical, 48 bits virtual
power management:</pre>
<p>How about using LXC instead of KVM, and providing an interactive console instead of just a one-shot command ? Yes, we can do that too:</p>
<pre>$ virt-sandbox -c lxc:/// /bin/sh
sh-4.2$ ps -axuwf
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root         1  0.0  0.0 165436  3756 pts/0    Ss+  22:31   0:00 libvirt-sandbox-init-lxc
berrange    24  0.0  0.1 167680  4688 pts/0    S+   22:31   0:00 libvirt-sandbox-init-common
berrange    47  0.0  0.0  13852  1608 pts/1    Ss   22:31   0:00  \_ /bin/sh
berrange    48  0.0  0.0  13124   996 pts/1    R+   22:31   0:00      \_ ps -axuwf</pre>
<p>Notice how we only see the processes from our sandbox, none from the host OS. There are many more examples I&#8217;d like to illustrate, but this post is already far too long.</p>
<h3>Future development</h3>
<p>This blog post might give the impression that every is complete &amp; operational, but that is far from the truth. This is only the bare minimum functionality to enable some real world usage.  Things that are yet to be dealt with include</p>
<ul>
<li>Write suitable SELinux policy extensions to allow KVM to access host OS filesystems in readonly mode. Currently you need to run in permissive mode which is obviously something that needs solving before F17</li>
<li>Turn the virt-viewer command code for SPICE/VNC into a formal API and use that to provide a graphical sandbox running Xorg.</li>
<li>Integrate a tool that is able to automatically create sandbox instances for system services like apache to facilitate confined vhosting deployments</li>
<li>Correctly propagate exit status from the sandboxed command to the host OS</li>
<li>Unentangle stderr and stdout from the sandboxed command</li>
<li>Figure out how to make dhclient work nicely when / is readonly and resolv.conf must be updated in-place</li>
<li>Expose all the libvirt performance tuning controls to allow disk / net I/O controls, CPU scheduling, NUMA affinity, etc</li>
<li>Wire up libvirt&#8217;s firewall capability to allow detailed filtering of network traffic to/from sandboxes</li>
<li>Much more&#8230;</li>
</ul>
<p>For those attending FOSDEM this year, I will be giving a <a href="http://fosdem.org/2012/schedule/event/libvirt_lxc_kvm_sandboxes">presentation about libvirt-sandbox</a> in the virt/cloud track.</p>
<p>Oh and as well as the released tar.gz mentioned in the first paragraph, or the Fedora RPM, the  code is all <a href="http://libvirt.org/git/?p=libvirt-sandbox.git;a=summary">available in GIT</a></p>
]]></content:encoded>
			<wfw:commentRss>http://berrange.com/posts/2012/01/17/building-application-sandboxes-with-libvirt-lxc-kvm/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
	</channel>
</rss>

