<?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: Misunderstanding UNIX security</title>
	<atom:link href="http://securityblog.org/brindle/2007/07/15/misunderstanding-unix-security/feed/" rel="self" type="application/rss+xml" />
	<link>http://securityblog.org/brindle/2007/07/15/misunderstanding-unix-security/</link>
	<description>The ramblings of security neophyte Joshua Brindle</description>
	<pubDate>Sat, 17 May 2008 02:45:37 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5</generator>
		<item>
		<title>By: Toshi</title>
		<link>http://securityblog.org/brindle/2007/07/15/misunderstanding-unix-security/#comment-16512</link>
		<dc:creator>Toshi</dc:creator>
		<pubDate>Wed, 15 Aug 2007 02:14:00 +0000</pubDate>
		<guid isPermaLink="false">http://securityblog.org/brindle/2007/07/15/misunderstanding-unix-security/#comment-16512</guid>
		<description>Dear Joshua,

First of all, I do apologize if you felt my message uncomfortable and not respectful for any reason.  Believe me.  I just didn't mean it at all.  Maybe I might have chosen the wrong place for my posting. Anyway, my points were:

Yes, path name can be varied (therefore path names should be taken care)
Yes, inode for given object is unaffected (unchanged) and it's one of the advantages of the label based security.
No, the example shown above does not prove the path name MAC's fatal shortage

You kindly took your time to attend TOMOYO Linux BoF at OLS2007 (I really appreciated that and your advice that's why I'm reading your Blog), so I assume you know how I evaluate SELinux and label based MAC.  I never say path based MAC is better or more reliable, but I think path based MAC can be used for some place as an “option” or supplemental tool.

