<?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>Beyond Abstraction &#187; SELinux</title>
	<atom:link href="http://beyondabstraction.net/category/computers/security/selinux/feed/" rel="self" type="application/rss+xml" />
	<link>http://beyondabstraction.net</link>
	<description>Meanderings and Such...</description>
	<lastBuildDate>Wed, 28 Mar 2012 18:39:32 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Server Migration</title>
		<link>http://beyondabstraction.net/2008/03/08/server-migration/</link>
		<comments>http://beyondabstraction.net/2008/03/08/server-migration/#comments</comments>
		<pubDate>Sat, 08 Mar 2008 19:16:33 +0000</pubDate>
		<dc:creator>spencer</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[hardware]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[SELinux]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[brickwall]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[migration]]></category>
		<category><![CDATA[rhel]]></category>

		<guid isPermaLink="false">http://beyondabstraction.net/2008/03/08/server-migration/</guid>
		<description><![CDATA[It&#8217;s been three years since we upgraded the hardware that hosts our various sites. I contacted my provider (Crucial Paradigm) and got some competitive offers. Stefan, my friend in Berlin that I split the server with, and I agreed on the following specs: Athlon 64 x2 4000 (2 cores @ 2.1GHz, 512K L2 each) 4GB &#8230; </p><p><a class="more-link block-button" href="http://beyondabstraction.net/2008/03/08/server-migration/">Continue reading &#187;</a>]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s been <a href="http://beyondabstraction.net/2005/03/03/new-server-and-the-seframework/" title="Old, New Hardware">three years since we upgraded the hardware</a> that hosts our various sites.  I contacted my provider (Crucial Paradigm) and got some competitive offers. Stefan, my friend in Berlin that I split the server with, and I agreed on the following specs:</p>
<ul>
<li>Athlon 64 x2 4000 (2 cores @ 2.1GHz, 512K L2 each)</li>
<li>4GB RAM, 160GB SATA, 100Mbps</li>
<li><a href="http://www.centos.org">CentOS 5</a></li>
<li>Apache, BIND, MySQL, Postifx, Spam Assassin, ClamAV, Cyrus IMAP</li>
<li>SELinux enforcing</li>
</ul>
<p>Once again this is going to be a dedicated, remote, hosted server.  A few days later and they contacted me with the login information.  I&#8217;m going to describe the move from a high-level.  I&#8217;m not going to go through the individual config file modifications or how to dump a Cyrus database.</p>
<p><span id="more-113"></span></p>
<p>It only took me about a day to prep the new system for the move.  Stefan was gone for a week so I could move pretty much all of my stuff but I would wait until he got back to move the shared mail services.  It is rather difficult to incrementally move users from one system to another using Cyrus so I just did a test migration of the IMAP spools and databases but waited on actually updating the DNS MX records.  </p>
<p>First I updated the glue records and name servers at my registrar.  I made the new system master and the old system I just modified to run as a slave.  I also had Josh fix his config since he is my DNS buddy (I highly recommend using the DNS buddy system).  With DNS up and running I added entries for the new server.</p>
<p>Then I moved my website.  I just dumped my databases and pulled them into the new system.  A few Apache tweaks and everything was good to go.  I was pulling my hair out at one point trying to figure out why the CentOS default page was appearing but I finally tracked it down to a welcome.conf configuration file.  I removed that and found I could debug Apache config problems more easily.</p>
<p>I decided to tackle all of the SSL stuff at once.  I setup Apache, Cyrus, and Postfix w/ certs and CAs.  I tested each service to ensure I had the directory permissions correct and had the authentication mechanisms properly configured.  It is at this point that I tested a Cyrus migration knowing that I would be repeating the process again later.  </p>
<p>Then I moved on to configuring the rest of the Postfix chain using Amavis, Spam Assassin, and ClamAV.  There was plenty of documentation on this process available online.  Note that ClamAV (and maybe a few of the others) are only available in the rpmforge yum repos.  These programs aren&#8217;t officially part of the CentOS/RHEL distributions but are commonly used by the user communities.  As a result their configuration files don&#8217;t mesh precisely with the rest of the services, for example storing the virus database in /var/clamav by default instead of /var/lib/clamav.  I fixed these discrepancies and would recommend you do the same.  It did take me a while to track all of these down.  freshclam (the ClamAV updater) was running from a Cron job.  It was trying to write to &#8220;/var/clamav&#8221; which didn&#8217;t exist.  As a result the virus signatures weren&#8217;t updating.  I discovered this only through reviewing the logs.</p>
<p>As soon as Stefan got back he moved all of his services and data.  Finally we cut the mail over to the new system by fixing the MX records and using the Postfix transport map feature on the old system to force it to relay to the new server.  That completed the migration.</p>
<p><strong>SELinux</strong><br />
Upon login I discovered SELinux was disabled despite my specific request that it be enabled.  I decided to fix it by hand instead of letting Brickwall fix it automatically to show that going from disabled to permissive to enforcing isn&#8217;t bad and shouldn&#8217;t be scary.  It should be done regardless of the presence of a management tool like Brickwall.  I changed the flag in <code>/etc/selinux/config</code> to enforcing and ran <code># touch /.autorelabel</code>.  </p>
<p>I also added <code>enforcing=0</code> to the ends of the kernel command lines in <code>/boot/grub/menu.lst</code>.  </p>
<blockquote><p>Tangent &#8211; I chose this route, modifying the grub file, for going into permissive mode during configuration and testing instead of setting the flag in <code>/etc/selinux/config</code> to permissive.  Applications, such as those built into Red Hat and CentOS as well as third party applications like Brickwall, modify the settings in <code>/etc/selinux/config</code>.  It is possible for me to inadvertently set the system to boot into enforcing before I am ready using these applications.  Since this is a remote server and the configuration is in flux I want to make sure a quick remote reboot request gets me back in to my system.  It is the exact same as using iptables remotely; you don&#8217;t load the firewall rules automatically on boot until you&#8217;re sure you can get back in through SSH.  As soon as I&#8217;m confident that I typed in the SSH network settings properly the system boots into enforcing mode.</p></blockquote>
<p>After setup is complete remember to remove the kernel command line flag &#8211; always going into permissive mode on reboot, much like not auto-loading firewall rules, is a patentable bad idea on a production system.</p>
<p>I disabled all unnecessary services (everything except SSH at this point) and rebooted.  The system relabeled and came up in permissive mode.   Everything was working fine and running in the proper SELinux domains according to <code># ps axZ</code>.  I ran <code># setenforce 1</code> to go into enforcing mode for the first time.  </p>
<p>Nothing bad happened.  The world didn&#8217;t end.  The system didn&#8217;t stop responding.  I&#8217;m also assuming the rampant rumor that <a href="http://twitter.com/UnquietMind/statuses/723260632" title="SELinux Kills">SELinux kills Giraffes in enforcing mode</a> is false because I watched the news and saw nothing Giraffe related.  This SELinux stuff really isn&#8217;t as hard, or as mean as people make it sound.  BTW Brickwall would have taken care of all of this editing of SELinux config files and relabeling stuff for me if I wasn&#8217;t such a control freak.</p>
<p>Well turning it on is one thing.  Really using it is a whole &#8216;nother thing right?  That is where Brickwall comes into play (disclaimer [1]).  I mentioned it before but think &#8220;SELinux Management&#8221; and there are free versions for Fedora and demos for RHEL and CentOS.  Because I&#8217;m cool I get to use the Enterprise Edition.  Mere mortals may have to run Professional or Standard via &#8220;ssh -X&#8221;.  There is no difference in configurability.  Both use the same configuration GUI.  The only policy difference is the policy for the remote daemon &#8211; not really needed if the remote enterprise management daemon isn&#8217;t installed.  One has centralized/remote management, the other does not. </p>
<p>Brickwall Enterprise Edition has two components, the centralized manager application with configuration editor and the remote daemon.  The centralized management application takes different plug-ins &#8211; I&#8217;m only going to be using Brickwall plug-in that supports general SELinux configuration.  I installed the Enterprise Manager with the Brickwall Enterprise component on my desktop RHEL 5 system.  This installation process generated the remote daemon RPMs for me.  These packages include SSL keys tying the remote daemon to this specific Enterprise Manager install.  The SSL keys are used to encrypt the network traffic between the manager and the client daemons.</p>
<p>I installed the remote daemon on the new system.  It is just a little daemon that facilitates remote management of SELinux policy.  I added one of the IPs of this system to a group in my Enterprise Manager.  The system had to be &#8220;activated&#8221; which means Brickwall had to switch from the standard targeted policy to a Brickwall policy.  There aren&#8217;t really any functional differences between the two policies &#8211; a default Brickwall policy is semantically equivalent to a targeted policy as shipped by Red Hat/CentOS.  But the Brickwall policy contains the structure we need in-place to customize the policy later.</p>
<p>Continuing w/ Brickwall I started restricting network settings for the services I would be running (listed above).  I restricted things like the spam, virus, mysql, and other mail filtering services to local host only.  I restricted service ports to meet my requirements.  I applied the configuration changes and rebooted and went into enforcing to verify services came up in the proper domain after a reboot.</p>
<p>All of the SELinux domain names show exactly what processes they target so run`ps axZ`.  All of you key services should be running as &#8220;*:*:servicename_t&#8221;, such as &#8220;mysqld_t&#8221; or &#8220;httpd_t&#8221; or &#8220;postfix_smtp_t&#8221;.  </p>
<p>The only thing that should be &#8220;unconfined_t&#8221; is user processes or custom services that aren&#8217;t targeted by SELinux.  Note that there are some 200 odd applications or services covered by SELinux so there is a good chance your &#8220;custom service&#8221; is covered.</p>
<p>[1] Disclaimer: I work for the company that makes Brickwall.  Since I&#8217;m only an amateur blogger (not commerically endorsed, still eligible for the Bloglympics) and since this doesn&#8217;t appear on tresys.com I&#8217;m not going to be writing a review or praise the software, I&#8217;m just going to run through using it to batten down the hatches on my system.</p>
]]></content:encoded>
			<wfw:commentRss>http://beyondabstraction.net/2008/03/08/server-migration/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>SELinux Slogans</title>
		<link>http://beyondabstraction.net/2008/01/10/selinux-slogans/</link>
		<comments>http://beyondabstraction.net/2008/01/10/selinux-slogans/#comments</comments>
		<pubDate>Thu, 10 Jan 2008 20:33:14 +0000</pubDate>
		<dc:creator>spencer</dc:creator>
				<category><![CDATA[SELinux]]></category>

		<guid isPermaLink="false">http://beyondabstraction.net/2008/01/10/selinux-slogans/</guid>
		<description><![CDATA[Lately conversations keep turning up new slogans for SELinux. I figure this is as good a place as any to keep a running list so here we go: SELinux &#8211; Because users do weird shit. SELinux &#8211; Fuck root. SELinux &#8211; Hampering administrators since before it was cool. SELinux &#8211; Take revenge against the BOFH &#8230; </p><p><a class="more-link block-button" href="http://beyondabstraction.net/2008/01/10/selinux-slogans/">Continue reading &#187;</a>]]></description>
			<content:encoded><![CDATA[<p>Lately conversations keep turning up new slogans for SELinux.  I figure this is as good a place as any to keep a running list so here we go:</p>
<blockquote>
<ul>
<li>SELinux &#8211; Because users do weird shit.</li>
<li>SELinux &#8211; Fuck root.</li>
<li>SELinux &#8211; Hampering administrators since before it was cool.</li>
<li>SELinux &#8211; Take revenge against the BOFH</li>
<li>SELinux &#8211; High-security gone haywire.</li>
<li>SELinux &#8211; Turning it off is like removing the batteries from a smoke detector.  Sure it sounds better but you might get burned.</li>
<li>SELinux &#8211; Because life is too simple.</li>
<li>SELinux &#8211; AppArmor sucks.</li>
<li>SELinux &#8211; It&#8217;s too early in the morning to be cleaning up after 11-year old kiddies.</li>
<li>SELinux &#8211; Too powerful for our own good.</li>
<li>SELinux &#8211; Here&#8217;s our root password, what&#8217;s yours?</li>
<li>SELinux &#8211; Didn&#8217;t they teach you about using protection in high-school?</li>
<li>SELinux &#8211; Blind faith not required</li>
</ul>
</blockquote>
<p>Thinking about slogans actually got me thinking about &#8220;short reasons to use SELinux&#8221;.</p>
<blockquote>
<ul>
<li><a href="http://www.tresys.com/files/docs/SELinux-TCO-White-Paper.pdf" title="The Financial Benefits of Mandatory Access Control Security">SELinux will save you tons of money, your TCO will go down and your ROI will go up.</a> </li>
<li>SELinux supports 3-letter acronyms out of the box, no complex policy changes required.</li>
<li>Zero day vulnerabilities are a fact.  Do something about it.</li>
<li>Trusted Solaris has been end-of-lifed and you&#8217;re not in the government space to begin with.</li>
<li>Path-named based access control is weak.</li>
<li>Implicitly trusting admins doesn&#8217;t have to be SOP.</li>
<li>You&#8217;re not a security expert, let us do the hard work.</li>
<li>The US military (and others) trust SELinux with their information, shouldn&#8217;t you? [1]</li>
</ul>
</blockquote>
<p>These are just a few.  </p>
<p>[1] The answer to this question might actually be a resounding &#8220;no!&#8221; Don&#8217;t worry, I&#8217;m not offended.</p>
]]></content:encoded>
			<wfw:commentRss>http://beyondabstraction.net/2008/01/10/selinux-slogans/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>iPhone tiff exploit + jailbreak</title>
		<link>http://beyondabstraction.net/2007/10/30/iphone-tiff-exploit-jailbreak/</link>
		<comments>http://beyondabstraction.net/2007/10/30/iphone-tiff-exploit-jailbreak/#comments</comments>
		<pubDate>Tue, 30 Oct 2007 14:01:58 +0000</pubDate>
		<dc:creator>spencer</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[SELinux]]></category>

		<guid isPermaLink="false">http://beyondabstraction.net/2007/10/30/iphone-tiff-exploit-jailbreak/</guid>
		<description><![CDATA[We in the security community have been trying to explain the benefit of MAC to developers in the embedded device arena for awhile now. Maybe if people keep threatening devices with radio chips and tons of proprietary crap the embedded developers will jump onboard. Motorola has been using SELinux/SEBSD on the A1200 and other devices &#8230; </p><p><a class="more-link block-button" href="http://beyondabstraction.net/2007/10/30/iphone-tiff-exploit-jailbreak/">Continue reading &#187;</a>]]></description>
			<content:encoded><![CDATA[<p>We in the security community have been trying to explain the benefit of MAC to developers in the embedded device arena for awhile now.  Maybe if people keep threatening devices with radio chips and tons of proprietary crap the embedded developers will jump onboard.  Motorola has been using SELinux/SEBSD on the A1200 and other devices for <a href="http://wiki.openezx.org/Rokr_E2#Motorola_SElinux_Policy">awhile now</a>.  Given the high-level view of the policy and lack of knowledge about the proprietary software and architecture driving the device I can&#8217;t really jump to any conclusions about the completeness of their policy but they are at least trying.<br />
<span id="more-63"></span></p>
<p>The reason I&#8217;m mentioning this is the most recent tiff exploit in the iPhone.  Some hackers (the good kind) got ahold of it and used it to slip Installer.app on the iPhone.  They were even kind enough to close the door they come in through; the exploit patches the vulnerability after it has installed Install.app.  </p>
<p>I know this is SELinux and not SEBSD, although these permissions are in both IIRC, but lets try to count the permissions SELinux would have at its disposal to stop such an &#8220;attack&#8221;:</p>
<ul>
<li>memory protection</li>
<li>file write protection (although <a href="http://feeds.tuaw.com/~r/weblogsinc/tuaw/~3/176703304/">Erica Sadun says</a> this is done by &#8220;reassigning the root of the file tree&#8221;, whatever the hell that means&#8230; chroots?  bind mounts?  namespaces?)</li>
<li>execute</li>
<li>execute_no_trans</li>
</ul>
<p>Listing these permissions is great, but what if Apple had needed Safari to download and install updates?  Perhaps they could use a small app trusted to verify that Apple had signed the apps.  Protect this app and it&#8217;s resources via SELinux and you&#8217;re golden.  </p>
<p>I believe that DRM and security are hard to enforce when the keys are in the hands of the users.  Someone will likely figure out how to view the filesystem or at least how to access it by sniffing USB traffic or looking at the hardware being used (in the case of DVD players etc).  In this case, if you created a kernel that refused to boot in permissive mode would that be sufficient?  Perhaps not, they could feasibly load their own kernel but that would be much more difficult given a properly architected MAC policy protecting the kernel itself.  </p>
]]></content:encoded>
			<wfw:commentRss>http://beyondabstraction.net/2007/10/30/iphone-tiff-exploit-jailbreak/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>SELinux FAQ #1</title>
		<link>http://beyondabstraction.net/2007/06/06/selinux-faq-1/</link>
		<comments>http://beyondabstraction.net/2007/06/06/selinux-faq-1/#comments</comments>
		<pubDate>Wed, 06 Jun 2007 06:22:39 +0000</pubDate>
		<dc:creator>spencer</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[SELinux]]></category>
		<category><![CDATA[SELinux FAQ]]></category>

		<guid isPermaLink="false">http://beyondabstraction.net/2007/06/06/selinux-faq-1/</guid>
		<description><![CDATA[I reckon about three people a day enter the #selinux channel on freenode, ask a question, and than leave a few minutes later without giving anyone a chance to respond. Since no question askers read the topics or have the time to idle I figured I&#8217;d start posting their questions here. There is a good &#8230; </p><p><a class="more-link block-button" href="http://beyondabstraction.net/2007/06/06/selinux-faq-1/">Continue reading &#187;</a>]]></description>
			<content:encoded><![CDATA[<p>I reckon about three people a day enter the #selinux channel on freenode, ask a question, and than leave a few minutes later without giving anyone a chance to respond.  Since no question askers read the topics or have the time to idle I figured I&#8217;d start posting their questions here.  There is a good chance I won&#8217;t be able to answer them without more detail, but hell, its gotta be better than nothing (maybe).  This quote is from the IRC channel so forgive the formatting.</p>
<blockquote><p><code>how can i give a user read access to the /etc/mail (etc_mail_t) sendmail.cf?<br />
                         when i try to connect to sendmail: NOQUEUE: SYSERR(rattler):<br />
                         /etc/mail/sendmail.cf: line 0: cannot open: Permission denied<br />
</code></p></blockquote>
<p>On a targeted system a &#8220;user&#8221;, as in the traditional Unix sense, is not confined in any manner.  On a default FC6 install I can read /etc/mail/sendmail.cf with no denials in enforcing mode with any user logged in at the local console or via SSH.</p>
<p>So given the fact that any user can read the file I can only assume you mean the daemon itself.  Well, once again on a default system, the sendmail daemon can read the file you specified.  On my system the file has the type:<br />
<code><br />
[spencer@sshimko-fc6 ~]$ ls -Z /etc/mail/sendmail.cf<br />
-rw-r--r--  root root system_u:object_r:etc_mail_t:s0  /etc/mail/sendmail.cf<br />
</code></p>
<p>Make sure your file is labeled similarly.  If not, run &#8220;restorecon /etc/mail/sendmail.cf&#8221; and restart the mail service.  If this still doesn&#8217;t work could you please give more details?</p>
]]></content:encoded>
			<wfw:commentRss>http://beyondabstraction.net/2007/06/06/selinux-faq-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Environment, Environmental Contamination, and SELinux (part 3)</title>
		<link>http://beyondabstraction.net/2007/06/01/the-environment-environmental-contamination-and-selinux-part-3/</link>
		<comments>http://beyondabstraction.net/2007/06/01/the-environment-environmental-contamination-and-selinux-part-3/#comments</comments>
		<pubDate>Fri, 01 Jun 2007 09:26:56 +0000</pubDate>
		<dc:creator>spencer</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[SELinux]]></category>

		<guid isPermaLink="false">http://beyondabstraction.net/2007/06/01/the-environment-environmental-contamination-and-selinux-part-3/</guid>
		<description><![CDATA[OK I&#8217;m going to go ahead and post this in the hopes it forces me to finish the series. Check back for updates. Not going to be this weekend, but by next weekend I promise. I&#8217;ve had the thoughts saved since I started part 1, but things kinda went awry (marriage, and then things just &#8230; </p><p><a class="more-link block-button" href="http://beyondabstraction.net/2007/06/01/the-environment-environmental-contamination-and-selinux-part-3/">Continue reading &#187;</a>]]></description>
			<content:encoded><![CDATA[<p>OK I&#8217;m going to go ahead and post this in the hopes it forces me to finish the <a href="http://beyondabstraction.net/2006/05/05/the-environment-environmental-contamination-and-selinux-part-2/">series</a>.  Check back for updates.  Not going to be this weekend, but by next weekend I promise.  I&#8217;ve had the thoughts saved since I started part 1, but things kinda went awry (marriage, and then things just went downhill from there  <img src='http://beyondabstraction.net/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  ).  Regardless here is a teaser of the final segment of the series.  BTW, if you guys actually cared you woulda hounded me to finish.  Still, I promise I&#8217;ll finish up this segment this week.</p>
<p>Now back into the role of glibc.  The role of glibc was defined well before mature mandatory access controls like SELinux came into the Linux picture.  It was defined in a general fashion that allowed it to be extended by a few userland modifications and of course the kernel support discussed in the last article.</p>
<p>__libc_enable_secure in rtld.c (responsible for most of the runtime linking environment cleansing)</p>
<p>-How does SELinux solve this problem?<br />
	-I will delve into the details&#8230; security_bprm_secureexec in binfmt_elf.c<br />
	-AT_SECURE actually enforced by glibc elf/dl-support.c and elf/dl-sysdep.c<br />
	-Static apps have no problems (aside from the usual problems)<br />
	-The linker is the only _real_ threat for dynamically linked apps.<br />
-OK so the people that implemented SELinux were smart so we&#8217;re safe right?<br />
	-Delve into problems with shell scripts, interpreted code, etc</p>
]]></content:encoded>
			<wfw:commentRss>http://beyondabstraction.net/2007/06/01/the-environment-environmental-contamination-and-selinux-part-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fedora Core 8</title>
		<link>http://beyondabstraction.net/2007/06/01/fedora-core-7/</link>
		<comments>http://beyondabstraction.net/2007/06/01/fedora-core-7/#comments</comments>
		<pubDate>Fri, 01 Jun 2007 08:57:05 +0000</pubDate>
		<dc:creator>spencer</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[SELinux]]></category>

		<guid isPermaLink="false">http://beyondabstraction.net/2007/06/01/fedora-core-7/</guid>
		<description><![CDATA[Fedora 7 has been officially released. Hurry and get yours while they last. I expect Brickwall support (read -> free SELinux tools) to be out momentarily. Hmm&#8230;. I&#8217;ll go ahead and change this to FC 8 just to keep ahead of the trend Anyways the Fedora Core 7 (FC7) release of Brickwall can be found &#8230; </p><p><a class="more-link block-button" href="http://beyondabstraction.net/2007/06/01/fedora-core-7/">Continue reading &#187;</a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://fedoraproject.org/">Fedora 7</a> has been officially released.  Hurry and get yours while they last.  I expect Brickwall support (read -> free SELinux tools) to be out momentarily.  Hmm&#8230;. I&#8217;ll go ahead and change this to FC 8 just to keep ahead of the trend <img src='http://beyondabstraction.net/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>Anyways the Fedora Core 7 (FC7) release of <a href="http://tresys.com/products/brickwall.html">Brickwall</a> can be found <a href="http://tresys.com/products/brickwall.html">here</a> when available.</p>
]]></content:encoded>
			<wfw:commentRss>http://beyondabstraction.net/2007/06/01/fedora-core-7/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Tresys Brickwall Professional for Fedora Core 6 is available for FREE!!!</title>
		<link>http://beyondabstraction.net/2007/04/12/tresys-brickwall-professional-for-fedora-core-6-is-available-for-free/</link>
		<comments>http://beyondabstraction.net/2007/04/12/tresys-brickwall-professional-for-fedora-core-6-is-available-for-free/#comments</comments>
		<pubDate>Fri, 13 Apr 2007 00:05:27 +0000</pubDate>
		<dc:creator>spencer</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[SELinux]]></category>

		<guid isPermaLink="false">http://beyondabstraction.net/2007/04/12/tresys-brickwall-professional-for-fedora-core-6-is-available-for-free/</guid>
		<description><![CDATA[Two blogs ago I felt the urge to promote something my team was working on at Tresys that was only available for Red Hat Enterprise Linux 4. Well I&#8217;m pleased to announce Tresys has released a new version of our Brickwall Security Suite for Fedora Core 6. Not only our standard version, but our professional &#8230; </p><p><a class="more-link block-button" href="http://beyondabstraction.net/2007/04/12/tresys-brickwall-professional-for-fedora-core-6-is-available-for-free/">Continue reading &#187;</a>]]></description>
			<content:encoded><![CDATA[<p>Two blogs ago I felt the urge to promote something my team was working on at Tresys that was only available for Red Hat Enterprise Linux 4.  Well I&#8217;m pleased to announce Tresys has released a new version of our Brickwall Security Suite for Fedora Core 6.  Not only our standard version, but our professional version as well!  </p>
<p>The professional version adds additional SELinux targets, aka protects additional services and daemons, and adds the ability to create a custom policy with little to no knowledge of SELinux.  </p>
<p>I highly suggest Fedora users start checking out Brickwall as opposed to listening to most bloggers that tell you to just &#8220;disable SELinux by setting the Grub command line to selinux=0&#8243;.  This is a far superior solution since you have all the security benefits of SELinux with an amazing amount of configurability and ease-of-use.</p>
<p><a href="http://www.tresys.com/products/brickwall-getitnow.html">Check it out.</a></p>
]]></content:encoded>
			<wfw:commentRss>http://beyondabstraction.net/2007/04/12/tresys-brickwall-professional-for-fedora-core-6-is-available-for-free/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tresys Brickwall for SELinux</title>
		<link>http://beyondabstraction.net/2007/01/23/tresys-brickwall-for-selinux/</link>
		<comments>http://beyondabstraction.net/2007/01/23/tresys-brickwall-for-selinux/#comments</comments>
		<pubDate>Tue, 23 Jan 2007 15:13:34 +0000</pubDate>
		<dc:creator>spencer</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[SELinux]]></category>

		<guid isPermaLink="false">http://beyondabstraction.net/2007/01/23/tresys-brickwall-for-selinux/</guid>
		<description><![CDATA[Been awhile but been busy. The company I work for just released our first product. It&#8217;s an application that makes using SELinux much easier. There are three versions: standard, professional, and enterprise. I think enterprise is pretty damn cool. It allows you to remotely manage SELinux policy for groups of machines from a single location. &#8230; </p><p><a class="more-link block-button" href="http://beyondabstraction.net/2007/01/23/tresys-brickwall-for-selinux/">Continue reading &#187;</a>]]></description>
			<content:encoded><![CDATA[<p>Been awhile but been busy.</p>
<p>The company I work for just released our first product.  It&#8217;s an application that makes using SELinux much easier.  There are three versions: standard, professional, and enterprise.  I think enterprise is pretty damn cool.  It allows you to remotely manage SELinux policy for groups of machines from a single location.  So you can easily configure different security policies on your payroll machines, your student labs, your network admin boxes, and your web servers and mail servers. </p>
<p>Remember, security doesn&#8217;t have to be hard.  <a href="http://www.tresys.com/products/brickwall.html">Try Tresys Brickwall today!</a></p>
<p>&lt;/shameless promotion&gt;</p>
]]></content:encoded>
			<wfw:commentRss>http://beyondabstraction.net/2007/01/23/tresys-brickwall-for-selinux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Environment, Environmental Contamination, and SELinux (part 2)</title>
		<link>http://beyondabstraction.net/2006/05/05/the-environment-environmental-contamination-and-selinux-part-2/</link>
		<comments>http://beyondabstraction.net/2006/05/05/the-environment-environmental-contamination-and-selinux-part-2/#comments</comments>
		<pubDate>Fri, 05 May 2006 14:49:45 +0000</pubDate>
		<dc:creator>spencer</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[SELinux]]></category>
		<category><![CDATA[Kernel]]></category>

		<guid isPermaLink="false">http://www.beyondabstraction.net/2006/05/05/the-environment-environmental-contamination-and-selinux-part-2/</guid>
		<description><![CDATA[I realized after posting the first article in this series that I gave very little indication on where I plan to head with this subject. So perhaps a game plan is an order. Errata: At the beginning I planned to focus on the environment and SELinux. I hoped to explain how certain types of applications &#8230; </p><p><a class="more-link block-button" href="http://beyondabstraction.net/2006/05/05/the-environment-environmental-contamination-and-selinux-part-2/">Continue reading &#187;</a>]]></description>
			<content:encoded><![CDATA[<p>I realized after posting the first article in this series that I gave very little indication on where I plan to head with this subject.  So perhaps a game plan is an order.  </p>
<p>Errata: At the beginning I planned to focus on the environment and SELinux.  I hoped to explain how certain types of applications still remain vulnerable to environmental contamination even in the face of MAC like SELinux.  This would simply involve a discussion of the environment, the noatsecure permission (or lack thereof), and those environmental factors which are handled by this permission and those that are still capable of influencing execution.  However, after starting the article I realized that such an explanation would stop short, probably being of little value to readers in the end and leaving me feeling slightly unsatisfied.  </p>
<p>We started in the <a href="http://beyondabstraction.net/2006/04/06/the-environment-environmental-contamination-and-selinux-part-1/">first article</a> by exploring the environment, the linker, and the names of the environment variables that can influence the execution.  In this article we will be discussing the kernel code that facilitates enforcement of some level of environmental protection in userland.  After discussing the kernel the next article will jump back into the userland and glibc and delve into the similarities between suid/sgid protection and the SELinux noatsecure permission.  Finally I would like to wrap up with what started all of this, a discussion about environment vulnerabilities that still exist even in the presence of strong MAC like SELinux; this will focus on scripting and interperted languages.  I apologize for the administrative errata but I wanted to layout a road map.  Now, onto the kernel discussion&#8230;<br />
<span id="more-34"></span></p>
<p><i>Why are we talking about the kernel here?</i><br />
Well I could just come out and tell you why things are the way they are, and this is what the 3rd or 4th part in this series will do.  But this is not the point of my articles in general.  I like exploring the whys behind things and I take my articles down that path with me.  If you don&#8217;t like knowing the why you could probably just skip this article and perhaps the next one&#8230; the end result won&#8217;t be discussed until the last article in this series.</p>
<p>Last time I alluded to the role glibc plays in securing the environment.  I said that the secret to securing the environment lay in the appropriately named __libc_enable_secure within glibc.  But before we explore glibc any further we should briefly <a href="http://beyondabstraction.net/2006/05/05/selinux-lsm-kernel-basics/">visit the kernel</a>.    </p>
<p>Well that took awhile but I think we&#8217;re ready to get back on track.  So we have this <code>security_ops</code> structure with a bunch of function pointers within.  For this series all we&#8217;re really worried about is a single function pointer, <code>bprm_secureexec</code>.  From <code>include/security.h</code>[1]:<br />
<code><br />
 * @bprm_secureexec:<br />
 *      Return a boolean value (0 or 1) indicating whether a "secure exec"<br />
 *      is required.  The flag is passed in the auxiliary table<br />
 *      on the initial stack to the ELF interpreter to indicate whether libc<br />
 *      should enable secure mode.<br />
 *      @bprm contains the linux_binprm structure.<br />
</code></p>
<p>If traditional capabilities are used or if <code>CONFIG_SECURITY</code> is enabled but no specific module is loaded (eg the &#8220;dummy&#8221; module is in use) than the traditional capability hooks perform two checks:</p>
<ol>
<li>user identifier (uid) is not equal to effective user identifier(euid)</li>
<li>group identifier (gid) is not equal to effective group identifier (egid)</li>
</ol>
<p>If either of these cases is true than the bprm_secureexec will return true.  </p>
<p>So this is fine and dandy for the capabilities and the dummy module, but what happens with security modules?  Well security models that need to protect their definition of a target process from their definition of a source also render a decision in a similar fashion.  SELinux renders a decision based on the domains involved.  If a process <code>execv()</code>s the SELinux security hook comparies the two SIDs, the original SID of the parent process and the SID of the new child process (the in-core integer representation of the home readable security context).  If the two SIDS are different it means a domain transition occured.  It is under these circumstances that SELinux must protect the child process from environmental influence from the parent process.  The <code>selinux_bprm_secureexec</code> function found in <code>security/selinux/hooks.c</code> on line 1575 is responsible for rendering that decision from SELinux.  </p>
<p>Capabilities, LSM/SELinux, etc, all render a decision but what happens with the result of this decision?  We only need to look in two files to have a basic understanding of what happens here: <code>include/linux/auxvec.h</code> and <code>fs/binfmt_elf.c</code>.  Lets start with <code>auxvec.h</code> first.  We really only need it for a single piece of information but the usage of that information may lead to confusion.  If you open that file and read the first comment you will see that the file contains &#8220;Symbolic values for the entries in the auxiliary table put on the initial stack&#8221;.  Huh?  Basically it defines a set of names and their associated values.  The names/values are used in when constructing an executable in memory.  These values are really just indices into a table put on the stack of an executable program by the ELF loader in the kernel.  If you&#8217;re still feeling a little woozy these numbers are basically used as an index to store a value.  That single piece of information I mentioned above can be found on line 27, the definition of AT_SECURE.  The value assigned to AT_SECURE is 23&#8230; remember that&#8230; twenty-three.  </p>
<p>So now we can move into <code>fs/binfmt_elf.c</code>.  We&#8217;re looking for the AT_SECURE again, it&#8217;s only in one place, on line 207:<br />
<code>NEW_AUX_ENT(AT_SECURE, (elf_addr_t) security_bprm_secureexec(bprm));</code></p>
<p>Huh?  Well there is a macro defined a few lines up that might help.  If we use the expand that NEW_AUX_ENT macro we get this:<br />
<code>do { elf_info[ei_index++] = AT_SECURE; elf_info[ei_index++] = security_bprm_secureexec(bprm); } while (0)</code></p>
<p>Beginning to make more sense?  Good.  In case it doesn&#8217;t just know that elf_info stores what are basically name-value pairs in alternating locations in the array.  The name, which was <code>#define</code>d to a value above, comes first followed by a value.  So we&#8217;re storing the decision made by the security server regarding secure execution (aka cleaning the environment) at a location immediately following the location that contains AT_SECURE (the number 23).  </p>
<p>That&#8217;s it for now&#8230;  if you forget everything else by the time the next article is posted please remember one thing: the decision made in the bprm_secureexec function, regardless of the security model (basic capabilities or SELinux or another LSM), is stored in the ELF table contain interpretor information at the index indentified by AT_SECURE&#8230;. ah forget it.  I can&#8217;t even remember all of that, just remember 23.</p>
<p>[0] <a href="http://www.ussg.iu.edu/hypermail/linux/kernel/0306.2/0105.html">AT_SECURE</a> kernel patch post</p>
<p>[1] All research was based on kernel 2.6.15 w/ Gentoo patchset r7.  </p>
]]></content:encoded>
			<wfw:commentRss>http://beyondabstraction.net/2006/05/05/the-environment-environmental-contamination-and-selinux-part-2/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>SELinux &amp; LSM Kernel Basics</title>
		<link>http://beyondabstraction.net/2006/05/05/selinux-lsm-kernel-basics/</link>
		<comments>http://beyondabstraction.net/2006/05/05/selinux-lsm-kernel-basics/#comments</comments>
		<pubDate>Fri, 05 May 2006 14:47:07 +0000</pubDate>
		<dc:creator>spencer</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[SELinux]]></category>
		<category><![CDATA[Kernel]]></category>

		<guid isPermaLink="false">http://www.beyondabstraction.net/2006/05/05/selinux-lsm-kernel-basics/</guid>
		<description><![CDATA[While working on the second article in the environmental contamination series I found that 1/2 of the article was spent wading through the security structure and Flask implementation in the kernel. Since this is an important and recurring topic I figured I would split it out into a separate article and just link to this &#8230; </p><p><a class="more-link block-button" href="http://beyondabstraction.net/2006/05/05/selinux-lsm-kernel-basics/">Continue reading &#187;</a>]]></description>
			<content:encoded><![CDATA[<p>While working on the second article in the <a href="http://www.beyondabstraction.net/2006/04/06/the-environment-environmental-contamination-and-selinux-part-1/">environmental contamination</a> series I found that 1/2 of the article was spent wading through the security structure and Flask implementation in the kernel.  Since this is an important and recurring topic I figured I would split it out into a separate article and just link to this from future articles.  I want to warn you, as most shallow explanations of kernel mechanisms, this may seem confusing since some details are left out.  I encourage you to explore these on your own until you  have satisfied your craving.</p>
<p>When it comes to making certain security decisions the kernel makes use of capabilities or other mechanisms (such as SELinux) which render a decision that the kernel then enforces or passes off to userland for use there.  The kernel asks for these decisions through function calls or &#8220;hooks&#8221;.  We need to have a rudimentary understanding of how these hooks work if we&#8217;re to understand how the security mechanism behind SELinux.<br />
<span id="more-36"></span></p>
<p>First place we need to look is <code>include/security/security.h</code>[2].  If you&#8217;re drawn into the &#8220;why&#8221;s I suggest you backtrace from the SELinux hooks (<code>security/selinux/hooks.c</code>) to the security operations structure (<code>include/linux/security.h</code>) but we will go straight to <code>security.h</code>.  Look at the *_bprm_secureexec function headers.  This highlights that how the security hooks and capabilities work with and without of security modules.  Look at the <code>#ifdef</code> on lines 91 and the corresponding <code>#else</code> on line 1949.  If the <code>CONFIG_SECURITY</code> kernel config option IS NOT enabled this security check falls back to the traditional capability security checks[1].  If the <code>CONFIG_SECURITY</code> option IS enabled this check propagates through one or more of several security hooks.  </p>
<p>The kernel uses a security struct provided by LSM called <code>security_ops</code> (line 1037) to support a variety of security models.  The <code>security_ops</code> maintains a set of pointers to functions that are defined by the security model you use.  Some of the pointers are used during initialization, others shutdown, and others are the actual security hooks described above.  These security hooks are called from various critical points in the kernel deemed to be security relevant[3].  The kernel LSM is a partial implementation of the <a href="http://www.cs.utah.edu/flux/papers/flask-usenixsec99.pdf">Flask architecture</a> with some caveats such as revocation and caching[4].  Thus, the security hooks simply return a decision regarding the access, a simple yes or no, and the place that called the hook is responsible for enforcing this decision[5].  </p>
<p>As a quick example lets look at the ability to set our user id.  If we look in <code>kernel/sys.c</code> we will find the function <code>sys_setuid</code> on line 779.   The first thing done in this function (aside from delcaring variables) is to check with the security_task_setuid function (line 785).  This function is defined in <code>include/linux/security.h</code> on lines 2346 and 1714.  Both are very simple inline functions.  The former is used if <code>CONFIG_SECURITY</code>  is not enabled and merely returns 0.  The latter is used when <code>CONFIG_SECURITY</code> is enabled and simply calls the security hook found in the <code>security_ops</code> task_setuid function pointer.  So here we see that separation of the decision from the enforcement as defined by the Flask architecture.  The decision is rendered by the hook, or security server, and the decision is enforced by caller, or the object manager.</p>
<p>If <code>CONFIG_SECURITY</code> is enabled but no specific security module is installed it means no <i>real</i> <code>security_ops</code> struct is available so it falls through the dummy security_ops which just passes it onto the capability hooks mentioned above.  However, if a security module is installed it leverages these hooks instead of the &#8220;dummy&#8221; hooks.  </p>
<p>Hopefully this is enough to help one wade through the kernel enforcement and security server mechanism.  </p>
<p>[1] As far as I know, secureexec was not part of the POSIX capability specification, rather it is a Linux specific extenstion to this specification.  Please correct me if I&#8217;m wrong on this point (and all other points <img src='http://beyondabstraction.net/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  ).</p>
<p>[2] The research for this article was done on the 2.6.15 kernel with the Gentoo r7 patchset applied.</p>
<p>[3] &#8220;Security relevant&#8221; is arguable as is the acutal functionality of the LSM.  If you follow the LSM and LKML you will find that the LSM implementation is sub-optimal for most security models and has it&#8217;s flaws.  None the less this is the best model we have at the moment so we have to make the best of it.</p>
<p>[4] Some of these issues, such as caching, are addressed by the SELinux module itself, but not by LSM.</p>
<p>[5] Refer to <a href="http://www.cs.utah.edu/flux/papers/micro/node8.html">this excerpt</a> from the Flask paper for a diagram depicting this separation of enforcement from decision.</p>
]]></content:encoded>
			<wfw:commentRss>http://beyondabstraction.net/2006/05/05/selinux-lsm-kernel-basics/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

