<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: Security Anti-Pattern: Path based access control</title>
	<atom:link href="http://securityblog.org/brindle/2006/04/19/security-anti-pattern-path-based-access-control/feed/" rel="self" type="application/rss+xml" />
	<link>http://securityblog.org/brindle/2006/04/19/security-anti-pattern-path-based-access-control/</link>
	<description>The ramblings of security neophyte Joshua Brindle</description>
	<pubDate>Sat, 05 Jul 2008 01:11:12 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5</generator>
		<item>
		<title>By: Joshua Brindle</title>
		<link>http://securityblog.org/brindle/2006/04/19/security-anti-pattern-path-based-access-control/#comment-17069</link>
		<dc:creator>Joshua Brindle</dc:creator>
		<pubDate>Mon, 27 Aug 2007 15:09:28 +0000</pubDate>
		<guid isPermaLink="false">http://securityblog.org/brindle/2006/04/19/security-anti-pattern-path-based-access-control/#comment-17069</guid>
		<description>@Morgaine 

Logical fallacies aside your argument is very poor. Let me compare your argument to cars. Sure, we will eventually have flying cars that are fueled by discarded foodstuffs but that doesn't mean we have to (or even can) give up on all the intermediary steps in between. If we don't continue to make more fuel efficient cars and alternative fuels we may never make it to magical flying cars.

