<?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>epicblog &#187; SELinux</title>
	<atom:link href="http://www.rickwargo.com/category/selinux/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.rickwargo.com</link>
	<description>Acquiring information, one day at a time.</description>
	<lastBuildDate>Sat, 31 Jul 2010 20:29:39 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Pixel not working on FC6</title>
		<link>http://www.rickwargo.com/2006/11/03/pixel-not-working-on-fc6/</link>
		<comments>http://www.rickwargo.com/2006/11/03/pixel-not-working-on-fc6/#comments</comments>
		<pubDate>Fri, 03 Nov 2006 18:15:00 +0000</pubDate>
		<dc:creator>Rick Wargo</dc:creator>
				<category><![CDATA[SELinux]]></category>
		<category><![CDATA[WILT]]></category>

		<guid isPermaLink="false">http://www.rickwargo.com/2006/11/03/pixel-not-working-on-fc6/</guid>
		<description><![CDATA[I just came across this fabulous image manipulation program called Pixel, but it does not want to run or install under Fedora Core 6 (and I believe FC5, too). Problem is selinux is getting in the way. Pixel needs execmem privileges to install/run. Easiest thing to do now is to allow execmem with the following [...]]]></description>
			<content:encoded><![CDATA[<p>I just came across this <a target="_blank" title="Pixel" href="http://www.kanzelsberger.com/pixel/">fabulous image manipulation program called Pixel</a>, but it does not want to run or install under Fedora Core 6 (and I believe FC5, too). Problem is selinux is getting in the way. Pixel needs execmem privileges to install/run. Easiest thing to do now is to allow execmem with the following command:</p>
<p><code>sudo setsebool allow_execmem=1</code></p>
<p>You can always turn that off after running Pixel.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rickwargo.com/2006/11/03/pixel-not-working-on-fc6/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>FC6, SELinux and Nagios</title>
		<link>http://www.rickwargo.com/2006/10/29/fc6-selinux-and-nagios/</link>
		<comments>http://www.rickwargo.com/2006/10/29/fc6-selinux-and-nagios/#comments</comments>
		<pubDate>Sun, 29 Oct 2006 21:26:02 +0000</pubDate>
		<dc:creator>Rick Wargo</dc:creator>
				<category><![CDATA[SELinux]]></category>
		<category><![CDATA[WILT]]></category>
		<category><![CDATA[nagios]]></category>

		<guid isPermaLink="false">http://www.rickwargo.com/2006/10/29/fc6-selinux-and-nagios/</guid>
		<description><![CDATA[I love Nagios, but have been having issues with it running under SELinux targeted. I&#8217;ve finally made it work with no more AVC&#8217;s or other errors (so far!). Here is what I have done to get it to work: Install nagios. sudo yum install nagios sudo yum install &#039;nagios-plugins-*&#039; Make changes to nagios configuration to [...]]]></description>
			<content:encoded><![CDATA[<p>I love Nagios, but have been having issues with it running under SELinux targeted. I&#8217;ve finally made it work with no more AVC&#8217;s or other errors (so far!). Here is what I have done to get it to work:</p>
<ol>
<li>Install nagios.</li>
<ol>
<li><code>sudo yum install nagios</code></li>
<li><code>sudo yum install &#039;nagios-plugins-*&#039;</code></li>
</ol>
<li>Make changes to nagios configuration to account for your situation.</li>
<li>Make certain the permissions are correct.</li>
<ol>
<li>User <em>apache</em> needs read access to cfg files in /etc/nagios.</li>
<li>User <em>apache</em> needs read access to web site files under /usr/share/nagios/html.</li>
<li>If using resouces.cfg, only nagios needs access to read, not apache!</li>
<li>For the nagios.cmd fifo pipe (under /var/spool/nagios/cmd), permissions are 660, owner = nagios, group = apache.</li>
<li>cgi files need to be executable by apache</li>
<li>plugins need to be executable by nagios</li>
</ol>
<li>Set security contexts on files (all sone with sudo, of course)</li>
<ol>
<li><code>chcon -R -t httpd_sys_content_t /usr/share/nagios/html</code></li>
<li><code>chcon -R -t nagios_etc_t /etc/nagios</code></li>
<li><code>chcon -R -t nagios_log_t /var/log/nagios</code></li>
<li><code>chcon -R -t var_spool_t /var/spool/nagios</code></li>
<li><code>chcon -R -t bin_t /usr/lib/nagios/plugins</code></li>
<li><code>chcon -t nagios_cgi_exec_t /usr/lib/nagios/cgi-bin/*.cgi</code></li>
<li>/usr/sbin/nagios has a security domain type of sbin_t</li>
</ol>
<li>Apache alias is in /etc/httpd/conf.d/nagios.conf. Inspect and make changes as necessary. Restart httpd service.</li>
<li>The check_mem plugin was not working for me, it couldn&#8217;t find utils.pm. I had to add the following line to near the top of the script:</li>
<ol>
<li><code>use lib &quot;/usr/lib/nagios/plugins&quot; ;</code></li>
</ol>
<li>I needed to add some local security policy. Read on for details.</li>
</ol>
<p>There seems to be some holes in the policy for nagios. These are easily corrected with a little help from checkmodule.</p>
<p>First, need to install the SELinux tools to create new policies. These are not installed by default.</p>
<ol>
<li><code>sudo yum install checkpolicy</code></li>
<li><code>sudo yum install selinux-policy-devel</code></li>
</ol>
<p>There is a nice tool for troubleshooting policy called <a title="setroubleshoot wiki" target="_blank" href="http://fedoraproject.org/wiki/SELinux/setroubleshoot">setroubleshoot</a>. It is available at Dan Walsh&#8217;s yum repo. See <a title="Dan Walsh's blog describing repository for selinux stuff" target="_blank" href="http://danwalsh.livejournal.com/7435.html">his blog entry</a> for details. The <a title="Treysys SETools Home Page" target="_blank" href="http://oss.tresys.com/projects/setools">setools</a> are also quite helpful at inspecting policy (although I believe you need at least version 3 to inspect policy on fc6 where version 2.4 can inspect the audit logs).</p>
<p>I then went through the process of running/using nagios, inspecting the audit.log and taking the appropriate lines and running them through audit2allow -M</p>
<p>to generate the proper policy and then load the policy module. I had to do this process a number of times to make certain I captured all the AVC&#8217;s. I ended up with the following policy module (I&#8217;ve named it local, feel free to change its name if it conflicts. If you do, you need to make a change in the file, too).</p>
<p><pre><code>module local 1.0.0;
require {
class fifo_file read;
class fifo_file getattr;
class fifo_file write;
class dir search;
class process { sigkill signal };
type httpd_t;
type nagios_cgi_t;
type ping_t;
type var_spool_t;
role system_r;
};</code></pre></p>
<p>allow ping_t var_spool_t:fifo_file read;<br />
allow httpd_t nagios_cgi_t:process { sigkill signal };<br />
allow nagios_cgi_t var_spool_t:fifo_file getattr;<br />
allow nagios_cgi_t var_spool_t:dir search;<br />
allow nagios_cgi_t var_spool_t:fifo_file write;<br />
After capturing this in the file local.te, make the policy package with:</p>
<p>% <code>make -f /usr/share/selinux/devel/Makefile</code></p>
<p>This will ultimately create local.pp which then can be loaded by executing:</p>
<p>% <code>sudo semodule -i local.pp</code></p>
<p>A good review of all of this can be found in the <a title="SELinux FAQ (FC5)" href="http://fedora.redhat.com/docs/selinux-faq-fc5/">Red Hat SELinux FAQ</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rickwargo.com/2006/10/29/fc6-selinux-and-nagios/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Fedora Core 6 (FC6),  SELinux and Firefox</title>
		<link>http://www.rickwargo.com/2006/10/29/fedora-core-6-fc6-selinux-firefox/</link>
		<comments>http://www.rickwargo.com/2006/10/29/fedora-core-6-fc6-selinux-firefox/#comments</comments>
		<pubDate>Sun, 29 Oct 2006 20:20:44 +0000</pubDate>
		<dc:creator>Rick Wargo</dc:creator>
				<category><![CDATA[SELinux]]></category>
		<category><![CDATA[WILT]]></category>

		<guid isPermaLink="false">http://www.rickwargo.com/2006/10/29/fedora-core-6-fc6-selinux-firefox/</guid>
		<description><![CDATA[I have to admit that I haven&#8217;t played with SELinux since a few releases back and there has been a lot of change since then. It&#8217;s now so much easier to write modular policy and incorporate that, along with some nice GUI tools to inspect the AVC&#8217;s. It&#8217;s only been a few hours, but I&#8217;m [...]]]></description>
			<content:encoded><![CDATA[<p>I have to admit that I haven&#8217;t played with SELinux since a few releases back and there has been a lot of change since then. It&#8217;s now so much easier to write modular policy and incorporate that, along with some nice GUI tools to inspect the AVC&#8217;s. It&#8217;s only been a few hours, but I&#8217;m just starting to get the hang of it! And in the process, noticed something completely scary: Firefox trying to execute code on its stack! Now, I&#8217;m hoping it is a bug, or it&#8217;s SELinux 1, Intruders 0.</p>
<p>Here the entry from audit.log:</p>
<blockquote><p>type=AVC msg=audit(1162142793.550:1565): avc:  denied  { execstack } for  pid=4957 comm=&#8221;firefox-bin&#8221; scontext=user_u:system_r:unconfined_t:s0 tcontext=user_u:system_r:unconfined_t:s0 tclass=process</p></blockquote>
<p>I&#8217;m not sure why firefox would want to do this, so maybe it is one of the plugins?</p>
<p>Firefox specifics follow:</p>
<p>Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.0.7) Gecko/20061011 Fedora/1.5.0.7-7.fc6 Firefox/1.5.0.7</p>
<ul>
<li>DOM Inspector 1.8.0.7</li>
<li>Web Developer 1.0.2</li>
<li>Download Statusbar 0.9.4.3</li>
<li>Map+ 1.1.0</li>
<li>FireBug 0.4.1</li>
<li>Open Link Host 1.3.1</li>
<li>EditCSS 0.3.6</li>
<li>JavaScript Debugger 0.9.87</li>
<li>All-in-One Gestures 0.18.0</li>
<li>Bookmarks Synchronizer 3 1.0.2</li>
<li>Google Toolbar for Firefox 2.1.20060807L</li>
</ul>
<p>BTW, I&#8217;m loving the new Gnome Desktop Effects in FC6!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rickwargo.com/2006/10/29/fedora-core-6-fc6-selinux-firefox/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
