<?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>etbe - Russell Coker &#187; Security</title>
	<atom:link href="http://etbe.coker.com.au/category/security/feed/" rel="self" type="application/rss+xml" />
	<link>http://etbe.coker.com.au</link>
	<description>Linux, politics, and other interesting things</description>
	<lastBuildDate>Sat, 04 Feb 2012 03:19:54 +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>SE Linux Status in Debian 2012-01</title>
		<link>http://etbe.coker.com.au/2012/01/25/se-linux-status-2012-01/</link>
		<comments>http://etbe.coker.com.au/2012/01/25/se-linux-status-2012-01/#comments</comments>
		<pubDate>Wed, 25 Jan 2012 11:36:31 +0000</pubDate>
		<dc:creator>etbe</dc:creator>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[Selinux]]></category>

		<guid isPermaLink="false">http://etbe.coker.com.au/?p=3133</guid>
		<description><![CDATA[Since my last SE Linux in Debian status report [1] there have been some significant changes. Policy Last year I reported that the policy wasn&#8217;t very usable, on the 18th of January I uploaded version 2:2.20110726-2 of the policy packages that fixes many bugs. The policy should now be usable by most people for desktop [...]]]></description>
			<content:encoded><![CDATA[<p>Since <a href="http://etbe.coker.com.au/2011/10/31/selinux-status-2011-10/">my last SE Linux in Debian status report [1]</a> there have been some significant changes.</p>
<h3>Policy</h3>
<p>Last year I reported that the policy wasn&#8217;t very usable, on the 18th of January I uploaded version 2:2.20110726-2 of the policy packages that fixes many bugs. The policy should now be usable by most people for desktop operations and as a server. Part of the delay was that I wanted to include support for systemd, but as my work on systemd proceeded slowly and others didn&#8217;t contribute policy I could use I gave up and just released it. Systemd is still a priority for me and I plan to use it on all my systems when Wheezy is released.</p>
<h3>Kernel</h3>
<p>Some time between Debian kernel 3.0.0-2 and 3.1.0-1 support for an upstream change to the security module configuration was incorporated. Instead of using <b>selinux=1</b> on the kernel command line to enable SE Linux support the kernel option is <b>security=selinux</b>. This change allows people to boot with <b>security=tomoyo</b> or <b>security=apparmor</b> if they wish. No support for Smack though.</p>
<p>As the kernel silently ignores command line parameters that it doesn&#8217;t understand so there is no harm in having both <b>selinux=1</b> and <b>security=selinux</b> on both older and newer kernels. So version <b>0.5.0</b> of <b>selinux-basics</b> now adds both kernel command-line options to GRUB configuration when <b>selinux-activate</b> is run. Also when the package is upgraded it will search for <b>selinux=1</b> in the GRUB configuration and if it&#8217;s there it will add <b>security=selinux</b>. This will give users the functionality that they expect, systems which have SE Linux activated will keep running SE Linux after a kernel upgrade or downgrade! Prior to updating <b>selinux-basics</b> systems running Debian/Unstable won&#8217;t work with SE Linux.</p>
<p>As an aside the postinst file for <b>selinux-basics</b> was last changed in 2006 (thanks Erich Schubert). This package is part of the new design of SE Linux in Debian and some bits of it haven&#8217;t needed to be changed for 6 years! SE Linux isn&#8217;t a new thing, it&#8217;s been in production for a long time.</p>
<h3>Audit</h3>
<p>While the audit daemon isn&#8217;t strictly a part of SE Linux (each can be used without the other) it seems that most of the time they are used together (in Debian at least). I have prepared a NMU of the new upstream version of audit and uploaded it to delayed/7. I want to get everything related to SE Linux up to date or at least with comparable versions to Fedora. Also I sent some of the Debian patches for the auditd upstream which should reduce the maintenance effort in future.</p>
<h3>Libraries</h3>
<p>There have been some NMUs of libraries that are part of SE Linux. Due to a combination of having confidence in the people doing the NMUs and not having much spare time I have let them go through without review. I&#8217;m sure that I will notice soon enough if they don&#8217;t work, my test systems exercise enough SE Linux functionality that it would be difficult to break things without me noticing.</p>
<h3>Play Machine</h3>
<p>I am now preparing a new SE Linux &#8220;Play Machine&#8221; running Debian/Unstable. I wore my Play Machine shirt at LCA so I&#8217;ve got to get one going again soon. This is a good exercise of the strict features of SE Linux policy, I&#8217;ve found some bugs which need to be fixed. Running Play Machines really helps improve the overall quality of SE Linux.</p>
<ul>
<li>[1]<a href="http://etbe.coker.com.au/2011/10/31/selinux-status-2011-10/"> http://etbe.coker.com.au/2011/10/31/selinux-status-2011-10/</a></li>
</ul>
<p>Related posts:</p><ol>
<li><a href='http://etbe.coker.com.au/2009/01/20/status-se-linux-debian-lca2009/' rel='bookmark' title='Status of SE Linux in Debian LCA 2009'>Status of SE Linux in Debian LCA 2009</a> <small>This morning I gave a talk at the Security mini-conf...</small></li>
<li><a href='http://etbe.coker.com.au/2007/05/18/se-linux-in-debian/' rel='bookmark' title='SE Linux in Debian'>SE Linux in Debian</a> <small>I have now got a Debian Xen domU running the...</small></li>
<li><a href='http://etbe.coker.com.au/2008/03/28/debian-se-linux-status/' rel='bookmark' title='Debian SE Linux Status'>Debian SE Linux Status</a> <small>At the moment I&#8217;ve got more time to work on...</small></li>
</ol>]]></content:encoded>
			<wfw:commentRss>http://etbe.coker.com.au/2012/01/25/se-linux-status-2012-01/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>My Blog Server was Cracked</title>
		<link>http://etbe.coker.com.au/2011/12/31/server-cracked/</link>
		<comments>http://etbe.coker.com.au/2011/12/31/server-cracked/#comments</comments>
		<pubDate>Sat, 31 Dec 2011 00:01:06 +0000</pubDate>
		<dc:creator>etbe</dc:creator>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[Selinux]]></category>

		<guid isPermaLink="false">http://etbe.coker.com.au/?p=2987</guid>
		<description><![CDATA[On the 1st of August I noticed that the server which runs my blog among other things was having an occasional SEGV from a sshd process. Unfortunately I was busy and didn&#8217;t pay much attention to this, which turned out to be a big mistake. On the 12th of September I started investigating this properly [...]]]></description>
			<content:encoded><![CDATA[<p>On the 1st of August I noticed that the server which runs my blog among other things was having an occasional SEGV from a sshd process. Unfortunately I was busy and didn&#8217;t pay much attention to this, which turned out to be a big mistake.</p>
<p>On the 12th of September I started investigating this properly and noticed that when someone tried to connect to ssh with password authentication sshd would SEGV after it was denied access to a shared memory region or a semaphore which had a SE Linux type of unconfined_t. I added some SE Linux <b>auditallow</b> rules and discovered that the memory region in question was created by the ssh client. Shortly after that I came to the conclusion that this wasn&#8217;t some strange feature of ssh (or one of the many shared objects it uses) but hostile activity. The ssh client appeared to be storing passwords that it used in a shared memory region and sshd was also collecting passwords in the same region and presumably offering them to a ssh client which uses some extension to the ssh protocol.</p>
<p>The sshd process was crashing because it couldn&#8217;t handle EPERM on access to shared memory or semaphores. Presumably if the system in question wasn&#8217;t running SE Linux then the exploit would have remained undetected for a lot longer.</p>
<p>At this stage we don&#8217;t know how the attacker got in. Presumably one of the people with root access ran a ssh client on a compromised system and had their password sniffed. One such client system was mysteriously reinstalled at about that time, the sysadmin of the system in question claimed to have no backups which made it impossible to determine if that system had been compromised. I believe that the sysadmin of the client system knew that their system was compromised, kept that information secret, and allowed other systems to become and remain compromised.</p>
<p>The attacker made no good effort to conceal their presence, they replaced <b>ssh</b>, <b>sshd</b>, and <b>ssh-add</b> and didn&#8217;t bother changing the Debian checksums so the <b>debsums</b> program flagged the files as modified. Note that I have kept copies of the files in question and am willing to share them with anyone who wants to analyse them.</p>
<p><a href="http://be-geek.com/linux/2011/11/15/steinar-h-gunderson-ebury-a-new-ssh-trojan">Steinar H. Gunderson has named this trojan Ebury [1]</a>.</p>
<h3>Recovery</h3>
<p>By the evening of the 13th of September I had the system mostly working again. Jabber still isn&#8217;t working because ejabberd is difficult to get working at the best of times, I am now investigating whether there is a better Jabber server to use, but as I don&#8217;t use Jabber often this hasn&#8217;t been a priority for me.</p>
<p>Some of the WordPress plugins I use and all of the WordPress themes that are installed were outside the Debian packaging system, as I couldn&#8217;t be sure that they hadn&#8217;t been altered (because the people who wrote WordPress plugins don&#8217;t keep old versions online) I had to upgrade to the newer versions. Of course the newer versions weren&#8217;t entirely compatible so I had to use a different theme and I couldn&#8217;t get all plugins working. <a href="http://etbe.coker.com.au/2010/04/30/link-within/">Link Within no longer works, not that it ever worked properly [2]</a>, I wanted to try Outbrain again but their web site won&#8217;t let me login (and they haven&#8217;t responded to my support request). Does anyone know of a good WordPress plugin to provide links to related content? Either related content on my blog or on the Internet in general will be OK.</p>
<p>Some people have asked me about the change in appearance of my blog. It was simply impossible (for someone with my PHP skills) to get my blog looking the same way as it did before the server was cracked. I think that the new look is OK and don&#8217;t mind if people think it looks likw a VW advert &#8211; VW make great cars, I was very satisfied with the VW Passat I used to drive.</p>
<h3>Future Plans</h3>
<p>I had bought some <a href="http://www.yubico.com/">Yubikeys (USB devices that generate one-time passwords) [3]</a> to control access to that server, if I had configured the software to use them then this might not have happened. The use of one-time password devices can prevent passive password-sniffing attacks. It would still allow active attacks (such as using ControlPath/ControlMaster options on the ssh client to allow a hostile party to connect later (EG the <b>-M</b>, <b>-S</b>, and &#8220;<b>-o ControlPersist</b>&#8221; options for the ssh client). It&#8217;s a pity that there doesn&#8217;t seem to be a way to configure the ssh server to disable ControlMaster.</p>
<h3>Conclusion</h3>
<p>It would be good to have some changes to sshd to allow more restrictions on what a client can request, as ControlMaster functionality isn&#8217;t needed by most users it should be possible to disable it.</p>
<p>SE Linux doesn&#8217;t protect against a compromised client system or any other way of stealing passwords. It did do a good job of stopping Ebury from doing all the things it wanted to do and thus making me aware of the problem. So I count this as a win for SE Linux.</p>
<p>Yubikeys are the cheapest and easiest way of managine one-time passwords. I had already bought some for use on the system in question but hadn&#8217;t got around to configuring them. I have to make that a priority.</p>
<ul>
<li>[1]<a href="http://be-geek.com/linux/2011/11/15/steinar-h-gunderson-ebury-a-new-ssh-trojan"> http://be-geek.com/linux/2011/11/15/steinar-h-gunderson-ebury-a-new-ssh-trojan</a></li>
<li>[2]<a href="http://etbe.coker.com.au/2010/04/30/link-within/"> http://etbe.coker.com.au/2010/04/30/link-within/</a></li>
<li>[3]<a href="http://www.yubico.com/"> http://www.yubico.com/</a></li>
</ul>
<p>Related posts:</p><ol>
<li><a href='http://etbe.coker.com.au/2009/04/27/email-passwords/' rel='bookmark' title='Email Passwords'>Email Passwords</a> <small>I was doing some routine sysadmin work for a client...</small></li>
<li><a href='http://etbe.coker.com.au/2009/03/06/case-sensitivity-published-passwords/' rel='bookmark' title='Case Sensitivity and Published Passwords'>Case Sensitivity and Published Passwords</a> <small>When I first started running a SE Linux Play Machine...</small></li>
<li><a href='http://etbe.coker.com.au/2006/09/10/whats-a-good-blog-server-for-serious-blogging/' rel='bookmark' title='what&#8217;s a good blog server for serious blogging?'>what&#8217;s a good blog server for serious blogging?</a> <small>I&#8217;m getting sick of blogger. The main thing is that...</small></li>
</ol>]]></content:encoded>
			<wfw:commentRss>http://etbe.coker.com.au/2011/12/31/server-cracked/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Secure Boot and Protecting Against Root</title>
		<link>http://etbe.coker.com.au/2011/12/28/secure-boot-protecting-against-root/</link>
		<comments>http://etbe.coker.com.au/2011/12/28/secure-boot-protecting-against-root/#comments</comments>
		<pubDate>Wed, 28 Dec 2011 04:16:22 +0000</pubDate>
		<dc:creator>etbe</dc:creator>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[Selinux]]></category>

		<guid isPermaLink="false">http://etbe.coker.com.au/?p=3084</guid>
		<description><![CDATA[There has been a lot of discussion recently about the recent Microsoft ideas regarding secure boot, in case you have missed it Michael Casadevall has written a good summary of the issue [1]. Recently I&#8217;ve seen a couple of people advocate the concept of secure boot with the stated idea that &#8220;root&#8221; should be unable [...]]]></description>
			<content:encoded><![CDATA[<p>There has been a lot of discussion recently about the recent Microsoft ideas regarding secure boot, in case you have missed it <a href="http://ncommander.blogspot.com/2011/11/secure-boot-its-here-and-been-here-for.html">Michael Casadevall has written a good summary of the issue [1]</a>.</p>
<p>Recently I&#8217;ve seen a couple of people advocate the concept of secure boot with the stated idea that &#8220;root&#8221; should be unable to damage the system, as Microsoft Software is something that doesn&#8217;t matter to me I&#8217;ll restrict my comments to how this might work on Linux.</p>
<p>Restricting the &#8220;root&#8221; account is something that is technically possible, for much of the past 9 years I have been running <a href="http://www.coker.com.au/selinux/play.html">SE Linux &#8220;Play Machines&#8221; which have UID 0 (root) restricted by SE Linux such that they can&#8217;t damage the system [2]</a> &#8211; there are other ways of achieving similar goals. But having an account with UID 0 that can&#8217;t change anything on the system doesn&#8217;t really match what most people think of as &#8220;root&#8221;, I just do it as a way of demonstrating that SE Linux controls all access such that cracking a daemon which runs as root won&#8217;t result in immediately controlling the entire system.</p>
<p>As an aside my Play Machine is not online at the moment, I hope to have it running again soon.</p>
<h3>Root Can&#8217;t Damage the System</h3>
<p>One specific claim was that &#8220;root&#8221; should be unable to damage the system. While a secure boot system can theoretically result in a boot to single user mode without any compromise that doesn&#8217;t apply to fully operational systems. For a file owned by root to be replaced the system security has to be compromised in some way. The same compromise will usually work every time until the bug is fixed and the software is upgraded. So the process of cracking root that might be used to install hostile files can also be used at runtime to exploit running processes via ptrace and do other bad stuff.</p>
<p>Even if the attacker is forced to compromise the system at every boot this isn&#8217;t a great win for the case of servers with months of uptime or for the case of workstations that have confidential data that can be rapidly copied over the Internet. There are also many workstations that are live on the Internet for months nowadays.</p>
<p>Also the general claim doesn&#8217;t really make sense on it&#8217;s own. &#8220;root&#8221; usually means the account that is used for configuring the system. If a system can be configured then the account which is used to configure it will be able to do unwanted things. It is theoretically possible to run workstations without external root access (EG have them automatically update to the latest security fixes). Such a workstation configuration MIGHT be able to survive a compromise by having a reboot trigger an automatic update. But a workstation that is used in such a manner could be just re-imaged as it would probably be used in an environment where data-less operation makes sense.</p>
<p>An Android phone could be considered as an example of a Linux system for which the &#8220;root&#8221; user can&#8217;t damage the system if you consider &#8220;root&#8221; to mean &#8220;person accessing the GUI configuration system&#8221;. But then it wouldn&#8217;t be difficult to create a configuration program for a regular Linux system that allows the user to change some parts of the system configuration while making others unavailable. Besides there are many ways in which the Android configuration GUI permits the user to make the system mostly unusable (EG by disabling data access) or extremely expensive to operate (EG by forcing data roaming). So I don&#8217;t think that Android is a good example of &#8220;root&#8221; being prevented from doing damage.</p>
<h3>Signing All Files</h3>
<p>Another idea that I saw advocated was to have the &#8220;secure boot&#8221; concept extended to all files. So you have a boot loader that loads a signed kernel which then loads only signed executables and then every interpreter (Perl, Python, etc) will also check for signatures on files that they run. This would be tricky with interpreters that are designed to run from standard input (most notably /bin/sh but also many other interpreters).</p>
<p>Doing this would require changing many programs, I guess you would even have to change mount to check the signature on /etc/fstab etc. This would be an unreasonably large amount of work.</p>
<p>Another possibility would be to change the kernel such that it checks file signatures and has restrictions on system calls such as open() and the exec() family of calls. In concept it would be possible to extend SE Linux or any other access control system to include access checks on which files need to be signed (some types such as etc_t and bin_t would need to be signed but others such as var_t wouldn&#8217;t).</p>
<p>Of course this would mean that no sysadmin work could be performed locally as all file changes would have to come from the signing system. I can imagine all sorts of theoretically interesting but practically useless ways of implementing this such as having the signing system disconnected from the Internet with USB flash devices used for one-way file transfer &#8211; because you can&#8217;t have the signing system available to the same attacks as the host system.</p>
<p>The requirement to sign all files would reduce the use of such a system to a tiny fraction of the user-base. Which would then raise the question of why anyone would spend the effort on that task when there are so many other ways of improving security that involve less work and can be used by more people.</p>
<h3>Encrypted Root Filesystem</h3>
<p>One real benefit of a secure boot system is for systems using encrypted filesystems. It would be good to know that a hostile party hasn&#8217;t replaced the kernel and initrd when you are asked for the password to unlock the root filesystem. This would be good for the case where a laptop is left in a hotel room or other place where a hostile party could access it.</p>
<p>Another way of addressing the same problem is to boot from a USB device so that you can keep a small USB boot device with you when it&#8217;s inconvenient to carry a large laptop (which works for me). Of course it&#8217;s theoretically possible for the system BIOS to be replaced with something that trojans the boot process (EG runs the kernel in a virtual machine). But I expect that if someone who is capable of doing that gets access to my laptop then I&#8217;m going to lose anyway.</p>
<h3>Conclusion</h3>
<p>The secure boot concept does seem to have some useful potential when the aim is to reboot the system and have it automatically apply security fixes in the early stages of the boot process. This could be used for Netbooks and phones. Of course such a process would have to reset some configuration settings to safe defaults, this means replacing files in /etc and some configuration files in the user&#8217;s home directory. So such a reboot and upgrade procedure would either leave the possibility that files in /etc were still compromised or it would remove some configuration work and thus give the user an incentive to avoid applying the patch.</p>
<p>Any system that tries to extend signature checks all the way would either be vulnerable to valid but hostile changes to system configuration (such as authenticating to a server run by a hostile party) or have extreme ease of use issues due to signing everything.</p>
<p>Also a secure boot will only protect a vulnerable system between the time it is rebooted and the time it returns to full operation after the reboot. If the security flaw hasn&#8217;t been fixed (which could be due to a 0-day exploit or an exploit for which the patch hasn&#8217;t been applied) then the system could be cracked again.</p>
<p>I don&#8217;t think that a secure boot process offers real benefits to many users.</p>
<ul>
<li>[1]<a href="http://ncommander.blogspot.com/2011/11/secure-boot-its-here-and-been-here-for.html"> http://ncommander.blogspot.com/2011/11/secure-boot-its-here-and-been-here-for.html</a></li>
<li>[2]<a href="http://www.coker.com.au/selinux/play.html"> http://www.coker.com.au/selinux/play.html</a></li>
</ul>
<p>Related posts:</p><ol>
<li><a href='http://etbe.coker.com.au/2009/03/16/question-about-a-secure-filesystem/' rel='bookmark' title='Question about a &#8220;Secure Filesystem&#8221;'>Question about a &#8220;Secure Filesystem&#8221;</a> <small>I have just been asked for advice about &#8220;secure filesystem&#8221;...</small></li>
<li><a href='http://etbe.coker.com.au/2007/10/10/how-se-linux-prevents-local-root-exploits/' rel='bookmark' title='How SE Linux Prevents Local Root Exploits'>How SE Linux Prevents Local Root Exploits</a> <small>In a comment on my previous post about SE Linux...</small></li>
<li><a href='http://etbe.coker.com.au/2010/05/29/logging-in-as-root/' rel='bookmark' title='Logging in as Root'>Logging in as Root</a> <small>Martin Meredith wrote a blog post about logging in as...</small></li>
</ol>]]></content:encoded>
			<wfw:commentRss>http://etbe.coker.com.au/2011/12/28/secure-boot-protecting-against-root/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>SE Linux Status in Debian 2011-10</title>
		<link>http://etbe.coker.com.au/2011/10/31/selinux-status-2011-10/</link>
		<comments>http://etbe.coker.com.au/2011/10/31/selinux-status-2011-10/#comments</comments>
		<pubDate>Mon, 31 Oct 2011 12:22:43 +0000</pubDate>
		<dc:creator>etbe</dc:creator>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[Selinux]]></category>

		<guid isPermaLink="false">http://etbe.coker.com.au/?p=3038</guid>
		<description><![CDATA[Debian/Unstable Development deb http://www.coker.com.au wheezy selinux The above APT sources.list line has my repository for SE Linux packages that have been uploaded to Unstable and which will eventually go to testing and then the Wheezy release (if they aren&#8217;t obsoleted first). I have created that repository for people who want to track SE Linux development [...]]]></description>
			<content:encoded><![CDATA[<h3>Debian/Unstable Development</h3>
<p><b>deb http://www.coker.com.au wheezy selinux</b></p>
<p>The above APT sources.list line has my repository for SE Linux packages that have been uploaded to Unstable and which will eventually go to testing and then the Wheezy release (if they aren&#8217;t obsoleted first). I have created that repository for people who want to track SE Linux development without waiting for an Unstable mirror to update.</p>
<p>In that repository I&#8217;ve included a new version of <b>policycoreutils</b> that now includes <b>mcstrans</b> and also has support for newer policy such that the latest <b>selinux-policy-default</b> package can be installed. The version that is currently in Testing supports upgrading policy on a running system but doesn&#8217;t support installing the policy on a system that previously didn&#8217;t run SE Linux.</p>
<p>I have also uploaded SE Linux Policy packages from upstream release 20110726 compared to the previous packages which were from upstream release 20100524. As the numbers imply there is 14 months of upstream policy development which changes many things. Many of the patches from my Squeeze policy packages are not yet incorporated in the policy I have uploaded to Unstable. I won&#8217;t guarantee that an Unstable system in Enforcing mode will do anything other than boot up and allow you to login via ssh. It&#8217;s definitely not ready for production but it&#8217;s also very suitable for development (10 years ago I did a lot of development on SE Linux systems that often denied login access, it wasn&#8217;t fun).</p>
<p>Kyle Moffett submitted a patch for libselinux which dramatically changed the build process. As Manoj (who wrote the previous build scripts) was not contactable I accepted Kyle&#8217;s patch as provided. Thanks for the patch Kyle, and thanks for all your work over the years Manoj. Anyway the result of these changes should mean that it&#8217;s easier to bootstrap Debian on a new architecture and easier to support multi-arch &#8211; but I haven&#8217;t tested either of these.</p>
<h3>Squeeze</h3>
<p>The policy packages from Squeeze can&#8217;t be compiled on Unstable. The newer policy compilation tool chain is more strict about how some things can be declared and used, thus some policy which was fairly dubious but usable is now invalid. While it wouldn&#8217;t be difficult to fix those problems I don&#8217;t plan to do so. There is no good reason for compiling Squeeze policy on Unstable now that I&#8217;ve uploaded a new upstream release.</p>
<h3>deb http://www.coker.com.au squeeze selinux</h3>
<p>I am still developing Squeeze policy and releasing it in the above APT repository. I will also get another policy release in a Squeeze update if possible to smooth the transition to Wheezy &#8211; the goal is that Squeeze policy will be usable on Wheezy even if it can&#8217;t be compiled. Also note that the compilation failures only affect the Debian package, it should still be possible to make modules for local use on a Wheezy system with Squeeze policy.</p>
<h3>MLS</h3>
<p>On Wednesday I&#8217;m giving a lecture at my local LUG about <a href="http://en.wikipedia.org/wiki/Multilevel_security">MLS</a> on SE Linux. I hope to have a MLS demonstration system available to LUG members by then. Ideally I will have a MLS system running on a virtual server somewhere that&#8217;s accessible as well as a Xen/KVM image on a USB stick that can be copied by anyone at the meeting.</p>
<p>I don&#8217;t expect to spend much time on any aspect of SE Linux unrelated to MLS for the rest of the week.</p>
<h3>Version Control</h3>
<p>I need to change the way that I develop SE Linux packages, particularly the <b>refpolicy</b> source package (source of <b>selinux-policy-default</b> among others). A 20,000 line single patch is difficult to work with! I will have to switch to using <b>quilt</b>, once I get it working well it should save me time on my own development as well as making it easier to send patches upstream. Also I need to setup a public version control system so I can access the source from my workstation, laptop, and netbook. While doing that I might as well make it public so any interested people can help out. Suggestions on what type of VCS to use are welcome.</p>
<h3>How You Can Help</h3>
<p>Sorting out the mess that is the <b>refpolicy</b> package, sending patches upstream and migrating to a VCS is a fair bit of work. But there are lots of small parts. Sending patches upstream is a job that could be done in small pieces.</p>
<p>Writing new policy is not something to do yet. There&#8217;s not much point in doing that while I still haven&#8217;t merged all the patches from Squeeze &#8211; maybe next week. However I can provide the missing patches to anyone who wants to review them and assist with the merging.</p>
<p>I have a virtual server that has some spare capacity. One thing I would like to do is to have some virtual machines running Unstable with various configurations of server software. Then we could track Unstable on those images and use automated testing to ensure that nothing breaks. If anyone wants root access on a virtual server to install their favorite software then let me know. But such software needs to be maintained and tested!</p>
<p>Related posts:</p><ol>
<li><a href='http://etbe.coker.com.au/2009/11/17/debian-ssh-se-linux/' rel='bookmark' title='Debian SSH and SE Linux'>Debian SSH and SE Linux</a> <small>I have just filed Debian bug report #556644 against the...</small></li>
<li><a href='http://etbe.coker.com.au/2011/07/22/run-se-linux-policy/' rel='bookmark' title='/run and SE Linux Policy'>/run and SE Linux Policy</a> <small>Currently Debian/Unstable is going through a transition to using /run...</small></li>
<li><a href='http://etbe.coker.com.au/2010/07/25/se-linux-status-squeeze/' rel='bookmark' title='SE Linux status in Debian/Squeeze'>SE Linux status in Debian/Squeeze</a> <small>ffmpeg I&#8217;ve updated my SE Linux repository for Squeeze to...</small></li>
</ol>]]></content:encoded>
			<wfw:commentRss>http://etbe.coker.com.au/2011/10/31/selinux-status-2011-10/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Capabilities vs SE Linux</title>
		<link>http://etbe.coker.com.au/2011/10/28/capabilities-vs-se-linux/</link>
		<comments>http://etbe.coker.com.au/2011/10/28/capabilities-vs-se-linux/#comments</comments>
		<pubDate>Fri, 28 Oct 2011 02:47:57 +0000</pubDate>
		<dc:creator>etbe</dc:creator>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[Selinux]]></category>

		<guid isPermaLink="false">http://etbe.coker.com.au/?p=2994</guid>
		<description><![CDATA[In December 2010 a paper was published by Robert N.M. Watson and Jonathan Anderson from the Cambridge University and Ben Laurie and Kris Kennaway of Google about the Capsicum capabilities system [1]. It seems that the aim of the project is to allow systems that need privileges briefly when they start (such as tcpdump) a [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.cl.cam.ac.uk/research/security/capsicum/papers/2010usenix-login-capsicum.pdf">In December 2010 a paper was published by Robert N.M. Watson and Jonathan Anderson from the Cambridge University and Ben Laurie and Kris Kennaway of Google about the Capsicum capabilities system [1]</a>. It seems that the aim of the project is to allow systems that need privileges briefly when they start (such as tcpdump) a safe method of dropping privs. <a href="http://www.cl.cam.ac.uk/research/security/capsicum/">The main project page is here [2]</a>.</p>
<p>The focus of the paper is on the Chromium web browser and six different ways of constraining the Chromium sandbox are compared. For the SE Linux comparison they claim 200 lines of code changes as of Fedora 15, in Fedora 16 I couldn&#8217;t find a Chromium package, so I presume that they mean 200 lines of SE Linux policy (I am not aware of anyone modifying the Chromium source for SE Linux). They note that SE Linux doesn&#8217;t support separating different sandboxes, while it would be possible to have each sandbox be assigned a different MCS sensitivity label to separate them that option would be unwieldy enough that they are essentially correct in this regard. For SE Linux systems running the MLS policy the correct thing to do would be to run multiple copies of Chromium at different levels to access different sensitivity levels of data, this would normally be done by polyinstantiating the home directory.</p>
<p>One thing to note however is that there is no requirement that only one security method be implemented. I can&#8217;t think of any technical reason why it would be impossible to run SE Linux and Capsicum on the same system. SE Linux could constrain daemons and restrict the access to Capsicum services while Capsicum could be used to give minimum privileges to parts of Chromium. I&#8217;m not sure that such a combination would offer anything that the MLS users would desire, but it seems that everyone else (the vast majority of computer users) would be served well by a combination of SE Linux and Capsicum.</p>
<p>It&#8217;s disappointing that the paper didn&#8217;t mention Posix 1003.1e capabilities, but given the lack of use that Posix capabilities get that&#8217;s understandable.</p>
<p>It&#8217;s also disappointing when someone develops something new and different nowadays and doesn&#8217;t provide a virtual machine image for it. Installing and configuring something that requires application and kernel changes is a lot of work and most people who are idly curious about the technology won&#8217;t go to the effort. By today&#8217;s standards it&#8217;s not that difficult to share a 1GB filesystem image via Bittorrent.</p>
<ul>
<li>[1]<a href="http://www.cl.cam.ac.uk/research/security/capsicum/papers/2010usenix-login-capsicum.pdf"> http://www.cl.cam.ac.uk/research/security/capsicum/papers/2010usenix-login-capsicum.pdf</a></li>
<li>[2]<a href="http://www.cl.cam.ac.uk/research/security/capsicum/"> http://www.cl.cam.ac.uk/research/security/capsicum/</a></li>
</ul>
<p>Related posts:</p><ol>
<li><a href='http://etbe.coker.com.au/2007/08/22/se-linux-vs-chroot/' rel='bookmark' title='SE Linux vs chroot'>SE Linux vs chroot</a> <small>A question that is often asked is whether to use...</small></li>
<li><a href='http://etbe.coker.com.au/2010/07/26/se-linux-chroot-environment/' rel='bookmark' title='Creating a SE Linux Chroot environment'>Creating a SE Linux Chroot environment</a> <small>Why use a Chroot environment? A large part of the...</small></li>
<li><a href='http://etbe.coker.com.au/2007/09/23/context-of-devxvc0/' rel='bookmark' title='Context of /dev/xvc0'>Context of /dev/xvc0</a> <small>I have just converted a Fedora Core 5 server to...</small></li>
</ol>]]></content:encoded>
			<wfw:commentRss>http://etbe.coker.com.au/2011/10/28/capabilities-vs-se-linux/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>SE Linux File Context Precedence</title>
		<link>http://etbe.coker.com.au/2011/07/24/se-linux-file-context-precedence/</link>
		<comments>http://etbe.coker.com.au/2011/07/24/se-linux-file-context-precedence/#comments</comments>
		<pubDate>Sun, 24 Jul 2011 05:54:20 +0000</pubDate>
		<dc:creator>etbe</dc:creator>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[Selinux]]></category>

		<guid isPermaLink="false">http://etbe.coker.com.au/?p=2916</guid>
		<description><![CDATA[In my previous post I expressed a desire to use regular expressions for files that may appear in multiple places in the tree due to bind mounts for /run and /var/run etc [1]. However there is a problem with this idea. The SE Linux file labeling program restorecon reads the file /etc/selinux/$SELINUXTYPE/contexts/files/file_contexts which contains a [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://etbe.coker.com.au/2011/07/22/run-se-linux-policy/">In my previous post I expressed a desire to use regular expressions for files that may appear in multiple places in the tree due to bind mounts for /run and /var/run etc [1]</a>. However there is a problem with this idea.</p>
<p>The SE Linux file labeling program <b>restorecon</b> reads the file <b>/etc/selinux/$SELINUXTYPE/contexts/files/file_contexts</b> which contains a set of regular expressions to assign labels to files. That file is ordered and the last entry which matches is the one that counts. When the file_contexts file is created the order is based on how many characters at the start of the file specification aren&#8217;t regular expression meta-characters. For example the entry &#8220;/.*&#8221; is at the top of the file (and therefore has the lowest precedence), which makes it the catch-all entry for files that have no other match. So an entry for &#8220;/var/run/REGEX&#8221; will have a higher precedence than one for &#8220;/var/REGEX&#8221;, this means however that when I replaced the &#8220;/var/run&#8221; part with a regular expression then it had a lower precedence and it didn&#8217;t work properly.</p>
<p>I should have remembered this as I did a lot of work on setfiles (which became restorecon) in the early days. I have now developed a new way of solving this and this time I&#8217;m testing it before blogging about it.</p>
<p>I have written the following PERL program to fix the file contexts, this adds multiple lines and uses a <b>distro_debian</b> conditional on them so that they don&#8217;t slip into upstream use &#8211; and so that if I lose track of where each patch came from I&#8217;ll know that I can delete them in future because it only matters to Debian.</p>
<p>#!/usr/bin/perl<br />
use warnings;<br />
use strict;</p>
<p>open(LIST, &#34;find . -name \&#34;*.fc\&#34;|xargs egrep \&#34;^/(var.*run)|(var/lock)|(dev/shm)\&#34;|cut -f1 -d:|uniq|&#34;) or die &#34;Can&#39;t get file list\n&#34;;<br />
while(&lt;LIST&gt;)<br />
{<br />
&nbsp; my $filename = $_;<br />
&nbsp; chomp $filename;<br />
&nbsp; open(my $infile, &#34;&lt;&#34;, $filename) or die &#34;Can&#39;t open file $filename&#34;;<br />
&nbsp; open(my $outfile, &#34;&gt;&#34;, $filename . &#34;.new&#34;) or die &#34;Can&#39;t open file &#34;. $filename . &#34;.new&#34;;<br />
&nbsp; while(&lt;$infile&gt;)<br />
&nbsp; {<br />
&nbsp; &nbsp; print $outfile $_;<br />
&nbsp; &nbsp; my $newline;<br />
&nbsp; &nbsp; if($_ =~ /^\/var\/run/)<br />
&nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; print $outfile &#34;ifdef(&#96;distro_debian&#39;, &#96;\n&#34;;<br />
&nbsp; &nbsp; &nbsp; $newline = $_;<br />
&nbsp; &nbsp; &nbsp; $newline =~ s/^\/var//;<br />
&nbsp; &nbsp; &nbsp; print $outfile $newline;<br />
&nbsp; &nbsp; &nbsp; print $outfile &#34;&#39;)\n&#34;;<br />
&nbsp; &nbsp; }<br />
&nbsp; &nbsp; if($_ =~ /^\/var\/lock/)<br />
&nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; print $outfile &#34;ifdef(&#96;distro_debian&#39;, &#96;\n&#34;;<br />
&nbsp; &nbsp; &nbsp; $newline = $_;<br />
&nbsp; &nbsp; &nbsp; $newline =~ s/^\/var/\/var\/run/;<br />
&nbsp; &nbsp; &nbsp; print $outfile $newline;<br />
&nbsp; &nbsp; &nbsp; $newline =~ s/^\/var//;<br />
&nbsp; &nbsp; &nbsp; print $outfile $newline;<br />
&nbsp; &nbsp; &nbsp; print $outfile &#34;&#39;)\n&#34;;<br />
&nbsp; &nbsp; }<br />
&nbsp; &nbsp; if($_ =~ /^\/dev\/shm/)<br />
&nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; print $outfile &#34;ifdef(&#96;distro_debian&#39;, &#96;\n&#34;;<br />
&nbsp; &nbsp; &nbsp; $newline = $_;<br />
&nbsp; &nbsp; &nbsp; $newline =~ s/^\/dev/\/run/;<br />
&nbsp; &nbsp; &nbsp; print $outfile $newline;<br />
&nbsp; &nbsp; &nbsp; print $outfile &#34;/var&#34; . $newline;<br />
&nbsp; &nbsp; &nbsp; print $outfile &#34;&#39;)\n&#34;;<br />
&nbsp; &nbsp; }<br />
&nbsp; }<br />
&nbsp; close($infile);<br />
&nbsp; close($outfile);<br />
&nbsp; rename $filename . &#34;.new&#34;, $filename or die &#34;Can&#39;t rename &#34; . $filename . &#34;.new to &#34; . $filename;<br />
}</p>
<p>The next policy thing that I have to work on is systemd. From a quick test it seems that systemd policy changes will be more invasive than is suitable for Squeeze. This means that someone who wants to upgrade from Squeeze to Wheezy+systemd will have to upgrade to Wheeze policy before installing systemd. I think that I will make 0.2.20100524-10 the last version in Unstable based on the 2010 release, I will now start work on packaging the latest upstream policy for Unstable.</p>
<p>PS I&#8217;m not much of a PERL programmer, so if anyone has suggestions for how to improve the above PERL code then please let me know. Please note however that I&#8217;m not interested in making my code look like line-noise.</p>
<ul>
<li>[1]<a href="http://etbe.coker.com.au/2011/07/22/run-se-linux-policy/"> http://etbe.coker.com.au/2011/07/22/run-se-linux-policy/</a></li>
</ul>
<p>Related posts:</p><ol>
<li><a href='http://etbe.coker.com.au/2007/03/15/se-linux-on/' rel='bookmark' title='SE Linux on /.'>SE Linux on /.</a> <small>The book SE Linux by Example has been reviewed on...</small></li>
<li><a href='http://etbe.coker.com.au/2011/07/22/run-se-linux-policy/' rel='bookmark' title='/run and SE Linux Policy'>/run and SE Linux Policy</a> <small>Currently Debian/Unstable is going through a transition to using /run...</small></li>
<li><a href='http://etbe.coker.com.au/2007/09/23/context-of-devxvc0/' rel='bookmark' title='Context of /dev/xvc0'>Context of /dev/xvc0</a> <small>I have just converted a Fedora Core 5 server to...</small></li>
</ol>]]></content:encoded>
			<wfw:commentRss>http://etbe.coker.com.au/2011/07/24/se-linux-file-context-precedence/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

