<?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>Simplicity is a form of art... &#187; Gentoo</title>
	<atom:link href="http://blog.siphos.be/category/gentoo/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.siphos.be</link>
	<description>Sven Vermeulen&#039;s web log</description>
	<lastBuildDate>Sun, 29 Jan 2012 11:33:40 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>This months&#8217; stabilization done, more to come</title>
		<link>http://blog.siphos.be/2012/01/this-months-stabilization-done-more-to-come/</link>
		<comments>http://blog.siphos.be/2012/01/this-months-stabilization-done-more-to-come/#comments</comments>
		<pubDate>Sun, 29 Jan 2012 11:33:40 +0000</pubDate>
		<dc:creator>swift</dc:creator>
				<category><![CDATA[Hardened]]></category>

		<guid isPermaLink="false">http://blog.siphos.be/?p=549</guid>
		<description><![CDATA[A small notification to tell you that the SELinux policies that were pushed to the main tree 30 days (or more) ago have now been stabilized (none of them introduced problems, although some of them have other bugs still open &#8230; <a href="http://blog.siphos.be/2012/01/this-months-stabilization-done-more-to-come/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>
A small notification to tell you that the SELinux policies that were pushed to the main tree 30 days (or more) ago have now been stabilized (none of them introduced problems, although some of them have other bugs still open which are either fixed in ~arch or will be fixed in the hardened-dev overlay soon). I&#8217;ll be working on pushing an additional set of changes to hardened-dev overlay today as it includes fixes for openrc that are quite important, and might even push this to the tree faster than usual.
</p>
<p>
The reference policy is also working on a new release, so the moment it is released we will be picking that up as well (give or take a month, since my availability will be a bit less the next month).</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.siphos.be/2012/01/this-months-stabilization-done-more-to-come/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Trying out initramfs with selinux and grsec</title>
		<link>http://blog.siphos.be/2012/01/trying-out-initramfs-with-selinux-and-grsec/</link>
		<comments>http://blog.siphos.be/2012/01/trying-out-initramfs-with-selinux-and-grsec/#comments</comments>
		<pubDate>Sun, 15 Jan 2012 10:58:02 +0000</pubDate>
		<dc:creator>swift</dc:creator>
				<category><![CDATA[Hardened]]></category>
		<category><![CDATA[SELinux]]></category>

		<guid isPermaLink="false">http://blog.siphos.be/?p=538</guid>
		<description><![CDATA[I&#8217;m no fan of initramfs. All my systems boot up just fine without it, so I often see it as an additional layer of obfuscation. But there are definitely cases where initramfs is needed, and from the looks of it, &#8230; <a href="http://blog.siphos.be/2012/01/trying-out-initramfs-with-selinux-and-grsec/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>
I&#8217;m no fan of initramfs. All my systems boot up just fine without it, so I often see it as an additional layer of obfuscation. But there are definitely cases where initramfs is needed, and from the <a href="http://thread.gmane.org/gmane.linux.gentoo.devel/74464">looks of it</a>, we might be needing to push out some documentation and support for initramfs. Since my primary focus is to look at a hardened system, I started playing with initramfs together with Gentoo Hardened, grSecurity and SELinux. And what a challenge it was&#8230;
</p>
<p>
But first, a quick introduction to initramfs. The Linux kernel supports <em>initrd</em> images for quite some time. These images are best seen as loopback-mountable images containing a whole file system that the Linux kernel boots as the root device. On this initrd image, a set of tools and scripts then prepare the system and finally switch towards the real root device. The initrd feature was often used when the root device is a network-mounted location or on a file system that requires additional activities (like an encrypted file system or even on LVM. But it also had some difficulties with it.
</p>
<p>
Using a loopback-mountable image means that this is seen as a full device (with file system on it), so the Linux kernel also tries caching the files on it, which leads to some unwanted memory consumption. It is a static environment, so it is hard to grow or shrink it. Every time an administrator creates an initrd, he needs to carefully design (capacity-wise) the environment not to request too much or too little memory.
</p>
<p>
Enter <em>initramfs</em>. The concept is similar: an environment that the Linux kernel boots as a root device which is used to prepare for booting further from the real root file systems. But it uses a different approach. First of all, it is no longer a loopback-mountable image, but a cpio archive that is used on a tmpfs file system. Unlike initrd, tmpfs can grow or shrink as necessary, so the administrator doesn&#8217;t need to plan the capacity of the image. And because it is a tmpfs file system, the Linux kernel doesn&#8217;t try to cache the files in memory (as it knows they already are in memory).
</p>
<p>
There are undoubtedly more advantages to initramfs, but let&#8217;s stick to the primary objective of this post: talk about its implementation on a hardened system.
</p>
<p>
I started playing with <b>dracut</b>, a tool to create initramfs archives which is seen as a widely popular implementation (and suggested on the gentoo development mailinglist). It uses a simple, modular approach to building initramfs archives. It has a base, which includes a small <code>init</code> script and some device handling (based on <code>udev</code>), and modules that you can add depending on your situation (such as adding support for RAID devices, LVM, NFS mounted file systems etc.)
</p>
<p>
On a SELinux system (using a strict policy, enforcing mode) running dracut in the <code>sysadm_t</code> domain doesn&#8217;t work, so I had to create a <code>dracut_t</code> domain (which has been pushed to the Portage tree yesterday). But other than that, it is for me sufficient to call dracut to create an initramfs:
</p>
<pre>
# dracut -f "" 3.1.6-hardened
</pre>
<p>
My grub then has an additional set of lines like so:
</p>
<pre>
title Gentoo Linux Hardened (initramfs)
root (hd0,0)
kernel /boot/vmlinuz-3.1.6-hardened root=/dev/vda1 console=ttyS0 console=tty0
initrd /boot/initramfs-3.1.6-hardened.img
</pre>
<p>
Sadly, the bugger didn&#8217;t boot. The first problem I hit was that the Linux kernel I boot has chroot restrictions in it (grSecurity). These restrictions further tighten chroot environments so that it is much more difficult to &#8220;escape&#8221; a chroot. But <b>dracut</b>, and probably all others, use <b>chroot</b> to further prepare the bootup and eventually switch to the chrooted environment to boot up further. Having the chroot restrictions enabled effectively means that I cannot use initramfs environments. To work around, I enabled <em>sysctl</em> support for all the chroot restrictions and made sure that their default behavior is to be disabled. Then, when the system boots up, it enables the restrictions later in the boot process (through the <code>sysctl.conf</code> settings) and then locks these settings (thanks to grSecurity&#8217;s <code>grsec_lock</code> feature) so that they cannot be disabled anymore later.
</p>
<p>
But no, I did get further, up to the point that either the openrc init is called (which tries to load in the SELinux policy and then breaks) or that the initramfs tries to load the SELinux policy &#8211; and then breaks. The problem here is that there is too much happening before the SELinux policy is loaded. Files are created (such as device files) or manipulated, chroots are prepared, udev is (temporarily) ran, mounts are created, &#8230; all before a SELinux policy is loaded. As a result, the files on the system have incorrect contexts and the moment the SELinux policy is loaded, the processes get denied all access and other privileges they want against these (wrongly) labeled files. And since after loading the SELinux policy, the process runs in <code>kernel_t</code> domain, it doesn&#8217;t have the privileges to relabel the entire system, let alone call commands.
</p>
<p>
This is currently where I&#8217;m stuck. I can get the thing boot up, if you temporarily work in permissive mode. When the openrc init is eventually called, things proceed as usual and the moment udev is started (again, now from the openrc init) it is possible to switch to enforcing mode. All processes are running by then in the correct domain and there do not seem to be any files left with wrong contexts (since the initramfs is not reachable anymore and the device files in <code>/dev</code> are now set again by udev which is SELinux aware.
</p>
<p>
But if you want to boot up in enforcing straight away, there are still things to investigate. I think I&#8217;ll need to put the policy in the initramfs as well (which has the huge downside that every update on the policy requires a rebuild of the initramfs as well). In that case I can load the policy early up the chain and have the initramfs work further running in an enforced situation. Or I completely regard the initramfs as an &#8220;always trusted&#8221; environment and wait for openrc&#8217;s init to load the SELinux policy. In that case, I need to find a way to relabel the (temporarily created) <code>/dev</code> entries (like console, kmsg, &#8230;) before the policy is loaded.
</p>
<p>
Definitely to be continued&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.siphos.be/2012/01/trying-out-initramfs-with-selinux-and-grsec/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Gentoo WiKi &amp; Knowledge Base</title>
		<link>http://blog.siphos.be/2011/12/gentoo-wiki-knowledge-base/</link>
		<comments>http://blog.siphos.be/2011/12/gentoo-wiki-knowledge-base/#comments</comments>
		<pubDate>Mon, 26 Dec 2011 18:01:34 +0000</pubDate>
		<dc:creator>swift</dc:creator>
				<category><![CDATA[Gentoo]]></category>

		<guid isPermaLink="false">http://blog.siphos.be/?p=519</guid>
		<description><![CDATA[I have been playing with the Gentoo Wiki the last few days and am very impressed with the work that both the wiki teams as well as existing contributors have already done to the place. The look and feel is &#8230; <a href="http://blog.siphos.be/2011/12/gentoo-wiki-knowledge-base/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>
I have been playing with the <a href="http://wiki.gentoo.org">Gentoo Wiki</a> the last few days and am very impressed with the work that both the wiki teams as well as existing contributors have already done to the place. The look and feel is very slick and editing works just as expected. One of the changes I made was to move <a href="http://wiki.gentoo.org/wiki/SELinux">SELinux module information</a> to the wiki. This documentation was originally intended to be published on the <a href="http://hardened.gentoo.org/selinux/">Gentoo SELinux Project</a> page, but is easily accessible and maintainable on the wiki too.
</p>
<p>
So I went a step further and dug up my original <a href="http://www.gentoo.org/proj/en/glep/glep-0051.html">GLEP 0051 &#8211; Gentoo Knowledge Base</a> proposal and checked how far I could use the Gentoo WiKi for this purpose. From the looks of it, the WiKi can offer a great deal of leverage for this idea and although not everything is supported through the WiKi (like natural search language and such), that might have been overshooting a bit. So we received a <a href="http://wiki.gentoo.org/wiki/Knowledge_Base:Main_Page">Gentoo WiKi Knowledge Base</a> namespace under which the <a href="http://wiki.gentoo.org/index.php?title=Special%3AAllPages&#038;from=&#038;to=&#038;namespace=500">Knowledgebase entries</a> can reside.
</p>
<p>
Now what is the idea behind such a knowledge base? Well, first of all, the articles below this prefix should all follow the same structure (as explained in the <a href="http://wiki.gentoo.org/wiki/Knowledge_Base:Main_Page">main page</a>) and be sufficiently specific so that the title of the entry should leave little room for misinterpretation. But other than that, there is no limit as to what the Knowledge Base could hold. To that respect, the knowledge base section then provides a (hopefully) thorough listing of common and less common issues with a good explanation why the problem occurred and how to resolve it.
</p>
<p>
For the time being, the location doesn&#8217;t hold that many <a href="http://wiki.gentoo.org/index.php?title=Special%3AAllPages&#038;from=&#038;to=&#038;namespace=500">entries</a> yet, but I will add them as they come along. And of course, feedback is always appreciated ;-)
</p>
<p>
On a second note, I&#8217;d like to give my PoV on the wiki and its relation with the official Gentoo documentation. Unlike what might be circulating, I&#8217;m definitely not against the wiki for documentation, on the contrary. Wiki&#8217;s have proven to be a good resource for documentation, and because we can never have enough documentation writers, every method for getting more documentation is welcome. But because of its online nature, offline documentation development (which I frequently do) is not possible. Also, keeping translations in sync might be a bit more challenging compared to a file-based solution with version control (otoh, I have little experience with WiKi translations so I might be wrong here).
</p>
<p>
I strongly believe that the wiki will play a big role in Gentoo&#8217;s documentation assets. Many of the documents currently managed by the GDP or the subprojects might be suited to be hosted on the WiKi, especially when those documents are too specific (and as such would require a very specific developer profile to maintain the documents). In such cases, the maintainers of those documents should be able to pick the most efficient method. But for very generic documents, this might not be an easy option.
</p>
<p>
At least the Gentoo documents now support CC-BY-SA 3.0, so we can migrate documents from the wiki to the main site, and the 2.5 version currently used the most on the main site should be forward compatible with 3.0 (if I read the legalese text well) so we might be able to migrate documents from the main site to the wiki too.
</p>
<p>
<em>Edit:</em> a3li created the &#8220;Knowledge Base&#8221; namespace on the wiki, so I updated the links in my post. Thanks for the work on the wiki, a3li!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.siphos.be/2011/12/gentoo-wiki-knowledge-base/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Supporting fix scripts for XCCDF content and maintaining the documents</title>
		<link>http://blog.siphos.be/2011/12/supporting-fix-scripts-for-xccdf-content-and-maintaining-the-documents/</link>
		<comments>http://blog.siphos.be/2011/12/supporting-fix-scripts-for-xccdf-content-and-maintaining-the-documents/#comments</comments>
		<pubDate>Fri, 23 Dec 2011 14:00:37 +0000</pubDate>
		<dc:creator>swift</dc:creator>
				<category><![CDATA[Gentoo]]></category>

		<guid isPermaLink="false">http://blog.siphos.be/?p=516</guid>
		<description><![CDATA[One of the features supported through OVAL (and Open-SCAP) is to generate fix scripts when a test has failed. The administrator can then verify this script (of course) and then execute it to correct wrong settings. So I decided to &#8230; <a href="http://blog.siphos.be/2011/12/supporting-fix-scripts-for-xccdf-content-and-maintaining-the-documents/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>
One of the features supported through OVAL (and Open-SCAP) is to generate fix scripts when a test has failed. The administrator can then verify this script (of course) and then execute it to correct wrong settings. So I decided to play around with this as well and enhanced the <a href="http://dev.gentoo.org/~swift/docs/previews/oval/gentoo-xccdf-guide.html">Gentoo Security Benchmark</a> (<a href="http://dev.gentoo.org/~swift/docs/previews/oval/scap-gentoo-xccdf.txt">XCCDF source</a>) with some fixables (like for the sysctl settings). And lo and behold: the thing works ;-)
</p>
<p>
After evaluating the XCCDF (together with the <a href="http://dev.gentoo.org/~swift/docs/previews/oval/scap-gentoo-oval.txt">OVAL</a> document) against my system, I had Open-SCAP generate a fix script:
</p>
<pre>
# <b>oscap xccdf generate fix --result-id OSCAP-Test-Gentoo-Default xccdf-results.xml</b>
#!/bin/bash
# OpenSCAP fix generator output for benchmark: Gentoo Security Benchmark

# XCCDF rule: rule-sysctl-ipv4-forward
echo 0 > /proc/sys/net/ipv4/ip_forward

# generated: 2011-12-23T14:53:03+01:00
# END OF SCRIPT
</pre>
<p>
Now isn&#8217;t that nice. But generating a fix script is one thing, <em>maintaining the XCCDF and OVAL documents</em> is a completely other picture.
</p>
<p>
One of the downsides that I talked about earlier already is that OVAL has quite an extensible language (it&#8217;s a large XML document). Although this extensibility is very flexible and powerful, when you want to add generic tests (like validating sysctl values or matching regular expressions in files) having to write over 30 lines of XML code for a single test is time-consuming at the least. So I quickly scripted something to help me maintain these settings.
</p>
<p>
The <a href="http://dev.gentoo.org/~swift/docs/genoval.xml">Generating OVAL documents with genoval.sh</a> document explains this script (which is retrievable from my <a href="https://github.com/sjvermeu/small.coding">git repository</a>) whose primary purpose is to transform a single line into the entire OVAL structure. With this script, I can now just say <em>gentoo variable USE must contain ssl</em> and it generates both the rules in the XCCDF as the OVAL statements in the OVAL document.
</p>
<p>
Okay, it&#8217;s a script, not a feature-full application, but at least it helps me (and perhaps others as well).</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.siphos.be/2011/12/supporting-fix-scripts-for-xccdf-content-and-maintaining-the-documents/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>SELinux Gentoo/Hardened state 2011-12-19</title>
		<link>http://blog.siphos.be/2011/12/selinux-gentoohardened-state-2011-12-19/</link>
		<comments>http://blog.siphos.be/2011/12/selinux-gentoohardened-state-2011-12-19/#comments</comments>
		<pubDate>Mon, 19 Dec 2011 16:04:20 +0000</pubDate>
		<dc:creator>swift</dc:creator>
				<category><![CDATA[Hardened]]></category>
		<category><![CDATA[SELinux]]></category>

		<guid isPermaLink="false">http://blog.siphos.be/?p=512</guid>
		<description><![CDATA[On december 14th, the Gentoo Hardened project had its monthly online meeting to discuss the current state of affairs of its projects and subprojects. Amongst them, the updates on the SELinux-front were presented as well. Since last meeting, the follow &#8230; <a href="http://blog.siphos.be/2011/12/selinux-gentoohardened-state-2011-12-19/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>
On december 14th, the <a href="http://hardened.gentoo.org">Gentoo Hardened</a> project had its monthly <a href="http://archives.gentoo.org/gentoo-hardened/msg_6ee74d905f217b47446ace08da32a921.xml">online meeting</a> to discuss the current state of affairs of its projects and subprojects. Amongst them, the updates on the SELinux-front were presented as well.
</p>
<p>
Since last meeting, the follow topics passed the revue.
</p>
<ul>
<li>
    <a href="http://packages.gentoo.org/package/sec-policy/selinux-base-policy">sec-policy/selinux-base-policy</a>, which is the &#8220;master&#8221; of our SELinux policies and contains those SELinux modules that are somewhat indivisible (hence the name, &#8220;base&#8221;), is now at revision 8. I tend to describe the changes on the gentoo-hardened mailinglist, and this is <a href="http://archives.gentoo.org/gentoo-hardened/msg_b11ef32142076034abd0616e373361da.xml">not different for rev 8</a>. I haven&#8217;t stabilized the rev 6 one yet although I promised too, I&#8217;ll try to find some time to do that this evening.
  </li>
<li>
    We had a <a href="https://bugs.gentoo.org/show_bug.cgi?id=375475">regression</a> with <b>newrole</b> for some time. Luckily, Jory &#8220;Anarchy&#8221; Pratt found the issue. Drop the setuid bit from the binary, and the application works again as it should. This will be included in the next <a href="http://packages.gentoo.org/package/sys-apps/policycoreutils">policycoreutils</a> bump.
  </li>
<li>
    The last available <a href="http://packages.gentoo.org/package/app-admin/sudo">sudo</a> package now builds with native SELinux support as well, which allows users to add ROLE= and TYPE= information in the <code>sudoers</code> file. As such, users do not need to call <b>newrole</b> when they need to transition to a specific role for just a single command &#8211; sudo can now take care of that.
  </li>
<li>
    The older <code>selinux/v2refpolicy/*</code> profiles have been deprecated. If you want to use a SELinux-enabled profile, you need to use a profile that ends with <code>/selinux</code>, such as <code>default/linux/amd64/10.0/selinux</code> or <code>hardened/linux/amd64/selinux</code>. Of course we prefer you to use a hardened profile ;-)
  </li>
<li>
    Documentation-wise, </p>
<ul>
<li>
      the <a href="http://www.gentoo.org/proj/en/hardened/selinux/selinux-handbook.xml">Gentoo Hardened SELinux Handbook</a> has been updated to reflect the profile changes
    </li>
<li>
      the <a href="http://www.gentoo.org/proj/en/hardened/selinux-bugreporting.xml">SELinux bugreporting guide</a> has been put online to inform users what kind of information is needed for us to fix issues or denials that they might see
    </li>
<li>
      the <a href="http://www.gentoo.org/proj/en/hardened/selinux-faq.xml">SELinux FAQ</a> has been updated with the questions <a href="http://www.gentoo.org/proj/en/hardened/selinux-faq.xml#nosuid">Applications do not transition on a nosuid partition</a> and <a href="http://www.gentoo.org/proj/en/hardened/selinux-faq.xml#auth-run_init">Why do I always need to re-authenticate when operating init scripts?</a>.
    </li>
</ul>
</li>
</ul>
<p>
That&#8217;s about it. Not a too busy month but progress anyhow.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.siphos.be/2011/12/selinux-gentoohardened-state-2011-12-19/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Supporting CC-BY-SA 3.0</title>
		<link>http://blog.siphos.be/2011/11/supporting-cc-by-sa-3-0/</link>
		<comments>http://blog.siphos.be/2011/11/supporting-cc-by-sa-3-0/#comments</comments>
		<pubDate>Tue, 29 Nov 2011 19:33:17 +0000</pubDate>
		<dc:creator>swift</dc:creator>
				<category><![CDATA[Gentoo]]></category>

		<guid isPermaLink="false">http://blog.siphos.be/?p=502</guid>
		<description><![CDATA[Until now, documents on the Gentoo website all had to be licensed under the Creative Commons Attribution/Share Alike license, version 2.5. Why? Because at the time of the license choice, that was probably the latest version at hand. In the &#8230; <a href="http://blog.siphos.be/2011/11/supporting-cc-by-sa-3-0/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>
Until now, documents on the <a href="http://www.gentoo.org">Gentoo website</a> all had to be licensed under the <a href="https://creativecommons.org/licenses/by-sa/2.5/">Creative Commons Attribution/Share Alike</a> license, version 2.5. Why? Because at the time of the license choice, that was probably the latest version at hand. In the XML code itself, the license tagging was done using a <code>&lt;license /&gt;</code> tag. Simple and efficient. But things change, and so do license versions.
</p>
<p>
The folks over at Creative Commons have released <a href="https://creativecommons.org/licenses/by-sa/3.0/">version 3.0</a> somewhere in 2007. I&#8217;m not going to cover the <a href="https://creativecommons.org/weblog/entry/7249">differences</a> here, but in general, the principle behind Gentoo&#8217;s choice for the CC-BY-SA license remains. But we didn&#8217;t change our licenses and there was no real need for it either.
</p>
<p>
Recently however, the <a href="http://wiki.gentoo.org">Official Gentoo Wiki</a> was announced, which uses the CC-BY-SA license as well&#8230; but the 3.0 version of it. You can&#8217;t blame them for taking the latest version, but that does made it a bit more difficult to share resources between the two repositories (wiki versus GuideXML-ified website). The solution? Support CC-BY-SA 3.0 for GuideXML too.
</p>
<p>
A few commits in our repository made that change happen. Nothing big though: the <a href="http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo/xml/htdocs/dtd/common.dtd?sortby=date&#038;r1=1.4&#038;view=log">DTD</a> is updated to allow for <code>&lt;license version="3.0"/&gt;</code> tags, the <a href="http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo/xml/htdocs/xsl/guide.xsl?sortby=date&#038;r1=1.252&#038;view=log">XSL</a> is updated to support this attribute (and display the new license) and a few other files (supporting files, like the <a href="http://www.gentoo.org/doc/en/xml-guide.xml">GuideXML Guide</a>) have received the necessary updates.
</p>
<p>
The result of the change is that existing documents remain under the current 2.5 license (we are not allowed to bump versions of licenses as most documents are not copyrighted by Gentoo Foundation but by their respective authors) but new documents can now use the 3.0 license.
</p>
<p>
<em>Edit:</em> Sebastian Pipping mailed me to say that in the legal code of the CC-BY-SA 2.5 license there is a clausule about &#8220;&#8230; a later version of this license with the same License elements&#8230;&#8221;, so perhaps I might have a &#8220;take two&#8221; on this.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.siphos.be/2011/11/supporting-cc-by-sa-3-0/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SELinux Gentoo/Hardened state 2011-11-17</title>
		<link>http://blog.siphos.be/2011/11/selinux-gentoohardened-state-2011-11-17/</link>
		<comments>http://blog.siphos.be/2011/11/selinux-gentoohardened-state-2011-11-17/#comments</comments>
		<pubDate>Thu, 17 Nov 2011 21:29:45 +0000</pubDate>
		<dc:creator>swift</dc:creator>
				<category><![CDATA[Hardened]]></category>

		<guid isPermaLink="false">http://blog.siphos.be/?p=497</guid>
		<description><![CDATA[A small write-down on the Gentoo Hardened SELinux state-of-affairs, largely triggered because there was an online meeting for the Gentoo Hardened project today. The SELinux policies offered in the sec-policy category are based on the latest refpolicy release. The older &#8230; <a href="http://blog.siphos.be/2011/11/selinux-gentoohardened-state-2011-11-17/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>
A small write-down on the <a href="http://hardened.gentoo.org/selinux">Gentoo Hardened SELinux</a> state-of-affairs, largely triggered because there was an online meeting for the <a href="http://hardened.gentoo.org">Gentoo Hardened</a> project today.
</p>
<ul>
<li>
The SELinux policies offered in the <code>sec-policy</code> category are based on the latest refpolicy release. The older policies have been removed from the Portage tree. The patches that we include in our policies are sent upstream and are getting eventually merged. This way we ensure that we keep the policies manageable (larger development audience), secure (more eyes looking at policy changes) and usable for other SELinux-enabled distributions.
</li>
<li>
The userspace utilities to manage SELinux are also the latest ones available upstream; the older ones have been removed from the tree as well as to keep the number of ebuilds small enough.
</li>
<li>
The Gentoo profiles that enable SELinux support are currently the <code>selinux/v2refpolicy</code> ones and the <code>hardened/*/selinux</code> ones. The former are the older profiles and were a bit more difficult to maintain. The latter ones are the newer profiles which have been running for quite some time now. Alas, we will be deprecating the <code>selinux/v2refpolicy</code> profiles pretty soon now.
</li>
<li>
The various SELinux-related documents as offered on our <a href="http://hardened.gentoo.org/selinux">subproject page</a> are regularly crosschecked to ensure that they are up-to-date with the latest SELinux state-of-affairs. An additional guide will be created on how to report SELinux policy bugs in bugzilla to ensure that we have the information that is needed to get a policy patch accepted upstream as well.
</li>
<li>
On a HR-note: Matt Thode (known as &#8220;prometheanfire&#8221;) has joined the ranks of SELinux developers in Gentoo Hardened. I&#8217;ve also taken over the position as Gentoo Hardened SELinux subproject lead from Chris Pebenito.
</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.siphos.be/2011/11/selinux-gentoohardened-state-2011-11-17/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Gentoo Security Benchmark with OVAL and Open-SCAP</title>
		<link>http://blog.siphos.be/2011/11/gentoo-security-benchmark-with-oval-and-open-scap/</link>
		<comments>http://blog.siphos.be/2011/11/gentoo-security-benchmark-with-oval-and-open-scap/#comments</comments>
		<pubDate>Wed, 16 Nov 2011 21:09:11 +0000</pubDate>
		<dc:creator>swift</dc:creator>
				<category><![CDATA[Gentoo]]></category>
		<category><![CDATA[Hardened]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://blog.siphos.be/?p=489</guid>
		<description><![CDATA[A while ago, I got referred to the Open Vulnerability and Assessment Language, which seems to be an open specification (or even standard) for defining security content/information and being able to document such things in a way that tools can &#8230; <a href="http://blog.siphos.be/2011/11/gentoo-security-benchmark-with-oval-and-open-scap/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>
A while ago, I got referred to the <a href="http://oval.mitre.org/">Open Vulnerability and Assessment Language</a>, which seems to be an open specification (or even standard) for defining security content/information and being able to document such things in a way that tools can interpret it. Actually, it is a set of these specifications. But first:
</p>
<blockquote><p>
tl;dr <a href="http://dev.gentoo.org/~swift/docs/previews/oval/gentoo-xccdf-guide.html">Gentoo Security Benchmark Guide</a> with <a href="http://dev.gentoo.org/~swift/docs/previews/oval/gentoo-xccdf-report.html">example report on automated tests</a> based on <a href="http://dev.gentoo.org/~swift/docs/previews/oval/scap-gentoo-xccdf.txt">XCCDF</a> and <a href="http://dev.gentoo.org/~swift/docs/previews/oval/scap-gentoo-oval2.txt">OVAL</a>, interpreted by <a href="http://www.open-scap.org/page/Main_Page">Open-SCAP</a>.
</p></blockquote>
<p>
There; now that we have that out of our way, let&#8217;s continue on the somewhat more gory details. In this first post, I&#8217;d like to talk a bit about XCCDF and OVAL, which are both imo overly complex but interesting XML formats.
</p>
<p>
The first one, XCCDF, is better known as the <b>Extensible Configuration Checklist Description Format</b> and is an XML format in which you document settings (what should a system look like). By itself, that doesn&#8217;t warrant another XML format. However, the power of XCCDF is that you can define in the document <em>profiles</em>. Each of these profiles is then documented with the set of rules that applies to the profile. So you can have an XCCDF document on the configuration of BIND (the nameserver) and have two profiles: one for a single-server setup, and one for a multi-server (master/slave) setup.
</p>
<p>
These rules also define checks that you can have a tool performed against your configuration. These checks are documented in an OVAL XML file (<b>Open Vulnerability and Assessment Language</b>) which can be interpreted by an OVAL-compliant tool. A very simply put statement could be: &#8220;File /etc/ssh/sshd_config must have a line that matches &#8216;PermitRootLogin no&#8217;&#8221;.
</p>
<p>
Of course, XML doesn&#8217;t use simple statements. In the case of OVAL, a specific form of normalization occurs.
</p>
<ul>
<li>
At the beginning, you define a <em>definition</em> that explains what you want to achieve (similar to the above statement) in plain text, and then refer to one or more criteria that needs to be passed if this line applies. Most checks in a configuration guide are simple criteria, but with OVAL you can create criteria like &#8220;If my system is a Gentoo x86_64 one, and I use the hardened profile, then criteria A must apply, but if my system does not use a hardened profile, it is criteria B&#8221;.
</li>
<li>
The criteria refers to a <em>test</em> that needs to be executed. This test can be a file expression match, partition information check, service state, installed software, etc. but does not allow executing commands  that the user defines (it is not considered a safe practice that you execute commands that are stated in the XML file since most OVAL interpreters will run as root). This test is based on two additional aspects:</p>
<ul>
<li>The <em>object</em> refers to the object or resource that is checked. This can be a partition or a file, or a list of lines that match an expression in a file, etc.</li>
<li>The <em>state</em> refers to the state that that object or resource should be in (or should match).</li>
</ul>
</li>
</ul>
<p>
With this OVAL language in place, you can now refer to several tests to enhance your XCCDF document, and allow OVAL interpreters to test the various rules on your system. For me, this was the major reason to look into the language, since I had my hopes up to update or rewrite the <a href="http://www.gentoo.org/doc/en/security/security-handbook.xml">Gentoo Linux Security Handbook</a> but with a way for users to validate if their system adheres to most/all statements made in that document.
</p>
<p>
As a matter of exercise, I started making such a security benchmark of which you can find a <a href="http://dev.gentoo.org/~swift/docs/previews/oval/gentoo-xccdf-guide.html">HTML version online</a> (it&#8217;s a preview URL, so might change in the future). And since it is written with XCCDF and OVAL, I&#8217;ve also added an <a href="http://dev.gentoo.org/~swift/docs/previews/oval/gentoo-xccdf-report.html">example report on automated tests</a> too. The sources of these documents are available as well (<a href="http://dev.gentoo.org/~swift/docs/previews/oval/scap-gentoo-xccdf.txt">XCCDF</a> and <a href="http://dev.gentoo.org/~swift/docs/previews/oval/scap-gentoo-oval2.txt">OVAL</a> &#8211; download as txt but rename to XML then).
</p>
<p>
For those adventurous enough to play with them: install <code>app-forensics/openscap</code> so that you can parse the files. To generate the guide itself, use <code>oscap xccdf generate scap-gentoo-xccdf.xml &gt; guide.html</code>. To run the tests associated with it, use <code>oscap xccdf eval --oval-results --profile Gentoo-Default --report report.html scap-gentoo-xccdf.xml</code>. Also take a look at the <a href="http://www.open-scap.org/page/Main_Page">Open-SCAP</a> website which is a good resource as well (and the mailinglists are low traffic but with good response times!).
</p>
<p>
So, what is the future on all this for me?
</p>
<p>
First, I&#8217;m going to work a bit further on the OVAL statements, so that I can automatically test the majority of settings that I currently have in the benchmark/guide. Only when I&#8217;m far enough will I continue on the content of the guide (since it is far from finished) and also see if this isn&#8217;t something that can be put on a somewhat more official location. If not, I&#8217;ll still continue developing it, but it&#8217;ll remain on my dev-page.
</p>
<p>
When I&#8217;m somewhat satisfied with that, I might check if I can&#8217;t have OVAL enhanced with some Gentoo-specific objects (there are already objects for RedHat-like and Debian-like distributions) so that we can write tests for Gentoo settings (like USE flags, profiles, enabled GCC specs, etc.) If we have that, then we can even write checks (XCCDF and OVAL based) to validate if a system is how it is supposed to be (wouldn&#8217;t that be great, an automated test that tells you if your system is properly set up according to our documents).
</p>
<p>
But XCCDF and OVAL isn&#8217;t the end. There are other formats available as well, like CCE (for configuration entries), CVE/CPE (to check vulnerability information and its target software/platform) and more. I know RedHat is already actively using OVAL for its <a href="https://www.redhat.com/security/data/oval/">security advisories</a>, and other sites like <a href="http://cisecurity.org/">Center for Internet Security</a> are also using XCCDF and OVAL to document and work with security guides. So why would Gentoo not get on that train as well?</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.siphos.be/2011/11/gentoo-security-benchmark-with-oval-and-open-scap/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SELinux&#8217; 2011/07 releases now stable</title>
		<link>http://blog.siphos.be/2011/10/selinux-201107-releases-now-stable/</link>
		<comments>http://blog.siphos.be/2011/10/selinux-201107-releases-now-stable/#comments</comments>
		<pubDate>Sun, 23 Oct 2011 13:07:51 +0000</pubDate>
		<dc:creator>swift</dc:creator>
				<category><![CDATA[Hardened]]></category>
		<category><![CDATA[SELinux]]></category>

		<guid isPermaLink="false">http://blog.siphos.be/?p=476</guid>
		<description><![CDATA[A few minutes ago, I stabilized both the 2.20110726 policies as well as the SELinux userspace utilities that were stable (upstream) on 20110727. With the change, I also updated the Gentoo SELinux Handbook with the changes I presented on our &#8230; <a href="http://blog.siphos.be/2011/10/selinux-201107-releases-now-stable/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>
A few minutes ago, I stabilized both the 2.20110726 policies as well as the SELinux userspace utilities that were stable (upstream) on 20110727. With the change, I also updated the <a href="http://hardened.gentoo.org/selinux/selinux-handbook.xml">Gentoo SELinux Handbook</a> with the changes I presented on our <a href="http://archives.gentoo.org/gentoo-hardened/msg_73ddd74112bef0007f361f3598140a21.xml">gentoo-hardened</a> mailinglist. After some time, I&#8217;ll remove the now obsoleted older policies and userspace utilities to keep the tree in a sane state.
</p>
<p>
There are a few policy packages whose stabilized version isn&#8217;t the latest (cfr earlier post), those are due within the proper designated period (about 1 month).</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.siphos.be/2011/10/selinux-201107-releases-now-stable/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Gentoo Hardened SELinux policies, rev 5</title>
		<link>http://blog.siphos.be/2011/10/gentoo-hardened-selinux-policies-rev-5/</link>
		<comments>http://blog.siphos.be/2011/10/gentoo-hardened-selinux-policies-rev-5/#comments</comments>
		<pubDate>Thu, 13 Oct 2011 16:30:44 +0000</pubDate>
		<dc:creator>swift</dc:creator>
				<category><![CDATA[Hardened]]></category>
		<category><![CDATA[SELinux]]></category>

		<guid isPermaLink="false">http://blog.siphos.be/?p=471</guid>
		<description><![CDATA[I&#8217;ve pushed out selinux-base-policy version 2.20110726-r5 to the hardened-dev overlay. It does not hold huge changes, most of them are rewrites or updates on pre-existing patches (on the SELinux policies) to make them conform the refpolicy naming conventions and other &#8230; <a href="http://blog.siphos.be/2011/10/gentoo-hardened-selinux-policies-rev-5/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>
I&#8217;ve pushed out <tt>selinux-base-policy</tt> version 2.20110726-r5 to the <a href="http://git.overlays.gentoo.org/gitweb/?p=proj/hardened-dev.git;a=summary">hardened-dev</a> overlay. It does not hold huge changes, most of them are rewrites or updates on pre-existing patches (on the SELinux policies) to make them conform the refpolicy naming conventions and other guidelines. It includes preliminary support for the <a href="http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html">XDG Specification</a> although changes there are still going to occur (as the policy is still under development). Other updates are primarily on the policies for user applications (pan, mozilla, skype), portage and asterisk.
</p>
<p>
In related news, the <a href="http://hardened.gentoo.org/selinux-faq.xml">Gentoo Hardened SELinux FAQ</a> is updated with two entries:
</p>
<ol>
<li><a href="http://www.gentoo.org/proj/en/hardened/selinux-faq.xml#recoverportage">Portage fails to label files because &#8220;setfiles&#8221; does not work anymore</a>, and</li>
<li><a href="http://www.gentoo.org/proj/en/hardened/selinux-faq.xml#nosuid">Applications do not transition on a nosuid-mounted partition</a>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://blog.siphos.be/2011/10/gentoo-hardened-selinux-policies-rev-5/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

