<?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>Brindle on Security &#187; Security</title>
	<atom:link href="http://securityblog.org/brindle/category/security/feed/" rel="self" type="application/rss+xml" />
	<link>http://securityblog.org/brindle</link>
	<description>The ramblings of security neophyte Joshua Brindle</description>
	<lastBuildDate>Sat, 24 Oct 2009 19:58:16 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>The SELinux Documentation Project</title>
		<link>http://securityblog.org/brindle/2009/10/24/the-selinux-documentation-project/</link>
		<comments>http://securityblog.org/brindle/2009/10/24/the-selinux-documentation-project/#comments</comments>
		<pubDate>Sat, 24 Oct 2009 19:58:16 +0000</pubDate>
		<dc:creator>Joshua Brindle</dc:creator>
				<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://securityblog.org/brindle/?p=55</guid>
		<description><![CDATA[One of the biggest complaints people have about SELinux is the lack of documentation. Indeed we had a nice group discussion with some users at Linux Plumbers Conference who once again brought this to our attention.
The reason is simple. Most of us working on SELinux are developers. We don&#8217;t like writing documentation. We&#8217;d rather write [...]]]></description>
			<content:encoded><![CDATA[<p>One of the biggest complaints people have about SELinux is the lack of documentation. Indeed we had a nice group discussion with some users at Linux Plumbers Conference who once again brought this to our attention.</p>
<p>The reason is simple. Most of us working on SELinux are developers. We don&#8217;t like writing documentation. We&#8217;d rather write blog entries explaining some aspect of SELinux instead of real documents. While this works when your primary audience are knowledgeable enough to find the blog entries, figure out how to apply the concepts to their problems and connect all the dots between here and there it isn&#8217;t useful for new users or users trying to solve a simple problem.</p>
<p>It is unfortunate, and some people over the years have helped us out, such as with the <a title="Fedora SELinux User Guide" href="http://docs.fedoraproject.org/selinux-user-guide/f10/en-US/" target="_blank">Fedora SELinux User Guide</a>, but unfortunately we&#8217;ve missed some users, particularly new ones, and we haven&#8217;t aggregated these documents onto a distribution agnostic place with good organization.</p>
<p>With that in mind I volunteered to start the SELinux Documentation Project during LPC. Basically the goal is to make user-problem focused documentation available at the official <a title="selinux project site" href="http://selinuxproject.org" target="_blank">SELinux project site</a>. This will be a huge effort, writing original documentation, organizing it into consumable chunks and mining years of mail list posts, blog entries and other resources to deliver documents to users.</p>
<p>I&#8217;ve already started putting up several pieces. One of the things I want to really focus on are SELinux &#8216;recipes&#8217;, short, to-the-point blurbs telling users how to do the things they want to do, like<a href="http://selinuxproject.org/page/ApacheRecipes#Allow_Apache_to_connect_to_your_database_server" target="_blank"> allowing apache to connect to their database server</a>, or  how to <a title="Adding a rule with audit2allow" href="http://selinuxproject.org/page/Audit2allowRecipe" target="_blank">easily add a rule to their policy</a>.</p>
<p>We also need a place where potential developers can go to <a title="developer resources" href="http://selinuxproject.org/page/Developers" target="_blank">easily get resources on developing SELinux</a> so that our community can expand. Further a place where vendors can go to learn about what SELinux can do for their solution and how to get started using SELinux is a must.</p>
<p>All that said, I can&#8217;t do this alone. I&#8217;ve started several pages and will continue doing so but if you are one of those strange souls with a propensity to document things, or you have recently gone through the pains of finding info in obscure places that you couldn&#8217;t find elsewhere we could really use your help in expanding, organizing and centralizing documentation on <a title="selinuxproject" href="http://selinuxproject.org" target="_blank">selinuxproject.org</a>. If you want to help you can email me at method at manicmethod.com or James Morris at jmorris at namei.org to get an account and start contributing.</p>
]]></content:encoded>
			<wfw:commentRss>http://securityblog.org/brindle/2009/10/24/the-selinux-documentation-project/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SELinux and RPM</title>
		<link>http://securityblog.org/brindle/2009/10/24/selinux-and-rpm/</link>
		<comments>http://securityblog.org/brindle/2009/10/24/selinux-and-rpm/#comments</comments>
		<pubDate>Sat, 24 Oct 2009 19:39:12 +0000</pubDate>
		<dc:creator>Joshua Brindle</dc:creator>
				<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://securityblog.org/brindle/?p=51</guid>
		<description><![CDATA[Wow, I just noticed it&#8217;s been a year since I&#8217;ve blogged, that is not good.
That doesn&#8217;t mean nothing has been going on though, we&#8217;ve been quite busy around here.
First I&#8217;d like to talk about a couple projects we are working on. The first is better integration of SELinux policies into RPM. We&#8217;ve posted a patch [...]]]></description>
			<content:encoded><![CDATA[<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">Wow, I just noticed it&#8217;s been a year since I&#8217;ve blogged, that is not good.</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">That doesn&#8217;t mean nothing has been going on though, we&#8217;ve been quite busy around here.</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">First I&#8217;d like to talk about a couple projects we are working on. The first is better integration of SELinux policies into RPM. We&#8217;ve posted a patch set to the rpm-maint [1] mailing list and are awaiting feedback. To try out the patches yourself you can read the instructions on the project page at selinuxproject.org [2].</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">The current patch set basically makes RPM actually do stuff with the %policy tag, which it never did before. We&#8217;ve also changed the %policy tag to be more flexible in allowing more information about the policies to be handled by RPM, such as policy modules that are being obsoleted. You can read the full description of the patches on the mail list postings [3].</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">This is only the first step in a long term project we have to make RPM more robust and reduce the amount of trust necessary in the package manager. We have several ideas of how to proceed but we haven&#8217;t proven that they&#8217;ll work yet (or that the RPM community will be interested in them). Suffice to say we basically want to break RPM into smaller pieces, each of which has a dedicated job to do, which can be confined by SELinux. Each step would require less trust that the packages aren&#8217;t malicious and that the SELinux policy is correct and will enforce the security goals set forth by the packager. Once this is done we want to try running core parts of RPM in different security domains depending on different attributes about the package and who is running it, such as what certificates were used to sign the package, where the package came from, who is running RPM and so on.</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">The culmination of this effort would be to be able to download a 3rd party package and install it knowing that it will only be able to add its files to /opt, and not modify anything in /usr, /lib, /etc, etc. Further the scriptlets should be confined so that they can&#8217;t add users to the system or any other security critical activities. This will be a truly exciting capability for Linux systems moving forward.</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">I delivered a presentation on this project at Linux Plumbers Conference last month in Portland. The slides [4] and video recording [5] are published on the web for those who are interested.</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">I&#8217;ll talk about another project we are working on in my next blog post, which should be coming pretty soon.</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">[1] https://lists.rpm.org/mailman/listinfo/rpm-maint</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">[2] http://selinuxproject.org/page/RPM</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">[3] http://lists.rpm.org/pipermail/rpm-maint/2009-October/002561.html</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">[4] http://linuxplumbersconf.org/2009/slides/brindle-selinux-distribution-lpc-slides.pdf</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">[5] http://video.linuxfoundation.org/video/1569</div>
<p>Wow, I just noticed it&#8217;s been a year since I&#8217;ve blogged, that is not good.</p>
<p>That doesn&#8217;t mean nothing has been going on though, we&#8217;ve been quite busy around here.</p>
<p>I&#8217;d like to talk about a couple projects we are working on. The first is better integration of SELinux policies into RPM. We&#8217;ve posted a patch set to the <a title="rpm-maint mailing list" href="https://lists.rpm.org/mailman/listinfo/rpm-maint" target="_blank">rpm-maint</a> mailing list and are awaiting feedback. To try out the patches yourself you can read the instructions on the <a title="RPM Project page" href="http://selinuxproject.org/page/RPM" target="_blank">project page at selinuxproject.org</a>.</p>
<p>The current patch set basically makes RPM actually do stuff with the %policy tag, which it never did before. We&#8217;ve also changed the %policy tag to be more flexible in allowing more information about the policies to be handled by RPM, such as policy modules that are being obsoleted. You can read the full description of the patches on the<a href="http://lists.rpm.org/pipermail/rpm-maint/2009-October/002561.html" target="_blank"> mail list postings</a>.</p>
<p>This is only the first step in a long term project we have to make RPM more robust and reduce the amount of trust necessary in the package manager. We have several ideas of how to proceed but we haven&#8217;t proven that they&#8217;ll work yet (or that the RPM community will be interested in them). Suffice to say we basically want to break RPM into smaller pieces, each of which has a dedicated job to do, which can be confined by SELinux. Each step would require less trust that the packages aren&#8217;t malicious and that the SELinux policy is correct and will enforce the security goals set forth by the packager. Once this is done we want to try running core parts of RPM in different security domains depending on different attributes about the package and who is running it, such as what certificates were used to sign the package, where the package came from, who is running RPM and so on.</p>
<p>The culmination of this effort would be to be able to download a 3rd party package and install it knowing that it will only be able to add its files to /opt, and not modify anything in /usr, /lib, /etc, etc. Further the scriptlets should be confined so that they can&#8217;t add users to the system or any other security critical activities. This will be a truly exciting capability for Linux systems moving forward.</p>
<p>I delivered a presentation on this project at Linux Plumbers Conference last month in Portland. The <a href="http://linuxplumbersconf.org/2009/slides/brindle-selinux-distribution-lpc-slides.pdf" target="_blank">slides</a> and <a title="video" href="http://video.linuxfoundation.org/video/1569" target="_blank">video recording</a> are published on the web for those who are interested.</p>
<p>I&#8217;ll talk about another project we are working on in my next blog post, which should be coming pretty soon.</p>
]]></content:encoded>
			<wfw:commentRss>http://securityblog.org/brindle/2009/10/24/selinux-and-rpm/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Stackoverflow.com and the SELinux poll</title>
		<link>http://securityblog.org/brindle/2008/10/08/stackoverflowcom-and-the-selinux-poll/</link>
		<comments>http://securityblog.org/brindle/2008/10/08/stackoverflowcom-and-the-selinux-poll/#comments</comments>
		<pubDate>Wed, 08 Oct 2008 23:28:55 +0000</pubDate>
		<dc:creator>Joshua Brindle</dc:creator>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[poll]]></category>
		<category><![CDATA[selinux]]></category>
		<category><![CDATA[stackoverflow]]></category>

		<guid isPermaLink="false">http://securityblog.org/brindle/?p=41</guid>
		<description><![CDATA[So, stackoverflow.com was released to public beta pretty recently and I must say I&#8217;m impressed. It looks like a great place to go to get tough programming (and other) questions answered. 
So, in order to give it a spin I posted the question Do you disable SELinux? 
It didn&#8217;t get nearly as many answers as What’s your favorite “programmer” [...]]]></description>
			<content:encoded><![CDATA[<p>So, stackoverflow.com was released to public beta pretty recently and I must say I&#8217;m impressed. It looks like a great place to go to get tough programming (and other) questions answered. <br />
So, in order to give it a spin I posted the question <a title="Do you disable SELinux?" href="http://stackoverflow.com/questions/97816/do-you-disable-selinux" target="_blank">Do you disable SELinux?</a> </p>
<p>It didn&#8217;t get nearly as many answers as <a href="http://stackoverflow.com/questions/84556/whats-your-favorite-programmer-cartoon" target="_blank">What’s your favorite “programmer” cartoon</a> but I did get mostly good feedback, it seems like the audience on stackoverflow, in general, have seen the positive progress of SELinux and many have chosen to keep it enabled (or even write policies and make it work for them).</p>
<p>Good to hear!</p>
]]></content:encoded>
			<wfw:commentRss>http://securityblog.org/brindle/2008/10/08/stackoverflowcom-and-the-selinux-poll/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SELinux on Ubuntu (part 1)</title>
		<link>http://securityblog.org/brindle/2008/09/14/selinux-on-ubuntu-part-1/</link>
		<comments>http://securityblog.org/brindle/2008/09/14/selinux-on-ubuntu-part-1/#comments</comments>
		<pubDate>Mon, 15 Sep 2008 01:32:42 +0000</pubDate>
		<dc:creator>Joshua Brindle</dc:creator>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[selinux]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://securityblog.org/brindle/?p=28</guid>
		<description><![CDATA[I&#8217;m in the process of moving my server from an ancient decrepit Gentoo install to a shiny new Ubuntu Hardy install with SELinux enabled.

The policy installed with Ubuntu is fairly limited. It is a very small base policy with a cups module available. This was the result of Ubuntu politics but obviously I wanted something [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m in the process of moving my server from an ancient decrepit Gentoo install to a shiny new Ubuntu Hardy install with SELinux enabled.</p>
<p><span id="more-28"></span></p>
<p>The policy installed with Ubuntu is fairly limited. It is a very small base policy with a cups module available. This was the result of Ubuntu politics but obviously I wanted something more comprehensive. The first thing I did was grab the reference policy from oss.tresys.com and try to figure out what policies I wanted installed. Reference policy has 259 modules and I didn&#8217;t want all of them. </p>
<p>I took the Gentoo policy ebuild to start, since it is a much smaller policy than Fedora has and I added modules for the services I was going to run. The result (for now) is this:</p>
<pre>application = base
authlogin = base
bootloader = base
clock = base
consoletype = base
corecommands = base
corenetwork = base
cron = base
devices = base
dmesg = base
domain = base
files = base
filesystem = base
fstools = base
getty = base
hostname = base
hotplug = base
init = base
iptables = base
kernel = base
libraries = base
locallogin = base
logging = base
miscfiles = base
mls = base
mcs = base
modutils = base
mount = base
mta = base
netutils = base
nscd = base
raid = base
selinux = base
selinuxutil = base
ssh = base
staff = base
storage = base
su = base
sysadm = base
sysnetwork = base
terminal = base
udev = base
unconfined = base
userdomain = base
usermanage = base
unprivuser = base
 
dovecot = module
postfix = module
bind = module
mysql = module
apache = module
dpkg = module
spamassassin = module
ntp = module</pre>
<p> </p>
<p>This is a relatively small policy, yeilding a 500k policy.23. </p>
<p>Then I ran in to my first problem. The SELinux libraries installed on Hardy won&#8217;t build the most recent reference policy due to a bug that was fixed after Ubuntu&#8217;s libraries were built. So I had to upgrade my libraries and policy compiler. Since I normally develop on Fedora I assumed I could grab some sort of source deb, update the code and rebuild it. I couldn&#8217;t figure out how to do that though, all of the source pointers go to the developers repository which looked just like the upstream source. I have no idea how to build debs so I gave up and just built from the selinux userspace git tree. </p>
<p>After getting a toolchain I could build the policy on and building and installing the policy I relabeled the filesystem and tried rebooting. Thats when the second problem happened. I couldn&#8217;t log in via ssh (doh!) and the server is located alot of miles away (like 1000 or something). Good thing the machine has a remote administration console. So I logged in via that and took a look at ps -AZ to see what was going on (I was certain that ssh was running in the wrong context and that is why I couldn&#8217;t log in, even in permissive). Everything was running in sysadm_t !?! This was pretty baffling to me, I did some sesearch&#8217;s on the policy (btw, the setools package pulls in the whole thing which requires gtk, tcl, tk, whatever.. too bad there isn&#8217;t a setools-console package). Well it turns out that if the upstart_init boolean isn&#8217;t set to true then initrc_t transitions to sysadm_t on shell_exec_t, I have no clue why, very strange. Set the boolean and everything looks good (yay).</p>
<p>Now everything is up and running in the right context (well, mostly everything, mysqld_safe, logger and dd (run for klogd apparently) are running in initrc_t, which is effectively unconfined) I&#8217;ll work on those later.</p>
<p>Right now I&#8217;m getting tons of denials, most are related to having a tmpfs /var/run I think, also udev is doing all sorts of crazy things (but then again doesn&#8217;t it always). Hopefully I&#8217;ll get these taken care of and I&#8217;ll write another article about the success (assuming I succeed and don&#8217;t give up <img src='http://securityblog.org/brindle/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' />  )</p>
]]></content:encoded>
			<wfw:commentRss>http://securityblog.org/brindle/2008/09/14/selinux-on-ubuntu-part-1/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Web browsers, security and Google Chrome</title>
		<link>http://securityblog.org/brindle/2008/09/02/web-browsers-security-and-google-chrome/</link>
		<comments>http://securityblog.org/brindle/2008/09/02/web-browsers-security-and-google-chrome/#comments</comments>
		<pubDate>Wed, 03 Sep 2008 00:15:09 +0000</pubDate>
		<dc:creator>Joshua Brindle</dc:creator>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[google chrome]]></category>
		<category><![CDATA[selinux]]></category>

		<guid isPermaLink="false">http://securityblog.org/brindle/?p=25</guid>
		<description><![CDATA[Securing web browsers has always been a little tricky. With so many web applications available today, including corporate intranet sites, email and so on with confidential or proprietary information it is always a bit troublesome that web browsers essentially run in one security domain. The last thing I want is for a teller at my [...]]]></description>
			<content:encoded><![CDATA[<p>Securing web browsers has always been a little tricky. With so many web applications available today, including corporate intranet sites, email and so on with confidential or proprietary information it is always a bit troublesome that web browsers essentially run in one security domain. The last thing I want is for a teller at my bank to go to some site that ends up getting bank info from another tab.  <span id="more-25"></span></p>
<div class="entry">
<div>
<p>There have been several improvements in the web browsing space though. Microsoft Internet Explorer has protected mode but that doesn&#8217;t use system based access control to enforce separation of internal web pages from external ones, for example. On Linux we&#8217;ve started using nsplugin to load plugins (flash, whatever) into a separate process. This is particularly nice on SELinux systems since we can transition those plugins into a domain that can&#8217;t do much, such as read files in home directories, access the network, etc. Dan Walsh has a nice writeup about this at <a title="http://danwalsh.livejournal.com/15700.html" href="http://danwalsh.livejournal.com/15700.html" target="_blank">his blog</a></p>
<p>That still doesn&#8217;t separate sites of differing security domains (my bank, joke site my friend sent in an email, the company sharepoint server, etc) into separate processes that cannot interact with each other.</p>
<p>I had a customer once that actually augmented Firefox to be a multi-level browser. This was a Trusted Solaris solution and really didn&#8217;t address the problem. All of the sites were still inside the same browser process and they had only augmented it to try and keep that data separate. Something that used process and domain separation would be better. If we trusted the web browser to not leak data none of this would be necessary!</p>
<p>The best we can hope for is manually separating browsers. I&#8217;ve blogged in the past about using network access controls in SELinux to ensure an &#8220;internal&#8221; browser can&#8217;t browse the the internet, and an &#8220;internet&#8221; browser can&#8217;t browse into the intranet. This requires user intervention to understand and keep track of multiple browsers, hardly an elegant solution. Surely there is a better way.</p>
<p>Now comes Google Chrome, a shiny (haha) new browser that has some great ideas. Google also published an interesting <a title="http://blogoscoped.com/google-chrome/" href="http://blogoscoped.com/google-chrome/" target="_blank">set of comics </a>that describe some of the ideas and features.</p>
<p>The ones I found most interesting: Each tab is rendered in a separate process, plugins run in a separate process and a javascript virtual machine. This means tabs shouldn&#8217;t be able to get data from other tabs (now I don&#8217;t have to worry about crazy scary Myspace pages reading my bank account number).</p>
<p>There are a couple things to worry about, first they claim plugins are poorly written and therefore must have access to all tabs (which is particularly scary given the Flash vulnerabilities as of late). The ideal solution is to have a plugin process per-rendering process, this would keep plugins from interacting with each other and other rendering processes. They claim this is a long term goal, that they would work with plugin writers to make this easier, we can only hope.</p>
<p>Second, and much more worrisome is on slide 29, the claim that they know their sandboxing works because they wrote it, wrong! If we trusted the applications to begin with we&#8217;d have no need for additional access control.</p>
<p>Now all this brings me to my main point. Granted Chrome is only available for Windows at the moment but hopefully it&#8217;ll be available on Linux before long. And then we might have something interesting to work on. Different security domains for different sites? That would be great. Different domains for plugins? Yes! SELinux enforced sandboxes?</p>
<p>So here is the idea: We label sites by dns name or IP and have Chrome execute the rendering processes in different domains. *.tresys.com would run in internal_website_t and not be able to send data to the internet! my bank site would run in bank_website_t and only be able to send data to my banks address. Even if I have some sort of browser or plugin exploit going on it won&#8217;t matter, only data can be sent to the appropriate place (this is the beauty of mandatory access control, even a broken application can&#8217;t do anything bad). This should work because Chrome even creates new rendering processes if you jump from one domain to another (It does this today). If I go to facebook and then to myspace in the same tab a new process is created for myspace. I&#8217;d like to go so far as to put the javascript vm in another process, since it is executing dynamically generated code, or else we&#8217;ll have to give the rendering process the ability to execheap, execstack, not a good permission to give something already susceptable to vulnerabilities.</p>
<p>What is the net result of this? It is like the manual separation I and others have talked about before but from the user perspective it is seamless. Tabs in the same browser running in different security domains without the users knowledge, seamless mandatory security on web browsing, I can&#8217;t wait!</p>
<p>If this should happen to reach any of the Chrome developers I&#8217;d love to talk to you about the possibilites. Combining this browser (which is excellent BTW, I&#8217;m using it to write this blog post) with the mandatory separation afforded by SELinux would make an incredibly powerful platform for securing web applications.</p></div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://securityblog.org/brindle/2008/09/02/web-browsers-security-and-google-chrome/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Security Anti-Pattern: MLS for Guards</title>
		<link>http://securityblog.org/brindle/2008/05/18/security-anti-pattern-mls-for-guards/</link>
		<comments>http://securityblog.org/brindle/2008/05/18/security-anti-pattern-mls-for-guards/#comments</comments>
		<pubDate>Sun, 18 May 2008 18:06:15 +0000</pubDate>
		<dc:creator>Joshua Brindle</dc:creator>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[BLP]]></category>
		<category><![CDATA[CDS]]></category>
		<category><![CDATA[Guard]]></category>
		<category><![CDATA[MLS]]></category>
		<category><![CDATA[selinux]]></category>

		<guid isPermaLink="false">http://securityblog.org/brindle/?p=24</guid>
		<description><![CDATA[This article was requested, and was a long time coming anyway.
I&#8217;ve gone over Multi-Level Security (MLS) a little bit before. It&#8217;s basically a security policy that is implemented by many trusted operating systems (such as Trusted Solaris) that is hierarchical and inflexible by nature. Specifically Bell-LaPadula (BLP) is used by many operating systems because it [...]]]></description>
			<content:encoded><![CDATA[<p>This article was requested, and was a long time coming anyway.</p>
<p>I&#8217;ve gone over Multi-Level Security (MLS) a little bit before. It&#8217;s basically a security policy that is implemented by many trusted operating systems (such as Trusted Solaris) that is hierarchical and inflexible by nature. Specifically Bell-LaPadula (BLP) is used by many operating systems because it reflects the real world security policy used by the government and military. In BLP subjects and objects have a label consisting of a level (Secret, Top Secret, Unclassified, etc) and a set of non-hierarchical categories (US Only, Army, etc).</p>
<p>The sensitivies are hierarchical in that a higher sensitivity process labeled top secret can read and write top secret objects but only read unclassified objects. This prevents the &#8216;downgrade&#8217; of classified information. For systems that conform to this kind of policy it makes perfect sense, a multi-level desktop system allows users to keep top secret and unclassified material on the same system but does not allow the release of top secret data to unclassified environments or users. Lower levels can also write to higher levels, in some cases. This may seem bad but considering what the policy is trying to accomplish allowing an unclassified process to write a top secret document doesn&#8217;t disclose top secret data. The catch is that the unclassified process would never be able to read the document after writing it. This policy is only usable for confidentiality, to prevent information from being released inappropriately. It cannot address integrity or other security goals I have mentioned in other articles.</p>
<p>Because traditional trusted operating systems only implemented BLP (and in some rare cases Biba for integrity) the users of such systems (primarily government and military) had to use it even when it wasn&#8217;t appropriate. One such case is a guard, or cross domain solution (CDS). A CDS is a system that allows two or more networks of differing security properties to be connected to one another. A typical CDS can connect a top secret to a secret network, for example, and allow information from the secret network onto the top secret network but not vice versa. CDS&#8217;s also do the opposite, allowing a controlled release of information from top secret to secret, or between two coalition networks (Such as Australia and the US). CDS&#8217;s always have some safety mechanism built in to prevent malicious data, or inappropriate data from going across it (if it didn&#8217;t it wouldn&#8217;t be any more useful than a crossover cable between the networks). These safety mechanisms are virus scanners, &#8220;dirty word&#8221; filters, document disassemblers (for example to take a word document and convert it to plain text or pdf), etc. The type of safety mechanism primarily depends on what kinds of networks the system is connecting.</p>
<p>For now we&#8217;ll talk about the first case, letting information flow from a secret network to a top secret network. Since a BLP system is designed to let information go from secret to top secret already it seems like an obvious fit, right? If the CDS was a very simple system with a process to read incoming data, a virus filter and an outgoing process it seems like a BLP policy would be fine. We are going to call the set of processes that pass data through the system the pipeline.</p>
<p>Wrong, there are actually multiple issues here. Because the lower levels would be allowed to write to higher levels, but not read from them we could label the incoming process Unclassified, the middle process Secret and the outgoing process Top Secret. This allows flow from the incoming process to the outgoing process. The main problem here is that since the levels are hierarchical there is nothing that stops the Unclassified process from writing directly to the Top Secret process (oops). Well, people figured this out and thought of a great work-around. Remember those categories? Categories allow reading and writing when the subject dominates (or has a superset) the categories of the object. So you give the incoming process categories that dominate the categories of the middle process but not the outgoing process.</p>
<p>So that problem is solved (albeit in an interesting way) but CDS&#8217;s are never that simple (I mean never). The requirements that are imposed on CDS&#8217;s specify pesky little things like logging, auditing, monitoring, emergency shutdown, etc. So now our simple CDS needs all processes to be able to talk to a logging system, and a monitoring system must ask the processes for their state and get back a response. So now we have one or more huge processes that can talk to and receive data from every process in the pipeline. That wouldn&#8217;t be so bad except the functional requirements of every guard I&#8217;ve seen says that those logs have to end up on the high side for consumption, which is obvious, they certainly can&#8217;t go to the low side because that would be a violation of the security policy. This, of course, allows information to flow through the logging and monitoring process out the other side without going through the set of filters. Sure, the advocates will say the logging and monitoring system is part of the TCB (Trusted Computing Base), the part of the system that is trusted to not do nasty things, but in a system like this do you want such processes to be trusted?</p>
<p><img src="http://securityblog.org/images/bad-cds.png" alt="Bad CDS" /><br />
The above (totally professionally done) diagram shows the attack vector that would be used to get data through such a system. Because the logging/monitoring app is allowed to violate the MAC policy it is possible to use it to bypass filters 2, 3 and 4.</p>
<p>So basically its impossible to use a BLP policy on a guard and ensure that all data is passed through all filters before it reaches the other side, the policy simply wasn&#8217;t made for that kind of thing. It has been the standard operating procedure to shoehorn CDS&#8217;s into that policy for a very long time, however.</p>
<p>Before I get into how SELinux helps this I&#8217;ll quickly cover the other two types of guards I previously mentioned. First the High-to-Low guard. This kind of guard basically allows controlled downgrading of information; it will run filters like a &#8216;dirty word&#8217; filter to ensure nothing that shouldn&#8217;t be getting downgraded isn&#8217;t. It may also redact some data. This CDS is a direct violation of the BLP policy, as such the processes essentially have to be MAC Exempt, or not subject to the policy, essentially making the existence of the policy irrelevant, it should be easy to see why this is an inappropriate use of BLP. The second was a CDS between two coalition partners. In this case the BLP policy doesn&#8217;t even mean anything since there is no high side and low side, merely &#8216;different&#8217; sides.</p>
<p>So, those are the reasons why BLP is inappropriate for CDS&#8217;s, why is SELinux different?</p>
<p>SELinux primarily uses type enforcement for policy decisions. Type enforcement allows fine grained policy to be written for all subjects and objects on the system. In the case of CDS&#8217;s you can literally say incoming process can write to virus scanner (but not read) and virus scanner can write to outgoing process. We call this an assured pipeline. This can be used for any size or type of pipeline, we even have a tool called CDS Framework that lets you visualize the CDS system. But wait, what about all that logging and auditing and monitoring? Simple, since the policy can describe arbitrary relationships between processes we can break that logging and monitoring process up into filter size chunks, then allow each filter to read and write from the logging and monitoring app. The logging and monitoring app can then send its logs through the same pipeline as the data, it will end up on the high side but there is no additional large process you have to trust to allow it to happen. Using type enforcement we can ensure that every single bit of information that comes leaves the guard passed through every filter (we can&#8217;t, of course guarantee that the filters worked). Since type enforcement is not hierarchical the direction of the CDS doesn&#8217;t matter, we can do the same thing for High-to-Low that we do for Low-to-High, or even between coalition networks.</p>
<p><img src="http://securityblog.org/images/good-cds.png" alt="Good CDS" /><br />
The above diagram shows a possible CDS configuration using type enforcement. It allows for logging and monitoring and simply passes those messages back through the filters to get them to the high side. In this configuration no single part of the pipeline is trusted to violate the policy, and filters can never be bypassed. This policy would be impossible to enforce with BLP.</p>
<p>Don&#8217;t take this to mean that I hate MLS and never think it&#8217;s useful. I&#8217;m not saying it kicks puppies (although it does occasional pee on rugs I&#8217;m told). MLS has a time and a place, just like everything else. The point I&#8217;m trying to make is that it shouldn&#8217;t be used if it isn&#8217;t appropriate, as has been done in the past (and continues to be done today).</p>
]]></content:encoded>
			<wfw:commentRss>http://securityblog.org/brindle/2008/05/18/security-anti-pattern-mls-for-guards/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Is the BSD license more liberal or conservative than the GPL?</title>
		<link>http://securityblog.org/brindle/2008/04/11/is-the-bsd-license-more-liberal-or-conservative-than-the-gpl/</link>
		<comments>http://securityblog.org/brindle/2008/04/11/is-the-bsd-license-more-liberal-or-conservative-than-the-gpl/#comments</comments>
		<pubDate>Fri, 11 Apr 2008 20:21:00 +0000</pubDate>
		<dc:creator>Joshua Brindle</dc:creator>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[bsd]]></category>
		<category><![CDATA[conservative]]></category>
		<category><![CDATA[gpl]]></category>
		<category><![CDATA[liberal]]></category>
		<category><![CDATA[license]]></category>

		<guid isPermaLink="false">http://securityblog.org/brindle/2008/04/11/is-the-bsd-license-more-liberal-or-conservative-than-the-gpl/</guid>
		<description><![CDATA[Recently I was looking around for a piece of software and I thought to myself &#8220;I need something with a more liberal license than the GPL&#8221;.. Then I thought &#8220;Wait, is liberal the right word there? Hrm&#8221;&#8230;
So what do you guys think?
]]></description>
			<content:encoded><![CDATA[<p>Recently I was looking around for a piece of software and I thought to myself &#8220;I need something with a more liberal license than the GPL&#8221;.. Then I thought &#8220;Wait, is liberal the right word there? Hrm&#8221;&#8230;<br />
So what do you guys think?</p>
]]></content:encoded>
			<wfw:commentRss>http://securityblog.org/brindle/2008/04/11/is-the-bsd-license-more-liberal-or-conservative-than-the-gpl/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Secure doesn&#8217;t mean anything.</title>
		<link>http://securityblog.org/brindle/2008/03/30/secure-doesnt-mean-anything/</link>
		<comments>http://securityblog.org/brindle/2008/03/30/secure-doesnt-mean-anything/#comments</comments>
		<pubDate>Sun, 30 Mar 2008 16:26:54 +0000</pubDate>
		<dc:creator>Joshua Brindle</dc:creator>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[biba]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[integrity]]></category>
		<category><![CDATA[mandatory-access-control]]></category>
		<category><![CDATA[openbsd]]></category>
		<category><![CDATA[selinux]]></category>

		<guid isPermaLink="false">http://securityblog.org/brindle/2008/03/30/secure-doesnt-mean-anything/</guid>
		<description><![CDATA[No, seriously. I&#8217;m not trying to be ironic because the title of my blog is &#8220;Brindle on Security&#8221;, which I should probably change to something more creative anyway.
During my tenure at Gentoo, running the Hardened Gentoo project, the most common question by far was &#8220;How do I secure my system?&#8221; Warning, this article may contain [...]]]></description>
			<content:encoded><![CDATA[<p>No, seriously. I&#8217;m not trying to be ironic because the title of my blog is &#8220;Brindle on Security&#8221;, which I should probably change to something more creative anyway.</p>
<p>During my tenure at Gentoo, running the Hardened Gentoo project, the most common question by far was &#8220;How do I secure my system?&#8221; Warning, this article may contain some flamebait, avoid it if you can&#8217;t resist flaming back <img src='http://securityblog.org/brindle/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> .</p>
<p>Eventually we gave up and just pointed people to websites, perhaps this post can serve as that page. The answer was &#8220;What do you mean &#8217;secure&#8217; your system?&#8221; Security isn&#8217;t, and can&#8217;t be, a goal by itself. You need to know what exactly you are trying to protect yourself against, your threat model, as it were.<br />
<span id="more-22"></span><br />
SELinux has the ability to protect against many different threat models. In Hardened Gentoo we also had some complimentary projects that protected against things that SELinux couldn&#8217;t, such as PaX (kernel level memory execution protection and memory layout randomization) and SSP (userspace level stack smashing protection). Fedora also has comparable technologies such as Exec Shield baked in by default.</p>
<p>So I saw a thread recently that said something to the concern of &#8220;Why use SELinux, which is security bolted onto Linux when you can use OpenBSD which has security as part of the development process?&#8221; It&#8217;s an interesting question I suppose, if you can decode it. The OpenBSD mantra seems to be develop software correctly in the first place and you don&#8217;t need additional layers of security. The baffling part is that you&#8217;ll rarely find an OpenBSD user that actually knows what security OpenBSD actually, tangibly provides.</p>
<p>All that said, there are different kinds of security that you might want to implement, and lots of different solutions to attain them.</p>
<h2>System Integrity</h2>
<p>System integrity is what most people mean when they say &#8220;secure my system&#8221;. Do you want system integrity? The answer is almost always yes. Some people want very good system integrity and end up using a read only medium, like a livecd or dvd, to run their systems. This, of course, only works if you aren&#8217;t storing important data on those systems, for things like web front ends to applications servers it might work fine.</p>
<p>System integrity is what OpenBSD users mean when they say they have a secure system. They integrate quality control into their development process to ensure that as few bugs as possible get into their code and the result is suppose to be high system integrity.</p>
<p>Quality control alone doesn&#8217;t give you complete system integrity, however. Your kernel can be well coded but that doesn&#8217;t mean much if other processes running as root are vulnerable. Just take a look at ps and see how many applications are running as root. If any of those services are vulnerable your system may have less integrity than previously thought. The fact is everyone runs third party apps on their UNIX/Linux systems. Most users run Apache, samba, syslog, etc and all have components running as root. Even OpenBSD isn&#8217;t without vulnerabilities, quality control only goes so far, after that more is necessary.</p>
<p>Memory protection techniques can help protect against some of these vulnerabilities. NX support on modern processors prevent some exploits that use bugs to add shellcode to  running applications but that won&#8217;t prevent someone from using code already present in the address space, such as system(). Memory layout randomization only provides stop gap protection since the layout can eventually be brute forced, if the administrator isn&#8217;t watching very closely.</p>
<p>Mandatory access control is a way of addressing the gaps between a well coded kernel and vulnerable third party applications. If Apache shouldn&#8217;t be able to write to anything in /usr then MAC can prevent that. This, by itself, is a huge win for system integrity since it is generally thought that /usr is the highest integrity part of the system.</p>
<p>Now for some explanation. On most systems you can think of integrity as either low or high. High integrity files are files that are system objects. Things in /usr are pretty much all system objects. If a system object gets changed the behavior of the system is changed. A rootkit is going to target these high integrity files, for example. Other examples of high integrity objects are, ofcourse, anything in /boot, /lib, /sbin, /bin, most files in /etc, and so on. User files, on the other hand, are generally low integrity files. Anything in /home is untrusted. User data should never be able to affect the integrity of the system.</p>
<p>The integrity of a process is determined simply by where it gets its input. If a process reads user data, or data off of an untrusted network it is considered low integrity. Apache, which reads /home/*/public_html and receives queries from the internet, is low integrity. RPM, which is run by the administrator, reads rpm&#8217;s downloaded from your vendor (hopefully) and installs files all over the system, is high integrity (this is an assessment of how it operates, not whether it is free of vulnerabilities).</p>
<p>Now that you know how to determine the integrity level of objects and processes lets talk about the security policy to maintain system integrity. Biba is a hierarchical integrity policy, similar to Bell LaPadula but, interestingly, the exact opposite. It allows processes to both read and write to objects of the same integrity, no surprises there. Next it allows high integrity processes to write to low integrity objects, but not read them and last it allows low integrity processes to read high integrity objects but not write them.</p>
<p><img alt="Biba" title="Biba" src="/images/biba.png" /></p>
<p>Though the use of Biba is very limited and has never hit a mainstream operating system it is a very good practice, if implemented in a usable way. The standard SELinux policies implement something between Biba and &#8216;least privilege&#8217;, with a nice balance to ensure system integrity without making the system completely unusable. Biba, for example, isn&#8217;t very flexible. Since processes and objects are simply labeled with their integrity there is no way to make practical changes to the policy. You either fall within the constraints of Biba or you are entirely MAC exempt.</p>
<p>The SELinux Apache policy doesn&#8217;t allow Apache to write to the high integrity files we talked about above (/usr, /lib, /bin, etc) while allowing it to write to its logs, its cache, etc. Since objects in SELinux have fine grained labeling we can restrict access to apache high integrity objects, such as apache modules, the apache configuration and so on. In many ways SELinux lets us constrain applications more than Biba while at the same time making practical exceptions when necessary. This brings me to my next kind of security.</p>
<h2>Application and Data Integrity</h2>
<p>While system integrity is generally of the utmost importance, since it is the basis on which you can build other security goals, in some cases it is not enough. Sometimes the most important part of a system is the applications it is running, or the data those applications manage.</p>
<p>For example, if you are running a database server the most important part of the system quite possibly could be the data in that database. How do you protect that data?</p>
<p>We can go back to the mantra of well coded systems with quality control but that, once again, fails when you consider other applications running on the system. Granted you&#8217;ll need to trust the database server itself with the data, there is no way around that but the other applications that can access the data can be problematic. Generally database files would be owned by a non-root user with the correct permissions set to prevent other applications from accessing them without going through the database server. Of course root applications can bypass all those restrictions.</p>
<p>There are multiple ways to protect the data. One way is run only the database server on the system and nothing else. That way there is nothing else to protect the data from. This can work in well controlled environments but there are always going to be apps running, like the system logger and sometimes, particularly on UNIX like systems, there is a tendency to put multiple applications on a single system. There will always be the need for backup apps, log monitors, log rotators, etc. This may be a risk you are willing to take, and that is what threat modeling is all about. If you can accept the risk then your security may already meet your needs.</p>
<p>Another way people have tried recently is with hypervisors. Unfortunately the current generation of hypervisors always require a domain 0 or host OS that essentially has full access to the disk, the network interfaces, sometimes the memory, etc. Protecting the integrity of applications within a VM is impossible without first doing so on the host OS, as I pointed out in my <a title="Why Blu-Ray scares me" href="http://securityblog.org/brindle/2008/01/24/why-blu-ray-scares-me/">Blu-ray post</a>.</p>
<p>MAC systems are IMHO a superior way to handle application and data integrity. SELinux policies can prevent anyone from accessing the database files aside from the database server itself. You may need the backup service to read the database files directly (unless it is configured to get backups directly from the database server itself) but you can easily make the backup server only able to read files without being able to write them, which is not something you can easily do without MAC.</p>
<h2>Pipelines</h2>
<p>Another security goal which is often overlooked outside of a small niche of guard architects are pipelines. Guards are systems with specific purposes to transfer data from one side to another, while going through a specific set of applications. In the real world one can envision a proxy server or a virus scanning email server as a guard. The idea is that data coming into a system must go through some number of applications before it is allowed to proceed.</p>
<p><img alt="pipeline" title="pipeline" src="/images/pipeline.png" /></p>
<p>In this security goal it is desired that any incoming email goes through a virus and spam filter before going on to the user mail directory and ultimately onto the end users system. This may be more of a functional goal than a security goal to some. As a former administrator I understand the security ramifications of unfiltered email getting through to the network. This kind of goal is generally enforced with configuration of the mail system but for some people that is not enough.</p>
<p>Pipelines obviously rely on system integrity to protect the layer below the pipeline itself, so those security goals are composed onto one another. An opensource project that my company developed called CDS Framework implements this sort of security goal.</p>
<h2>Conclusion</h2>
<p>There are other security goals one can implement, these are only examples. The first two are probably the most important for most users. The main thing I want people who read this to take away is that there is no such thing as a &#8217;secure system&#8217; or &#8216;added on security&#8217; or &#8216;baked in security&#8217;. Security by itself doesn&#8217;t mean anything. Users need to determine their threat model and security goals in order to determine what measures need to be taken in order to protect what they want protected.</p>
]]></content:encoded>
			<wfw:commentRss>http://securityblog.org/brindle/2008/03/30/secure-doesnt-mean-anything/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Why Blu-Ray scares me</title>
		<link>http://securityblog.org/brindle/2008/01/24/why-blu-ray-scares-me/</link>
		<comments>http://securityblog.org/brindle/2008/01/24/why-blu-ray-scares-me/#comments</comments>
		<pubDate>Fri, 25 Jan 2008 02:30:54 +0000</pubDate>
		<dc:creator>Joshua Brindle</dc:creator>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[bd+]]></category>
		<category><![CDATA[bluray]]></category>
		<category><![CDATA[DRM]]></category>
		<category><![CDATA[virtual machine]]></category>

		<guid isPermaLink="false">http://securityblog.org/brindle/2008/01/24/why-blu-ray-scares-me/</guid>
		<description><![CDATA[Now that Blu-Ray has all but won the HD format war I guess its a little late to post this but oh well, I&#8217;ll do it anyway.
Disclaimer: I am an HDDVD owner but this post is not a result of  bitterness about my chosen format losing. The reason I&#8217;m posting here about (among others) [...]]]></description>
			<content:encoded><![CDATA[<p>Now that Blu-Ray has all but won the HD format war I guess its a little late to post this but oh well, I&#8217;ll do it anyway.</p>
<p>Disclaimer: I am an HDDVD owner but this post is not a result of  bitterness about my chosen format losing. The reason I&#8217;m posting here about (among others) is the actual reason I chose HDDVD. I also don&#8217;t want to talk about the pro&#8217;s and con&#8217;s of DRM or whether the DRM has been cracked and is accessible via other means. I am going to talk about the intentions of the format producers and what it means to consumers.</p>
<p><span id="more-21"></span><br />
So, basically the big security problem I have with Blu-Ray is that <a title="BD+" href="http://en.wikipedia.org/wiki/BD%2B" target="_blank">BD+</a> (a BluRay specific DRM mechanism) has some scary provisions to make movie producers happy. Basically the idea behind BD+ is that the movie, decoding, etc is done from within a virtual machine.</p>
<p>So the problem with using a virtual machine to protect the data from the person who owns the device is that the host inherently can access and manipulate the virtual machine itself, including the data. This presents a fundamental problem with the idea of protecting the content. So in order to address this the movie producer must be satisfied that the host machine is in a state where the virtual machine is considered safe.</p>
<p>This is where BD+ gets scary. It allows movie producers to package arbitrary host executables with the BD+ virtual machine that is run on the player before the virtual machine unencrypts any content. The idea, of course,  is that a vulnerable host (that is, a host that allows unauthorized access to the unencrypted content) can be patched in order to close the vulnerability. This has some serious ramifications including, but not limited to, producers being able to rootkit machines (see sony&#8217;s recent rootkit fiascos), spyware, broken patches that make systems more vulnerable, broken patches that break machines, patches that affect different OS releases differently, etc.</p>
<p>I almost wish a producer would create a PS3 patch that bricks a bunch of PS3&#8217;s just to show how very very dangerous &#8220;features&#8221; like this are.</p>
<p>So that is one of the features that scared me the most. There are other problems I had that caused me to choose HDDVD such as incomplete specifications for BluRay, fewer features in the original specifications, limits on the layering of the disks and so on. I now have a dilemma about whether to get a BluRay player knowing that, as a consumer, the choices I make validate the behavior of the producers. The most disturbing fact is that the consumers who don&#8217;t know about these issues have implicitly allowed the format producers and movie producers to build this incredibly anti-consumer system. C&#8217;est la vie I suppose.</p>
]]></content:encoded>
			<wfw:commentRss>http://securityblog.org/brindle/2008/01/24/why-blu-ray-scares-me/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Misunderstanding UNIX security</title>
		<link>http://securityblog.org/brindle/2007/07/15/misunderstanding-unix-security/</link>
		<comments>http://securityblog.org/brindle/2007/07/15/misunderstanding-unix-security/#comments</comments>
		<pubDate>Sun, 15 Jul 2007 17:12:38 +0000</pubDate>
		<dc:creator>Joshua Brindle</dc:creator>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[apparmor]]></category>
		<category><![CDATA[mandatory-access-control]]></category>
		<category><![CDATA[path-based-access-control]]></category>
		<category><![CDATA[selinux]]></category>
		<category><![CDATA[selinux-symposium]]></category>
		<category><![CDATA[unix-security]]></category>

		<guid isPermaLink="false">http://securityblog.org/brindle/2007/07/15/misunderstanding-unix-security/</guid>
		<description><![CDATA[I just got a comment on my post about path based access control that was fairly startling to me. The more I thought about it, though, the more I thought maybe others shared the beliefs so I&#8217;m going to respond to it here.
inode-based security has analogous problems to path-based security.  Software opens paths, not [...]]]></description>
			<content:encoded><![CDATA[<p>I just got a comment on my post about path based access control that was fairly startling to me. The more I thought about it, though, the more I thought maybe others shared the beliefs so I&#8217;m going to respond to it here.</p>
<blockquote><p>inode-based security has analogous problems to path-based security.  Software opens paths, not inodes, so it very much matters what the permissions are for the file at /etc/shadow or /var/data/mydb, regardless of what the inode happens to be.  With an inode-based system, security may go out the window when programs replace or manipulate inodes, as many of them do.</p></blockquote>
<p>Software opens paths because paths are the exposed abstraction for userspace applications. Sure it matters what permissions are on /etc/shadow, but those permissions and the access control alike is <strong>always</strong> done at the inode level, as I will demonstrate below. Applications that manipulate inodes have always needed to set security attributes on those inodes, look at passwd source code and you will see that it creates the inode with mode 400 (r&#8212;&#8212;&#8211;).</p>
<blockquote><p>So, neither AppArmor nor SELinux provide bullet proof security or data integrity, although both may be useful in protecting against some problems.</p></blockquote>
<p>This is blatantly wrong,  SELinux provides controls to specify precisely how things can be labeled. If my policy does not allow an application that handles confidential information to relabel or create a file with a label that is accessible by other applications there are no circumstances where that application will be able to leak the data. Similarly if an application can&#8217;t read low-integrity data and write to high-integrity files there are no circumstances where the application can harm the data integrity. I suggest you read some of the papers about SELinux policy analysis and information flow to understand the issues and how SELinux can address them. Many are available at the <a href="http://selinux-symposium.org">SELinux symposium website</a>.</p>
<blockquote><p>But arguments like the ones in this blog really make me doubt whether the SELinux people even understand the issues or have much of a notion of how files and security work on real-world UNIX systems.</p></blockquote>
<p>As much as I&#8217;d like to ignore people using ad hominum attacks there may be others under this impression. Note the following demonstration as a counter example:</p>
<pre># ls -al /etc/shadow
-r-------- 1 root root 947 2007-06-06 03:40 /etc/shadow</pre>
<pre># ln /etc/shadow /tmp/shadow
# ls -al /tmp/shadow
-r-------- 2 root root 947 2007-06-06 03:40 /tmp/shadow</pre>
<pre># chmod 777 /tmp/shadow
# ls -al /etc/shadow
-rwxrwxrwx 2 root root 947 2007-06-06 03:40 /etc/shadow</pre>
<p>It should be clear at this point that the UNIX permissions absolutely do not have anything to do with paths, only with inodes. This is how real-world UNIX systems have always worked, path based mechanisms break that convention and are subject to the issues I&#8217;ve noted in the path based article. The simple fact is that UNIX systems never ever use paths to determine access to anything, access control has always been centered around inodes and permissions set on inodes. Do not think that the existance of paths changes that, these are merely an abstraction to make userspace more useful.</p>
<p>The arguments against SELinux by the AppArmor people, and others, are purely functionality based arguments. They want to use paths because paths are easy to understand and paths have conventions that can be reflected in their policy (eg., that passwords are always stored in /etc/shadow and therefore that file should be protected). SELinux provides mechanisms to enforce many different security policies including protecting /etc/shadow and /var/data/mydb.</p>
]]></content:encoded>
			<wfw:commentRss>http://securityblog.org/brindle/2007/07/15/misunderstanding-unix-security/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
	</channel>
</rss>