Again, I apologize for my previous posting.</description>
		<content:encoded><![CDATA[<p>Dear Joshua,</p>
<p>First of all, I do apologize if you felt my message uncomfortable and not respectful for any reason.  Believe me.  I just didn&#8217;t mean it at all.  Maybe I might have chosen the wrong place for my posting. Anyway, my points were:</p>
<p>Yes, path name can be varied (therefore path names should be taken care)<br />
Yes, inode for given object is unaffected (unchanged) and it&#8217;s one of the advantages of the label based security.<br />
No, the example shown above does not prove the path name MAC&#8217;s fatal shortage</p>
<p>You kindly took your time to attend TOMOYO Linux BoF at OLS2007 (I really appreciated that and your advice that&#8217;s why I&#8217;m reading your Blog), so I assume you know how I evaluate SELinux and label based MAC.  I never say path based MAC is better or more reliable, but I think path based MAC can be used for some place as an “option” or supplemental tool.</p>
<p>Again, I apologize for my previous posting.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joshua Brindle</title>
		<link>http://securityblog.org/brindle/2007/07/15/misunderstanding-unix-security/#comment-16431</link>
		<dc:creator>Joshua Brindle</dc:creator>
		<pubDate>Mon, 13 Aug 2007 00:17:27 +0000</pubDate>
		<guid isPermaLink="false">http://securityblog.org/brindle/2007/07/15/misunderstanding-unix-security/#comment-16431</guid>
		<description>@Toshi

This example has nothing to do with path based access control mechanisms or TOMOYO, it has to do with how hardlinks work on unix systems and how DAC permissions are attached to the inode. Please be a little more respectful and try to understand the post in the future.</description>
		<content:encoded><![CDATA[<p>@Toshi</p>
<p>This example has nothing to do with path based access control mechanisms or TOMOYO, it has to do with how hardlinks work on unix systems and how DAC permissions are attached to the inode. Please be a little more respectful and try to understand the post in the future.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Toshi</title>
		<link>http://securityblog.org/brindle/2007/07/15/misunderstanding-unix-security/#comment-15822</link>
		<dc:creator>Toshi</dc:creator>
		<pubDate>Mon, 30 Jul 2007 14:59:47 +0000</pubDate>
		<guid isPermaLink="false">http://securityblog.org/brindle/2007/07/15/misunderstanding-unix-security/#comment-15822</guid>
		<description>Brindle,

I'm afraid but your example is too simple minded and not realistic.

How come you can expect "# ln /etc/shadow /tmp/shadow" succeed?
Have you ever tried that with path-based MAC?

It will fail unless you explicitly grant it in the policy definition at least
with TOMOYO Linux. :)</description>
		<content:encoded><![CDATA[<p>Brindle,</p>
<p>I&#8217;m afraid but your example is too simple minded and not realistic.</p>
<p>How come you can expect &#8220;# ln /etc/shadow /tmp/shadow&#8221; succeed?<br />
Have you ever tried that with path-based MAC?</p>
<p>It will fail unless you explicitly grant it in the policy definition at least<br />
with TOMOYO Linux. <img src='http://securityblog.org/brindle/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joel</title>
		<link>http://securityblog.org/brindle/2007/07/15/misunderstanding-unix-security/#comment-15483</link>
		<dc:creator>Joel</dc:creator>
		<pubDate>Fri, 20 Jul 2007 14:32:14 +0000</pubDate>
		<guid isPermaLink="false">http://securityblog.org/brindle/2007/07/15/misunderstanding-unix-security/#comment-15483</guid>
		<description>@Vincent: the reason is that you prevented access to the DIRECTORY (and thus all files in the directory, simply because you cannot read the directory).  If you were somehow able to get into the directory (by, for example, restoring rx permissions, cd-ing into the directory and then removing rx permissions again), you would find that you can indeed cat the file.</description>
		<content:encoded><![CDATA[<p>@Vincent: the reason is that you prevented access to the DIRECTORY (and thus all files in the directory, simply because you cannot read the directory).  If you were somehow able to get into the directory (by, for example, restoring rx permissions, cd-ing into the directory and then removing rx permissions again), you would find that you can indeed cat the file.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Vincent</title>
		<link>http://securityblog.org/brindle/2007/07/15/misunderstanding-unix-security/#comment-15470</link>
		<dc:creator>Vincent</dc:creator>
		<pubDate>Fri, 20 Jul 2007 09:46:26 +0000</pubDate>
		<guid isPermaLink="false">http://securityblog.org/brindle/2007/07/15/misunderstanding-unix-security/#comment-15470</guid>
		<description>&lt;blockquote&gt;the UNIX permissions absolutely do not have anything to do with paths, only with inodes&lt;/blockquote&gt;

As much as I agree that inode-based security is the way to go, there are times when your staement isn't true. For example :

&lt;code&gt;
#mkdir d1 d2
#echo hello &#62; d1/f1
#ln d1/f1 d2/f2
#ls -i d*/
d1/:
1479281 f1

d2/:
1479281 f2
#chmod -wrx d1
#cat d1/f1
cat: d1/f1: Permission denied
#cat d2/f2
hello
&lt;/code&gt;</description>
		<content:encoded><![CDATA[<blockquote><p>the UNIX permissions absolutely do not have anything to do with paths, only with inodes</p></blockquote>
<p>As much as I agree that inode-based security is the way to go, there are times when your staement isn&#8217;t true. For example :</p>
<p><code><br />
#mkdir d1 d2<br />
#echo hello &gt; d1/f1<br />
#ln d1/f1 d2/f2<br />
#ls -i d*/<br />
d1/:<br />
1479281 f1</p>
<p>d2/:<br />
1479281 f2<br />
#chmod -wrx d1<br />
#cat d1/f1<br />
cat: d1/f1: Permission denied<br />
#cat d2/f2<br />
hello<br />
</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kototama</title>
		<link>http://securityblog.org/brindle/2007/07/15/misunderstanding-unix-security/#comment-15387</link>
		<dc:creator>Kototama</dc:creator>
		<pubDate>Wed, 18 Jul 2007 17:35:07 +0000</pubDate>
		<guid isPermaLink="false">http://securityblog.org/brindle/2007/07/15/misunderstanding-unix-security/#comment-15387</guid>
		<description>Thanks to your blog know I understand far better why AppArmor and SELinux are not comparable and why the advertisement on AppArmor (they speak about "process containment" whereas its does only contains files accesses) is misleading. Thanks to you now I can see that AppArmor doesn't do full MAC and other weakness.</description>
		<content:encoded><![CDATA[<p>Thanks to your blog know I understand far better why AppArmor and SELinux are not comparable and why the advertisement on AppArmor (they speak about &#8220;process containment&#8221; whereas its does only contains files accesses) is misleading. Thanks to you now I can see that AppArmor doesn&#8217;t do full MAC and other weakness.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bruno Wolff III</title>
		<link>http://securityblog.org/brindle/2007/07/15/misunderstanding-unix-security/#comment-15252</link>
		<dc:creator>Bruno Wolff III</dc:creator>
		<pubDate>Mon, 16 Jul 2007 19:06:17 +0000</pubDate>
		<guid isPermaLink="false">http://securityblog.org/brindle/2007/07/15/misunderstanding-unix-security/#comment-15252</guid>
		<description>Thanks for that information.
I probably ran across that somewhere but missed it; as I would expect the process and initial directory context to be used in determining the context of a newly created file. But most of what I had run across had either mentioned the 'normal' getting the context from the directory (independent of the process context) or dealt with relabelingand I had probably forgotten the better explanation.
I see that the data used for relabeling in Fedora is not the same as what was used to label files originally and is more dangerous than I previously thought. I also see why restorecond (in Fedora) might be used to keep users from accidentally leaving mislabeled config files in /etc. But also that one might not to run it and instead be more careful about editing config files instead.</description>
		<content:encoded><![CDATA[<p>Thanks for that information.<br />
I probably ran across that somewhere but missed it; as I would expect the process and initial directory context to be used in determining the context of a newly created file. But most of what I had run across had either mentioned the &#8216;normal&#8217; getting the context from the directory (independent of the process context) or dealt with relabelingand I had probably forgotten the better explanation.<br />
I see that the data used for relabeling in Fedora is not the same as what was used to label files originally and is more dangerous than I previously thought. I also see why restorecond (in Fedora) might be used to keep users from accidentally leaving mislabeled config files in /etc. But also that one might not to run it and instead be more careful about editing config files instead.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joshua Brindle</title>
		<link>http://securityblog.org/brindle/2007/07/15/misunderstanding-unix-security/#comment-15247</link>
		<dc:creator>Joshua Brindle</dc:creator>
		<pubDate>Mon, 16 Jul 2007 18:03:11 +0000</pubDate>
		<guid isPermaLink="false">http://securityblog.org/brindle/2007/07/15/misunderstanding-unix-security/#comment-15247</guid>
		<description>Bruno:

Yes, the policy has type_transition statements that dictate how files get created. For example in the policy you might see something like:

type_transition user_t tmp_t : file user_tmp_t;

this means that if a process running as user_t (most user processes on the strict policy) creates a file in tmp_t (generally the label for the /tmp directory) then the file is created as user_tmp_t. This allows people to write files to /tmp and know that they won't be accessible by other processes that aren't allowed to read files with that label.

This is one huge advantage over path based mechanisms, if a sys admin logs in via ssh and has a key agent running the socket will be sysadm_sshd_tmp_t in /tmp, so it won't be accessible by others, even if they have the same UID. However, since the ssh files are fairly random (/tmp/ssh-XXXXXXX) where the X's are random numbers/letters path based mechanisms cannot protect them and instead rely on DAC to do so.</description>
		<content:encoded><![CDATA[<p>Bruno:</p>
<p>Yes, the policy has type_transition statements that dictate how files get created. For example in the policy you might see something like:</p>
<p>type_transition user_t tmp_t : file user_tmp_t;</p>
<p>this means that if a process running as user_t (most user processes on the strict policy) creates a file in tmp_t (generally the label for the /tmp directory) then the file is created as user_tmp_t. This allows people to write files to /tmp and know that they won&#8217;t be accessible by other processes that aren&#8217;t allowed to read files with that label.</p>
<p>This is one huge advantage over path based mechanisms, if a sys admin logs in via ssh and has a key agent running the socket will be sysadm_sshd_tmp_t in /tmp, so it won&#8217;t be accessible by others, even if they have the same UID. However, since the ssh files are fairly random (/tmp/ssh-XXXXXXX) where the X&#8217;s are random numbers/letters path based mechanisms cannot protect them and instead rely on DAC to do so.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bruno Wolff III</title>
		<link>http://securityblog.org/brindle/2007/07/15/misunderstanding-unix-security/#comment-15246</link>
		<dc:creator>Bruno Wolff III</dc:creator>
		<pubDate>Mon, 16 Jul 2007 17:50:54 +0000</pubDate>
		<guid isPermaLink="false">http://securityblog.org/brindle/2007/07/15/misunderstanding-unix-security/#comment-15246</guid>
		<description>Is there a way to control what context is initially assigned to a newly created file? From what I've found so far it looks like files get the context of the containing directory and that if an application wants something different it needs to make another system call to change it.
It seems that there should be a way to control the context used for files created by an application without having them hard wired into the application or dependent on the application creating files only in certain directories. While policy can block creating files with inappropiate contexts, it doesn't seem to be able to provide a way to default an appropiate one.</description>
		<content:encoded><![CDATA[<p>Is there a way to control what context is initially assigned to a newly created file? From what I&#8217;ve found so far it looks like files get the context of the containing directory and that if an application wants something different it needs to make another system call to change it.<br />
It seems that there should be a way to control the context used for files created by an application without having them hard wired into the application or dependent on the application creating files only in certain directories. While policy can block creating files with inappropiate contexts, it doesn&#8217;t seem to be able to provide a way to default an appropiate one.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: fa</title>
		<link>http://securityblog.org/brindle/2007/07/15/misunderstanding-unix-security/#comment-15186</link>
		<dc:creator>fa</dc:creator>
		<pubDate>Sun, 15 Jul 2007 18:11:36 +0000</pubDate>
		<guid isPermaLink="false">http://securityblog.org/brindle/2007/07/15/misunderstanding-unix-security/#comment-15186</guid>
		<description>Hello, good post.
I know this is unrelated but would you mind writing about the SELinux policy server project, anyway thanks a lot</description>
		<content:encoded><![CDATA[<p>Hello, good post.<br />
I know this is unrelated but would you mind writing about the SELinux policy server project, anyway thanks a lot</p>
]]></content:encoded>
	</item>
</channel>
</rss>