Furthermore, your argument seems to imply we should not waste our time and money on the infrastructure, so if we leave all our roads, bridges and parking lots to degrade we'll end up much worse off than we are now, simply because we were trying to ignore the present to obtain the future, this clearly doesn't work, and never has. Sure there are disruptive technologies, SELinux is one of them, but you don't get a million miles away (your words) without traveling those million miles.</description>
		<content:encoded><![CDATA[<p>@Morgaine </p>
<p>Logical fallacies aside your argument is very poor. Let me compare your argument to cars. Sure, we will eventually have flying cars that are fueled by discarded foodstuffs but that doesn&#8217;t mean we have to (or even can) give up on all the intermediary steps in between. If we don&#8217;t continue to make more fuel efficient cars and alternative fuels we may never make it to magical flying cars.</p>
<p>Furthermore, your argument seems to imply we should not waste our time and money on the infrastructure, so if we leave all our roads, bridges and parking lots to degrade we&#8217;ll end up much worse off than we are now, simply because we were trying to ignore the present to obtain the future, this clearly doesn&#8217;t work, and never has. Sure there are disruptive technologies, SELinux is one of them, but you don&#8217;t get a million miles away (your words) without traveling those million miles.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Morgaine</title>
		<link>http://securityblog.org/brindle/2006/04/19/security-anti-pattern-path-based-access-control/#comment-17066</link>
		<dc:creator>Morgaine</dc:creator>
		<pubDate>Mon, 27 Aug 2007 13:52:23 +0000</pubDate>
		<guid isPermaLink="false">http://securityblog.org/brindle/2006/04/19/security-anti-pattern-path-based-access-control/#comment-17066</guid>
		<description>It's a false debate.  AppArmor and SELinux are both just partial bandaids, and so is everything else in Orange Book and its descendents.

O/S security will continue to be on a wing and a prayer until MMU hardware can control access to state at arbitrary levels of granularity.  In other words, real security requires all state (even a single character) to be opaque and accessible only through access methods (to use OO terminology) enforced by MMU --- not by programming language.  Only then will be be able to ascribe access constraints to the myriad large and small entities within an O/S with anything like full coverage, and only then will those labels stick as entities migrate and replicate.

We're a million miles from that currently, so you're wasting your breath in AppArmor vs SELinux arguments.  There is Unix religion standing in our way at the moment, in the shape of "All I/O is in unlabelled bytes", and that meme is immensely strong and adopted by every O/S on the planet.  Security-conscious innovators have their work cut out for them.

There aren't any patches of brightness appearing in the "Dark Ages of Computing" as yet, sadly.  Anyone who combines both insight and a will to buck the accepted computing memes, please apply.  Security needs you.</description>
		<content:encoded><![CDATA[<p>It&#8217;s a false debate.  AppArmor and SELinux are both just partial bandaids, and so is everything else in Orange Book and its descendents.</p>
<p>O/S security will continue to be on a wing and a prayer until MMU hardware can control access to state at arbitrary levels of granularity.  In other words, real security requires all state (even a single character) to be opaque and accessible only through access methods (to use OO terminology) enforced by MMU &#8212; not by programming language.  Only then will be be able to ascribe access constraints to the myriad large and small entities within an O/S with anything like full coverage, and only then will those labels stick as entities migrate and replicate.</p>
<p>We&#8217;re a million miles from that currently, so you&#8217;re wasting your breath in AppArmor vs SELinux arguments.  There is Unix religion standing in our way at the moment, in the shape of &#8220;All I/O is in unlabelled bytes&#8221;, and that meme is immensely strong and adopted by every O/S on the planet.  Security-conscious innovators have their work cut out for them.</p>
<p>There aren&#8217;t any patches of brightness appearing in the &#8220;Dark Ages of Computing&#8221; as yet, sadly.  Anyone who combines both insight and a will to buck the accepted computing memes, please apply.  Security needs you.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tom</title>
		<link>http://securityblog.org/brindle/2006/04/19/security-anti-pattern-path-based-access-control/#comment-15170</link>
		<dc:creator>Tom</dc:creator>
		<pubDate>Sun, 15 Jul 2007 12:05:08 +0000</pubDate>
		<guid isPermaLink="false">http://securityblog.org/brindle/2006/04/19/security-anti-pattern-path-based-access-control/#comment-15170</guid>
		<description>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.

So, neither AppArmor nor SELinux provide bullet proof security or data integrity, although both may be useful in protecting against some problems.  

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.</description>
		<content:encoded><![CDATA[<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>
<p>So, neither AppArmor nor SELinux provide bullet proof security or data integrity, although both may be useful in protecting against some problems.  </p>
<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>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mike&#8217;s Journal &#187; Blog Archive &#187; bits and pieces - part iii</title>
		<link>http://securityblog.org/brindle/2006/04/19/security-anti-pattern-path-based-access-control/#comment-13</link>
		<dc:creator>Mike&#8217;s Journal &#187; Blog Archive &#187; bits and pieces - part iii</dc:creator>
		<pubDate>Thu, 18 May 2006 12:25:30 +0000</pubDate>
		<guid isPermaLink="false">http://securityblog.org/brindle/2006/04/19/security-anti-pattern-path-based-access-control/#comment-13</guid>
		<description>[...] The AppArmor vs SELinux debate trundles on. Joshua Brindle summed it up and I responded in the comments section (unfortunately the formatting got a bit mangled at the start there&#8230;..) - in short, the argument revolves around the fact that AppArmor restricts access to paths, and paths can be ambiguous (eg chroots/hardlinks/namespaces). The AA guys claim these features are exotic and rarely used and that the usability improvement is worth it, the SELinux guys claim that AA is &#8220;broken&#8221; because an unconfined app could help a confined app escape, the AA guys claim that wasn&#8217;t a part of their threat profile anyway, the SELinux guys say it&#8217;s broken again and so around we go. I&#8217;m reminded of some of the autopackage debates here &#8230;. [...]</description>
		<content:encoded><![CDATA[<p>[&#8230;] The AppArmor vs SELinux debate trundles on. Joshua Brindle summed it up and I responded in the comments section (unfortunately the formatting got a bit mangled at the start there&#8230;..) - in short, the argument revolves around the fact that AppArmor restricts access to paths, and paths can be ambiguous (eg chroots/hardlinks/namespaces). The AA guys claim these features are exotic and rarely used and that the usability improvement is worth it, the SELinux guys claim that AA is &#8220;broken&#8221; because an unconfined app could help a confined app escape, the AA guys claim that wasn&#8217;t a part of their threat profile anyway, the SELinux guys say it&#8217;s broken again and so around we go. I&#8217;m reminded of some of the autopackage debates here &#8230;. [&#8230;]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bananamufu clone</title>
		<link>http://securityblog.org/brindle/2006/04/19/security-anti-pattern-path-based-access-control/#comment-12</link>
		<dc:creator>Bananamufu clone</dc:creator>
		<pubDate>Wed, 10 May 2006 14:01:32 +0000</pubDate>
		<guid isPermaLink="false">http://securityblog.org/brindle/2006/04/19/security-anti-pattern-path-based-access-control/#comment-12</guid>
		<description>Regarding Mike's reference to the AVC denial messages in his comment, I would like to say that, actually they might be "complex" to understand when you don't have experience working with SELinux, but due to the fact that there are support tools which can split, organize and look up messages and their properties, there's no need to mess with the "raw" output itself.

Right now, the best choice is the "Setools" package that has been recently updated ( http://tresys.com/selinux/selinux_policy_tools.shtml ). SeAudit and SeAudit-Report are the ones that will help you when dealing with AVC denials.

Also, as AVC denials are handled via the audit subsystem, designed and developed by Steve Grubb and others, you can use his tools to perform detailed analysis of the generated messages (audit ones and AVC denials).
Check  http://people.redhat.com/sgrubb/audit/index.html. There's also information on how to create graphs upon audit logs: http://people.redhat.com/sgrubb/audit/visualize/index.html

You can get them all in FC5 with the default repositories.</description>
		<content:encoded><![CDATA[<p>Regarding Mike&#8217;s reference to the AVC denial messages in his comment, I would like to say that, actually they might be &#8220;complex&#8221; to understand when you don&#8217;t have experience working with SELinux, but due to the fact that there are support tools which can split, organize and look up messages and their properties, there&#8217;s no need to mess with the &#8220;raw&#8221; output itself.</p>
<p>Right now, the best choice is the &#8220;Setools&#8221; package that has been recently updated ( <a href="http://tresys.com/selinux/selinux_policy_tools.shtml" rel="nofollow">http://tresys.com/selinux/selinux_policy_tools.shtml</a> ). SeAudit and SeAudit-Report are the ones that will help you when dealing with AVC denials.</p>
<p>Also, as AVC denials are handled via the audit subsystem, designed and developed by Steve Grubb and others, you can use his tools to perform detailed analysis of the generated messages (audit ones and AVC denials).<br />
Check  <a href="http://people.redhat.com/sgrubb/audit/index.html" rel="nofollow">http://people.redhat.com/sgrubb/audit/index.html</a>. There&#8217;s also information on how to create graphs upon audit logs: <a href="http://people.redhat.com/sgrubb/audit/visualize/index.html" rel="nofollow">http://people.redhat.com/sgrubb/audit/visualize/index.html</a></p>
<p>You can get them all in FC5 with the default repositories.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jbrindle</title>
		<link>http://securityblog.org/brindle/2006/04/19/security-anti-pattern-path-based-access-control/#comment-11</link>
		<dc:creator>jbrindle</dc:creator>
		<pubDate>Thu, 20 Apr 2006 17:50:36 +0000</pubDate>
		<guid isPermaLink="false">http://securityblog.org/brindle/2006/04/19/security-anti-pattern-path-based-access-control/#comment-11</guid>
		<description>&lt;blockquote&gt;Oh, one other point, SELinux in the real world appears to already be partly pathname based, as at least when I was using it Fedora would routinely naval-gaze for 10 minutes or so whilst it relabelled every file on the system according to regular expressions â€¦.. whilst I see this isnâ€™t quite the same thing, it does rather make one go â€œhmmmmâ€&lt;/blockquote&gt;

This sort of thing happened pretty often on old (e.g., FC2) Fedora but since then relabeling has really been limited to installation time, major policy changes and limited relabeling ala restorecon (when called by the user). 

File labels in general aren't suppose to change much, and correct type_transition rules will keep new files consistent for the most part (a few security relevant apps need to do more)</description>
		<content:encoded><![CDATA[<blockquote><p>Oh, one other point, SELinux in the real world appears to already be partly pathname based, as at least when I was using it Fedora would routinely naval-gaze for 10 minutes or so whilst it relabelled every file on the system according to regular expressions â€¦.. whilst I see this isnâ€™t quite the same thing, it does rather make one go â€œhmmmmâ€</p></blockquote>
<p>This sort of thing happened pretty often on old (e.g., FC2) Fedora but since then relabeling has really been limited to installation time, major policy changes and limited relabeling ala restorecon (when called by the user). </p>
<p>File labels in general aren&#8217;t suppose to change much, and correct type_transition rules will keep new files consistent for the most part (a few security relevant apps need to do more)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mike Hearn</title>
		<link>http://securityblog.org/brindle/2006/04/19/security-anti-pattern-path-based-access-control/#comment-10</link>
		<dc:creator>Mike Hearn</dc:creator>
		<pubDate>Thu, 20 Apr 2006 17:46:50 +0000</pubDate>
		<guid isPermaLink="false">http://securityblog.org/brindle/2006/04/19/security-anti-pattern-path-based-access-control/#comment-10</guid>
		<description>Oh, one other point, SELinux in the real world appears to already be partly pathname based, as at least when I was using it Fedora would routinely naval-gaze for 10 minutes or so whilst it relabelled every file on the system according to regular expressions ..... whilst I see this isn't quite the same thing, it does rather make one go "hmmmm"</description>
		<content:encoded><![CDATA[<p>Oh, one other point, SELinux in the real world appears to already be partly pathname based, as at least when I was using it Fedora would routinely naval-gaze for 10 minutes or so whilst it relabelled every file on the system according to regular expressions &#8230;.. whilst I see this isn&#8217;t quite the same thing, it does rather make one go &#8220;hmmmm&#8221;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mike Hearn</title>
		<link>http://securityblog.org/brindle/2006/04/19/security-anti-pattern-path-based-access-control/#comment-9</link>
		<dc:creator>Mike Hearn</dc:creator>
		<pubDate>Thu, 20 Apr 2006 17:43:50 +0000</pubDate>
		<guid isPermaLink="false">http://securityblog.org/brindle/2006/04/19/security-anti-pattern-path-based-access-control/#comment-9</guid>
		<description>Alright. I'm not taking sides in this debate, and I'm currently "on the fence" as regards to which I think is better out of AppArmor or SELinux. For my dissertation (which is related to security) I ended up using AppArmor, but I've also played with SELinux a fair bit on Fedora. So I've got a little bit of experience with both.

You've done a fine job of compiling some very compelling arguments against pathname based security. Here are some flip-side opinions put up for the purposes of debate. Again, I'd like to say that this doesn't mean I think your arguments are wrong or SELinux is Ease of use&lt;/strong&gt;

You claim this is a bogus argument because pathname security is "bad" as defined by your other points, therefore, it doesn't matter that some people find path security easier. 

Having used both SELinux and AppArmor there is no question in my mind which system is easier to use, and given that my needs did not include things like policy analysis and restricting the application I was confining from making hard links was not a problem, the benefits existed and should be considered.

So I would say you should not brush this aspect off. Whilst SELinux is arguably more complete, not every scenario requires completeness, in fact many don't. In these cases usability can be the dominant factor.

The other factor to consider apart from policy language is for instance this ....

Jul 10 02:44:17 new2 kernel: audit(1089441857.053:0): avc: denied { read } for pid=4121 exe=/bin/bash name=.bashrc dev=hda2 ino=130311 scontext=root:system_r:cupsd_t tcontext=root:object_r:staff_home_t tclass=file

vs 

type=APPARMOR msg=audit(1145112727.513:553): REJECTING r access to /home/mike/Desktop (wineserver(5405) profile /opt/wine/bin/wineserver active /opt/wine/bin/wineserver)

(yes I know they aren't exactly the same message). However for me there's no question which is clearer and the usability of the AVC Denied messages has been raised on the SELinux list before (eg the Python-&#62;English work).

Given that simplicity and usability are &lt;strong&gt;the&lt;/strong&gt; reasons to go with pathname based security, it deserves a more thorough treatment IMHO.

&lt;strong&gt;Paths are ambiguous&lt;/strong&gt;

This is why the namespace facilities in Linux require root to use them, right? Even though it'd be useful if they didn't. 

Firstly, this isn't exactly a fatal flaw for AppArmor, as it can simply deny the ability to hard link. Very few apps need that ability for their standard operation. Users may use it more often, but, it's not uncommon for users $HOMEs to be on filesystems separate to the main system, so, they couldn't hard link there either (and you can mount /tmp as tmpfs or something similar).

In other words whilst paths &lt;em&gt;can&lt;/em&gt; be ambiguous, often they aren't. This theme of common case compromise vs absolutism seems to be a recurring theme in SELinux v AppArmor debates.

It'd be nice if namespace manipulation was available to everybody, without needing root access. SELinux does not provide that ability currently as it cannot override DAC security, which blocks it for the same reasons (eg you could fool an app into loading an inappropriate library if you were able to do arbitrary namespace changes). But in theory it could provide that.

The question is, is it worth the additional level of abstraction possible? And is it possible to allow for mixing namespace manipulation and path based security at the same time?

For the common case of a server admin who wants to sandbox sendmail, maybe not.

&lt;strong&gt;Lack of object tranquility&lt;/strong&gt;

That can also be a strength as well as a weakness. For instance on Windows it's common to have a filesharing app which shares any files put in a certain directory. The files location determines whether it's viewable to the world or not. This is a commonly used setup, on any operating system.

The fact that SELinux does &lt;i&gt;not&lt;/i&gt; do this is one of the major reasons people find it confusing and it has gained a reputation for commonly being switched off (eg, I copied a file into /var/www and I can't view it in a web browser).

So I don't think this particular point is as black and white as you make out.

&lt;blockquote&gt;&lt;b&gt;For example, in the AppArmor evolution policy the â€œsubjectâ€ /opt/gnome/bin/evolution-2.4 is given access to read and write /home/*/.evolution/mail/*.&lt;/b&gt;&lt;/blockquote&gt;

It's entirely clear, to me at least, that the combination of DAC and AppArmor would do what is meant here. SELinux does not replace DAC, it only adds to it, and I've been told this is a feature. So it seems disingenuous to claim that this rule is a problem with AppArmor because it relies on DAC to "do what I mean".

&lt;blockquote&gt;&lt;b&gt;Path based systems canâ€™t differentiate between files downloaded by the browser and files put there by the user&lt;/b&gt;&lt;/blockquote&gt;

It would be trivial to add this ability using extended attributes and allowing a glob match on them, so I don't especially perceive this as a weakness. EAs to mark potentially unsafe files are already being talked about to deal with the fact that .desktop files can "appear" to be anything, including safe files like pictures.

&lt;b&gt;Not all objects are files&lt;/b&gt;

A path is simply a name for something. It's easy to invent a path scheme for naming objects that aren't actually files, in a way that doesn't disrupt the overall system or lower usability. For instance, I can imagine writing a profile like:

/usr/bin/my-update-agent {
      connect http://updates.mydistro.com/*;
}

/usr/bin/apache {
      listen http://eth0;
}

Or some better (real) syntax to express what I mean. 

Likewise some imaginary path for IPC keys, X windows and so on could be invented. You could even go as far to claim that having such objects accessible via the filesystem is good and correct OS design, for instance, Hans Reiser has made compelling arguments as to the benefits of namespace unification, and Plan9 was based on similar ideas.

OK, that's enough, your post is massive and my comment is getting that way too :) I haven't talked about policy analysis because really, I have no clue how to do that, and for the sorts of things I've been using AppArmor/SELinux for I didn't feel any need to do it either. When you're trying to confine every object on a system using MAC I can see why it'd be useful but, well, I'm not .....</description>
		<content:encoded><![CDATA[<p>Alright. I&#8217;m not taking sides in this debate, and I&#8217;m currently &#8220;on the fence&#8221; as regards to which I think is better out of AppArmor or SELinux. For my dissertation (which is related to security) I ended up using AppArmor, but I&#8217;ve also played with SELinux a fair bit on Fedora. So I&#8217;ve got a little bit of experience with both.</p>
<p>You&#8217;ve done a fine job of compiling some very compelling arguments against pathname based security. Here are some flip-side opinions put up for the purposes of debate. Again, I&#8217;d like to say that this doesn&#8217;t mean I think your arguments are wrong or SELinux is Ease of use</p>
<p>You claim this is a bogus argument because pathname security is &#8220;bad&#8221; as defined by your other points, therefore, it doesn&#8217;t matter that some people find path security easier. </p>
<p>Having used both SELinux and AppArmor there is no question in my mind which system is easier to use, and given that my needs did not include things like policy analysis and restricting the application I was confining from making hard links was not a problem, the benefits existed and should be considered.</p>
<p>So I would say you should not brush this aspect off. Whilst SELinux is arguably more complete, not every scenario requires completeness, in fact many don&#8217;t. In these cases usability can be the dominant factor.</p>
<p>The other factor to consider apart from policy language is for instance this &#8230;.</p>
<p>Jul 10 02:44:17 new2 kernel: audit(1089441857.053:0): avc: denied { read } for pid=4121 exe=/bin/bash name=.bashrc dev=hda2 ino=130311 scontext=root:system_r:cupsd_t tcontext=root:object_r:staff_home_t tclass=file</p>
<p>vs </p>
<p>type=APPARMOR msg=audit(1145112727.513:553): REJECTING r access to /home/mike/Desktop (wineserver(5405) profile /opt/wine/bin/wineserver active /opt/wine/bin/wineserver)</p>
<p>(yes I know they aren&#8217;t exactly the same message). However for me there&#8217;s no question which is clearer and the usability of the AVC Denied messages has been raised on the SELinux list before (eg the Python-&gt;English work).</p>
<p>Given that simplicity and usability are <strong>the</strong> reasons to go with pathname based security, it deserves a more thorough treatment IMHO.</p>
<p><strong>Paths are ambiguous</strong></p>
<p>This is why the namespace facilities in Linux require root to use them, right? Even though it&#8217;d be useful if they didn&#8217;t. </p>
<p>Firstly, this isn&#8217;t exactly a fatal flaw for AppArmor, as it can simply deny the ability to hard link. Very few apps need that ability for their standard operation. Users may use it more often, but, it&#8217;s not uncommon for users $HOMEs to be on filesystems separate to the main system, so, they couldn&#8217;t hard link there either (and you can mount /tmp as tmpfs or something similar).</p>
<p>In other words whilst paths <em>can</em> be ambiguous, often they aren&#8217;t. This theme of common case compromise vs absolutism seems to be a recurring theme in SELinux v AppArmor debates.</p>
<p>It&#8217;d be nice if namespace manipulation was available to everybody, without needing root access. SELinux does not provide that ability currently as it cannot override DAC security, which blocks it for the same reasons (eg you could fool an app into loading an inappropriate library if you were able to do arbitrary namespace changes). But in theory it could provide that.</p>
<p>The question is, is it worth the additional level of abstraction possible? And is it possible to allow for mixing namespace manipulation and path based security at the same time?</p>
<p>For the common case of a server admin who wants to sandbox sendmail, maybe not.</p>
<p><strong>Lack of object tranquility</strong></p>
<p>That can also be a strength as well as a weakness. For instance on Windows it&#8217;s common to have a filesharing app which shares any files put in a certain directory. The files location determines whether it&#8217;s viewable to the world or not. This is a commonly used setup, on any operating system.</p>
<p>The fact that SELinux does <i>not</i> do this is one of the major reasons people find it confusing and it has gained a reputation for commonly being switched off (eg, I copied a file into /var/www and I can&#8217;t view it in a web browser).</p>
<p>So I don&#8217;t think this particular point is as black and white as you make out.</p>
<blockquote><p><b>For example, in the AppArmor evolution policy the â€œsubjectâ€ /opt/gnome/bin/evolution-2.4 is given access to read and write /home/*/.evolution/mail/*.</b></p></blockquote>
<p>It&#8217;s entirely clear, to me at least, that the combination of DAC and AppArmor would do what is meant here. SELinux does not replace DAC, it only adds to it, and I&#8217;ve been told this is a feature. So it seems disingenuous to claim that this rule is a problem with AppArmor because it relies on DAC to &#8220;do what I mean&#8221;.</p>
<blockquote><p><b>Path based systems canâ€™t differentiate between files downloaded by the browser and files put there by the user</b></p></blockquote>
<p>It would be trivial to add this ability using extended attributes and allowing a glob match on them, so I don&#8217;t especially perceive this as a weakness. EAs to mark potentially unsafe files are already being talked about to deal with the fact that .desktop files can &#8220;appear&#8221; to be anything, including safe files like pictures.</p>
<p><b>Not all objects are files</b></p>
<p>A path is simply a name for something. It&#8217;s easy to invent a path scheme for naming objects that aren&#8217;t actually files, in a way that doesn&#8217;t disrupt the overall system or lower usability. For instance, I can imagine writing a profile like:</p>
<p>/usr/bin/my-update-agent {<br />
      connect <a href="http://updates.mydistro.com/" rel="nofollow">http://updates.mydistro.com/</a>*;<br />
}</p>
<p>/usr/bin/apache {<br />
      listen <a href="http://eth0" rel="nofollow">http://eth0</a>;<br />
}</p>
<p>Or some better (real) syntax to express what I mean. </p>
<p>Likewise some imaginary path for IPC keys, X windows and so on could be invented. You could even go as far to claim that having such objects accessible via the filesystem is good and correct OS design, for instance, Hans Reiser has made compelling arguments as to the benefits of namespace unification, and Plan9 was based on similar ideas.</p>
<p>OK, that&#8217;s enough, your post is massive and my comment is getting that way too <img src='http://securityblog.org/brindle/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> I haven&#8217;t talked about policy analysis because really, I have no clue how to do that, and for the sorts of things I&#8217;ve been using AppArmor/SELinux for I didn&#8217;t feel any need to do it either. When you&#8217;re trying to confine every object on a system using MAC I can see why it&#8217;d be useful but, well, I&#8217;m not &#8230;..</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joshua Brindle</title>
		<link>http://securityblog.org/brindle/2006/04/19/security-anti-pattern-path-based-access-control/#comment-8</link>
		<dc:creator>Joshua Brindle</dc:creator>
		<pubDate>Thu, 20 Apr 2006 17:40:27 +0000</pubDate>
		<guid isPermaLink="false">http://securityblog.org/brindle/2006/04/19/security-anti-pattern-path-based-access-control/#comment-8</guid>
		<description>&lt;blockquote&gt;Paths may be bad, but inodes are atrocious and attributes more than a little annoying since you lose them way too easily and you canâ€™t put attributes on files and directories that do not exist yet. So what do you propose?&lt;/blockquote&gt;
Extended attributes, like the file mode, owner, group, etc are stored with the inode. There was probably a similar struggle when file modes and owners were first introduced (a long long time ago). Tools had to evolve to handle these things and now you'd be hard pressed to find a tool that doesn't understand the file mode. This evolution will have to take place for extended attributes (not just for SELinux either..)
On the second point, some security relavent tools must be modified to set the context when creating the file, that is part of the same evolution. However, for non-security critical files something like &lt;a rel="nofollow" href="http://danwalsh.livejournal.com/4368.html"&gt;restorecond&lt;/a&gt;, which is a userland solution to the problem, can be used.
The problems you point out are usability/user interface problems and those can and should be addressed in userspace rather than the kernel.</description>
		<content:encoded><![CDATA[<blockquote><p>Paths may be bad, but inodes are atrocious and attributes more than a little annoying since you lose them way too easily and you canâ€™t put attributes on files and directories that do not exist yet. So what do you propose?</p></blockquote>
<p>Extended attributes, like the file mode, owner, group, etc are stored with the inode. There was probably a similar struggle when file modes and owners were first introduced (a long long time ago). Tools had to evolve to handle these things and now you&#8217;d be hard pressed to find a tool that doesn&#8217;t understand the file mode. This evolution will have to take place for extended attributes (not just for SELinux either..)<br />
On the second point, some security relavent tools must be modified to set the context when creating the file, that is part of the same evolution. However, for non-security critical files something like <a rel="nofollow" href="http://danwalsh.livejournal.com/4368.html">restorecond</a>, which is a userland solution to the problem, can be used.<br />
The problems you point out are usability/user interface problems and those can and should be addressed in userspace rather than the kernel.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Olivier Galibert</title>
		<link>http://securityblog.org/brindle/2006/04/19/security-anti-pattern-path-based-access-control/#comment-7</link>
		<dc:creator>Olivier Galibert</dc:creator>
		<pubDate>Thu, 20 Apr 2006 17:19:13 +0000</pubDate>
		<guid isPermaLink="false">http://securityblog.org/brindle/2006/04/19/security-anti-pattern-path-based-access-control/#comment-7</guid>
		<description>Paths may be bad, but inodes are atrocious and attributes more than a little annoying since you lose them way too easily and you can't put attributes on files and directories that do not exist yet.  So what do you propose?

  OG.</description>
		<content:encoded><![CDATA[<p>Paths may be bad, but inodes are atrocious and attributes more than a little annoying since you lose them way too easily and you can&#8217;t put attributes on files and directories that do not exist yet.  So what do you propose?</p>
<p>  OG.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
