<?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"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments for Diego Búrigo Zacarão's Weblog</title>
	<atom:link href="http://diegobz.net/comments/feed/" rel="self" type="application/rss+xml" />
	<link>http://diegobz.net</link>
	<description>Let me talk about something</description>
	<lastBuildDate>Mon, 08 Mar 2010 11:01:06 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>Comment on Enabling apache UserDir (public_html) with SELinux enabled on Fedora by dgrift</title>
		<link>http://diegobz.net/2010/03/07/enabling-apache-userdir-public_html-with-selinux-enabled-on-fedora/comment-page-1/#comment-2191</link>
		<dc:creator>dgrift</dc:creator>
		<pubDate>Mon, 08 Mar 2010 11:01:06 +0000</pubDate>
		<guid isPermaLink="false">http://diegobz.net/?p=309#comment-2191</guid>
		<description>httpd_selinux.8 should be updated to reflect this and the wiki should be updated with the updated man page. I will make a note in my to do list.

Thanks</description>
		<content:encoded><![CDATA[<p>httpd_selinux.8 should be updated to reflect this and the wiki should be updated with the updated man page. I will make a note in my to do list.</p>
<p>Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Enabling apache UserDir (public_html) with SELinux enabled on Fedora by diegobz</title>
		<link>http://diegobz.net/2010/03/07/enabling-apache-userdir-public_html-with-selinux-enabled-on-fedora/comment-page-1/#comment-2190</link>
		<dc:creator>diegobz</dc:creator>
		<pubDate>Mon, 08 Mar 2010 01:56:10 +0000</pubDate>
		<guid isPermaLink="false">http://diegobz.net/?p=309#comment-2190</guid>
		<description>@dgrift:
About the &#039;chcon&#039; I took that info from the Fedora wiki[1], which says:

&quot;httpd by default is not allowed to access users home  directories.   If
you  want to allow access to users home directories you need to set the httpd_enable_homedirs boolean and change the context of the files that you want people to access off the home dir.

setsebool -P httpd_enable_homedirs 1
chcon -R -t httpd_sys_content_t ~user/public_html&quot;

Maybe I misunderstood something or should it be updated?
About the missing &#039;-P&#039;, it was a typo in that line, yes.

[1] http://fedoraproject.org/wiki/SELinux/apache</description>
		<content:encoded><![CDATA[<p>@dgrift:<br />
About the &#8216;chcon&#8217; I took that info from the Fedora wiki[1], which says:</p>
<p>&#8220;httpd by default is not allowed to access users home  directories.   If<br />
you  want to allow access to users home directories you need to set the httpd_enable_homedirs boolean and change the context of the files that you want people to access off the home dir.</p>
<p>setsebool -P httpd_enable_homedirs 1<br />
chcon -R -t httpd_sys_content_t ~user/public_html&#8221;</p>
<p>Maybe I misunderstood something or should it be updated?<br />
About the missing &#8216;-P&#8217;, it was a typo in that line, yes.</p>
<p>[1] <a href="http://fedoraproject.org/wiki/SELinux/apache" rel="nofollow">http://fedoraproject.org/wiki/SELinux/apache</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Enabling apache UserDir (public_html) with SELinux enabled on Fedora by dgrift</title>
		<link>http://diegobz.net/2010/03/07/enabling-apache-userdir-public_html-with-selinux-enabled-on-fedora/comment-page-1/#comment-2189</link>
		<dc:creator>dgrift</dc:creator>
		<pubDate>Sun, 07 Mar 2010 23:00:42 +0000</pubDate>
		<guid isPermaLink="false">http://diegobz.net/?p=309#comment-2189</guid>
		<description>The boolean: httpd_enable_homedirs should be set to true , indeed.
But use: setsebool -P httpd_enable_homedirs true
The -P will make the setting persistent accros reboots. If you do not use -P than the boolean will be reset to false when you restart the system.

You should not &quot;chcon -R -t httpd_sys_content_t ~/public_html&quot;.

There is already a file context specified system wide for ~/public_html.

matchpathcon /home/dgrift/public_html
/home/dgrift/public_html        staff_u:object_r:httpd_user_content_t:s0

This is the type that httpd_t can read and SELinux restricted users can interact with in the user home.

There is one thing to consider: If you operate in a Gnome environment than there is a program called restorecond -u running in the gnome-session. That program monitors objects in your user home directory and if required restores their context to the context that is specified system wide for that location.

So if you create ~/public_html it should in that case almost immediately get type httpd_user_content_t. That is because that is specified system-wide and restorecond -u makes sure that the objects in your user home directory are correctly labelled.

What happens is: you create ~/public_html. That directory gets created with the type of generic user home content (user_home_t). Restorecond -u notices that the directory is misslabeled and restores it to the context specified system wide for that location.

So in a Gnome environment you should not have to run the restorecon command manually.

In a text environment there is no restorecond -u running, thus users should manually restorecon -R -v ~/public_html

The type httpd_sys_content_t is a type designed for system content (/var/www) that httpd can read.

It is not designed for content in ~, but in many cases it does work.

Once you start restricting users with SELinux , you will notice that these restricted users are not permitted to interact with objects labelled httpd_sys_content_t.

They are however permitted to interact and use type httpd_user_content_t.

About chcon. Contexts set using chcon are not persistent. When you relabel or run the restorecon command on a location that has been &quot;chcond&quot;, than the context of the location will be reset to the context that is specified system-wide (for example using semanage fcontext)

Not everyone will agree with this: but privileged users should use the semanage command where ever possible to specify file contexts (because its persistent). Unprivileged users can use chcon wherever they are permitted to (will be overriden by similar contexts specified using semanage)</description>
		<content:encoded><![CDATA[<p>The boolean: httpd_enable_homedirs should be set to true , indeed.<br />
But use: setsebool -P httpd_enable_homedirs true<br />
The -P will make the setting persistent accros reboots. If you do not use -P than the boolean will be reset to false when you restart the system.</p>
<p>You should not &#8220;chcon -R -t httpd_sys_content_t ~/public_html&#8221;.</p>
<p>There is already a file context specified system wide for ~/public_html.</p>
<p>matchpathcon /home/dgrift/public_html<br />
/home/dgrift/public_html        staff_u:object_r:httpd_user_content_t:s0</p>
<p>This is the type that httpd_t can read and SELinux restricted users can interact with in the user home.</p>
<p>There is one thing to consider: If you operate in a Gnome environment than there is a program called restorecond -u running in the gnome-session. That program monitors objects in your user home directory and if required restores their context to the context that is specified system wide for that location.</p>
<p>So if you create ~/public_html it should in that case almost immediately get type httpd_user_content_t. That is because that is specified system-wide and restorecond -u makes sure that the objects in your user home directory are correctly labelled.</p>
<p>What happens is: you create ~/public_html. That directory gets created with the type of generic user home content (user_home_t). Restorecond -u notices that the directory is misslabeled and restores it to the context specified system wide for that location.</p>
<p>So in a Gnome environment you should not have to run the restorecon command manually.</p>
<p>In a text environment there is no restorecond -u running, thus users should manually restorecon -R -v ~/public_html</p>
<p>The type httpd_sys_content_t is a type designed for system content (/var/www) that httpd can read.</p>
<p>It is not designed for content in ~, but in many cases it does work.</p>
<p>Once you start restricting users with SELinux , you will notice that these restricted users are not permitted to interact with objects labelled httpd_sys_content_t.</p>
<p>They are however permitted to interact and use type httpd_user_content_t.</p>
<p>About chcon. Contexts set using chcon are not persistent. When you relabel or run the restorecon command on a location that has been &#8220;chcond&#8221;, than the context of the location will be reset to the context that is specified system-wide (for example using semanage fcontext)</p>
<p>Not everyone will agree with this: but privileged users should use the semanage command where ever possible to specify file contexts (because its persistent). Unprivileged users can use chcon wherever they are permitted to (will be overriden by similar contexts specified using semanage)</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Enabling apache UserDir (public_html) with SELinux enabled on Fedora by dgrift</title>
		<link>http://diegobz.net/2010/03/07/enabling-apache-userdir-public_html-with-selinux-enabled-on-fedora/comment-page-1/#comment-2188</link>
		<dc:creator>dgrift</dc:creator>
		<pubDate>Sun, 07 Mar 2010 22:33:37 +0000</pubDate>
		<guid isPermaLink="false">http://diegobz.net/?p=309#comment-2188</guid>
		<description>Often you only need to toggle the httpd_enable_homedirs boolean.

The default file context specification for ~/public_html is:

# matchpathcon /home/dgrift/public_html
/home/dgrift/public_html        staff_u:object_r:httpd_user_content_t:s0

Apache can read that. No need to use type: httpd_sys_content_t.

There is one consideration:

In a Gnome environment a program called restorecond is running in the gnome session. This program monitors objects in your $HOME and restores file contexts to the contexts specified if required.

So if you create directory ~public_html and do ls -alZ ~/public_html
it should have type httpd_user_content_t. (the directory is created with type user_home_t (the generic type for user home content), but restorecond -u immediately notices a directory with a context that does not match directory/context defined, and restores it to defined file context (httpd_user_content_t)

If you run in a text only environment, then there is no restorecond -u to watch, and so you or your users should run the restorecon command on ~/public_html. That will reset the context of the location to what is specified system wide.

restorecon -R -v ~/public_html

Using httpd_sys_content_t might in some cases work but it is a wrong type to use because (confined) users do not have permission to interact with that type. You will not notice this in default configurations because users are unconfined (unrestricted).</description>
		<content:encoded><![CDATA[<p>Often you only need to toggle the httpd_enable_homedirs boolean.</p>
<p>The default file context specification for ~/public_html is:</p>
<p># matchpathcon /home/dgrift/public_html<br />
/home/dgrift/public_html        staff_u:object_r:httpd_user_content_t:s0</p>
<p>Apache can read that. No need to use type: httpd_sys_content_t.</p>
<p>There is one consideration:</p>
<p>In a Gnome environment a program called restorecond is running in the gnome session. This program monitors objects in your $HOME and restores file contexts to the contexts specified if required.</p>
<p>So if you create directory ~public_html and do ls -alZ ~/public_html<br />
it should have type httpd_user_content_t. (the directory is created with type user_home_t (the generic type for user home content), but restorecond -u immediately notices a directory with a context that does not match directory/context defined, and restores it to defined file context (httpd_user_content_t)</p>
<p>If you run in a text only environment, then there is no restorecond -u to watch, and so you or your users should run the restorecon command on ~/public_html. That will reset the context of the location to what is specified system wide.</p>
<p>restorecon -R -v ~/public_html</p>
<p>Using httpd_sys_content_t might in some cases work but it is a wrong type to use because (confined) users do not have permission to interact with that type. You will not notice this in default configurations because users are unconfined (unrestricted).</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Enabling apache UserDir (public_html) with SELinux enabled on Fedora by Diego Búrigo Zacarão: Enabling apache UserDir (public_html) with SELinux enabled on Fedora &#124; TuxWire : The Linux Blog Aggregator</title>
		<link>http://diegobz.net/2010/03/07/enabling-apache-userdir-public_html-with-selinux-enabled-on-fedora/comment-page-1/#comment-2186</link>
		<dc:creator>Diego Búrigo Zacarão: Enabling apache UserDir (public_html) with SELinux enabled on Fedora &#124; TuxWire : The Linux Blog Aggregator</dc:creator>
		<pubDate>Sun, 07 Mar 2010 21:12:51 +0000</pubDate>
		<guid isPermaLink="false">http://diegobz.net/?p=309#comment-2186</guid>
		<description>[...] Continued here: Diego Búrigo Zacarão: Enabling apache UserDir (public_html) with SELinux enabled on Fedora [...]</description>
		<content:encoded><![CDATA[<p>[...] Continued here: Diego Búrigo Zacarão: Enabling apache UserDir (public_html) with SELinux enabled on Fedora [...]</p>
]]></content:encoded>
	</item>
</channel>
</rss>
