 




<?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>Open Source Software and Linux &#187; selinux</title>
	<atom:link href="http://itknowledgeexchange.techtarget.com/linux-lotus-domino/tag/selinux/feed/" rel="self" type="application/rss+xml" />
	<link>http://itknowledgeexchange.techtarget.com/linux-lotus-domino</link>
	<description></description>
	<lastBuildDate>Thu, 02 May 2013 21:07:56 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>SELinux on Ubuntu</title>
		<link>http://itknowledgeexchange.techtarget.com/linux-lotus-domino/selinux-on-ubuntu/</link>
		<comments>http://itknowledgeexchange.techtarget.com/linux-lotus-domino/selinux-on-ubuntu/#comments</comments>
		<pubDate>Tue, 09 Dec 2008 00:47:39 +0000</pubDate>
		<dc:creator>Xjlittle</dc:creator>
				<category><![CDATA[centos]]></category>
		<category><![CDATA[linux security]]></category>
		<category><![CDATA[red hat]]></category>
		<category><![CDATA[selinux]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://itknowledgeexchange.techtarget.com/linux-lotus-domino/selinux-on-ubuntu/</guid>
		<description><![CDATA[The other day after installing Ubuntu on one of my test machines I noticed that there was an ls -Z command which shows various selinux information about files and directories. Running this command however gave some strange output, primarily ? marks. I thought this was a little strange but had other things that I needed [...]]]></description>
				<content:encoded><![CDATA[<p>The other day after installing Ubuntu on one of my test machines I noticed that there was an ls -Z command which shows various selinux information about files and directories.</p>
<p>Running this command however gave some strange output, primarily ? marks.  I thought this was a little strange but had other things that I needed to do at the time and decided that I would look into it later.</p>
<p>This weekend was that time.  Let me say that I use SELinux on my Red Hat and CentOS machines and think that it is a very good way to help secure a machine.  However it is anything but intuitive.  If it weren&#8217;t for some very good documentation at Red Hat I probably never would have been successful at using this security tool.  Mind you I&#8217;m no guru with it but I have six servers using it and I know how to troubleshoot SeLinux problems.</p>
<p>Which brings me to the part about Ubuntu and SELinux that I find disturbing.  Doing some Google searching I ran across two pages regarding Ubuntu and SELinux.  Both of them had no usable information in them other than how to install SELinux.  Nothing about what to expect, how to troubleshoot, what a context or a boolean is nor did it mention if Ubuntu provided any troubleshoooting tools like setroubleshoot.  You can find these two pages <a href="http://ubuntu-tutorials.com/2008/03/18/how-to-install-selinux-on-ubuntu-804-hardy-heron/">here</a> and <a href="https://help.ubuntu.com/community/SELinux">here</a>.</p>
<p>The documentation only warned that SELinux is for experienced users.  While that is an understatement how do they expect people to start using it to protect their machines?  It would seem to indicate that they have no real interest in their users having the ability to use SELinux.  I personally think that is a shame.  I also believe that it is going to hurt their efforts at becoming enterprise ready especially with their server product.  I certainly won&#8217;t be installing Ubuntu on any of my critical machines.</p>
<p>-j</p>
<!-- wpms-network-global-inserts -->]]></content:encoded>
			<wfw:commentRss>http://itknowledgeexchange.techtarget.com/linux-lotus-domino/selinux-on-ubuntu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SELinux and what I&#8217;ve learned in the last two days..</title>
		<link>http://itknowledgeexchange.techtarget.com/linux-lotus-domino/selinux-and-what-ive-learned-in-the-last-two-days/</link>
		<comments>http://itknowledgeexchange.techtarget.com/linux-lotus-domino/selinux-and-what-ive-learned-in-the-last-two-days/#comments</comments>
		<pubDate>Fri, 21 Nov 2008 20:28:29 +0000</pubDate>
		<dc:creator>Xjlittle</dc:creator>
				<category><![CDATA[centos]]></category>
		<category><![CDATA[getsebool]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[selinux]]></category>
		<category><![CDATA[selinux apache]]></category>
		<category><![CDATA[selinux httpd]]></category>
		<category><![CDATA[selinux mysql]]></category>
		<category><![CDATA[selinux nfs]]></category>
		<category><![CDATA[setsebool]]></category>

		<guid isPermaLink="false">http://itknowledgeexchange.techtarget.com/linux-lotus-domino/selinux-and-what-ive-learned-in-the-last-two-days/</guid>
		<description><![CDATA[I am bringing up a new Virtual Host with VMs of MySQL, music-repo and a webserver. All of these are on CentOS with SELinux enabled. No, I&#8217;m not a glutton for punishments using SELinux for all of these machines that are interconnected to each other. I believe the time is coming when organizations are going [...]]]></description>
				<content:encoded><![CDATA[<p>I am bringing up a new Virtual Host with VMs of MySQL, music-repo and a webserver.  All of these are on CentOS with SELinux enabled.  No, I&#8217;m not a glutton for punishments using SELinux for all of these machines that are interconnected to each other.  I believe the time is coming when organizations are going to insist on the type of security that SELinux provides.</p>
<p>Moving on I mentioned that my MySQL server is on one box and my web server on another.  One of the applications that I use is <a href="http://www.kplaylist.net/">KPlaylist</a>.  This is a streaming server for mp3s, movies or just about anything you want to stream.  My first snag was getting it to log into MySQL and create the database.</p>
<p>After about an hour of looking for normal causes I decided to turn on setroubleshoot.  This is a great tool when looking for SELinux problems.  After I turned it on I found this in /var/log/messages:</p>
<blockquote><p>Nov 20 15:40:47 web setroubleshoot: SELinux is preventing the http daemon from connecting to network port 3306 For complete SELinux messages. run sealert -l 65919ff0-ddd1-4a4b-801d-f54023da86ac</p></blockquote>
<p>So then I ran the sealert command shown in the message:<br />
<code><br />
sealert -l 65919ff0-ddd1-4a4b-801d-f54023da86ac<br />
</code><br />
This gave me the following along with some other information:<br />
<code><br />
setsebool -P httpd_can_network_connect=1<br />
</code></p>
<p>Voila! My problem was fixed.  Well almost.  I then discovered that iptables was  blocking the port.  After opening the port using the gui &#8220;system-config-securitylevel&#8221; all was well.  KPLaylist installed it&#8217;s database just like it was supposed to.</p>
<p>My next hurdle was getting the nfs share on the music-repo server to mount on to the web server.  Checking for another sealert I found one on the webserver called </p>
<blockquote><p>Nov 20 23:57:33 web setroubleshoot: SELinux prevented the http daemon from reading files stored on a NFS filesytem. For complete SELinux messages. run sealert -l f76bd0be-d375-436f-9c09-2086da0d7a39</p></blockquote>
<p>After running this I got the following information:<br />
<code><br />
setsebool -P httpd_use_nfs=1<br />
</code></p>
<p>Well this didn&#8217;t totally solve my problem but I did notice that things were getting fixed with the setsebool command.  I went looking around the net to see what I could learn about it.</p>
<p>What I learned is that if you are having a problem with a service is that you should run the command getsebool -a |grep someservice.  I decided to try that with NFS and this is what I got:<br />
<code><br />
[root@music-repo ~]# getsebool -a |grep nfs<br />
allow_ftpd_use_nfs --&gt; off<br />
allow_nfsd_anon_write --&gt; off<br />
nfs_export_all_ro --&gt; on<br />
nfs_export_all_rw --&gt; on<br />
nfsd_disable_trans --&gt; off<br />
samba_share_nfs --&gt; off<br />
use_nfs_home_dirs --&gt; off<br />
[root@music-repo ~]#<br />
</code><br />
The last line was what I found interesting.  I had originally had my music directory on the music-repo machine at the root of the system.  My thought was OK let&#8217;s create a user with a home directory and enable that boolean.  I created a user on the musiic-repo system called apache and moved the /music directory into /home/apache.  I then ran the command:<br />
<code><br />
setsebool -P use_nfs_home_dirs=on<br />
</code></p>
<p>I also moved my music directory that I was mounting to under /var/www which is apache&#8217;s home and ran the same command.  Now everything was connected and working like it is supposed to be.</p>
<p>A note of interest to those of you who would prefer a gui..you should install policycoreutils-gui.  This will give you a nice gui called system-config-selinux.  In this gui you can browse through everthing SELinux has to say and can change.  </p>
<p>Now to get that setup as a share for the Windows users so that they can store their music and get it backed up.</p>
<p>-j</p>
<!-- wpms-network-global-inserts -->]]></content:encoded>
			<wfw:commentRss>http://itknowledgeexchange.techtarget.com/linux-lotus-domino/selinux-and-what-ive-learned-in-the-last-two-days/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Application Whitelisting for Window..or is it SELinux</title>
		<link>http://itknowledgeexchange.techtarget.com/linux-lotus-domino/application-whitelisting-for-windowor-is-it-selinux/</link>
		<comments>http://itknowledgeexchange.techtarget.com/linux-lotus-domino/application-whitelisting-for-windowor-is-it-selinux/#comments</comments>
		<pubDate>Fri, 14 Nov 2008 15:26:10 +0000</pubDate>
		<dc:creator>Xjlittle</dc:creator>
				<category><![CDATA[anti-virus]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[malware]]></category>
		<category><![CDATA[root kit]]></category>
		<category><![CDATA[rootkit]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[selinux]]></category>
		<category><![CDATA[whitelisting]]></category>

		<guid isPermaLink="false">http://itknowledgeexchange.techtarget.com/linux-lotus-domino/application-whitelisting-for-windowor-is-it-selinux/</guid>
		<description><![CDATA[I recently read an article in eWeek that talked extensively about Application Whitelisting. The more of the article that I read this seems to be nothing more than SELinux on Windows. The Windows people are looking to lock down their machines because of the horrendous numbers of viruses, trojans and other malware that attacks them. [...]]]></description>
				<content:encoded><![CDATA[<p>I recently read an article in eWeek that talked extensively about Application Whitelisting.  The more of the article that I read this seems to be nothing more than SELinux on Windows.</p>
<p>The Windows people are looking to lock down their machines because of the horrendous numbers of viruses, trojans and other malware that attacks them.  Apparently user education, anti-virus and anti-whatever just is not getting the job done.</p>
<p>Windows machines in the past have used the traditional methods for fighting malware.  Anti-virus tracks and quarantines certain bits that are known malware problems.  This is known as blacklisting.  Whitelisting is the process by where certain executables are approved to run on a certain machine.</p>
<p>Now let&#8217;s have a look at SELinux which was first implemented by Red Hat several years ago.  While Linux in general does not have a problem with malware an unprotected machine could get hacked and unwanted applications installed.  Red Hat wanted a way to stop this type of intrusion.  Let&#8217;s look a little deeper how this came into play.</p>
<blockquote><p>SELinux was originally a development project from the National Security Agency (NSA  )[19] and others. It is an implementation of the Flask  operating system security architecture.[20]The NSA integrated SELinux into the Linux kernel using the Linux Security Modules  (LSM  ) framework. SELinux motivated the creation of LSM, at the suggestion of Linus Torvalds, who wanted a modular approach to security instead of just accepting SELinux into the kernel.</p></blockquote>
<p>  You can see the rest of the article <a href="http://www.redhat.com/docs/manuals/enterprise/RHEL-5-manual/Deployment_Guide-en-US/rhlcommon-appendix-0005.html">here</a></p>
<p>So here we have a security application mostly developed by the NSA.</p>
<blockquote><p>Much of the work to get the kernel ready for upstream, as well as subsequent SELinux development, has been a joint effort between the NSA, Red Hat, and the community of SELinux developers.</p></blockquote>
<p>Now let&#8217;s look at how SELinux runs under Red Hat and any other *nix that uses it.  Red Hat uses what is called a target policy for SELinux.   SELinux creates what are known as domains.  Each daemon has it&#8217;s own domain.  Every daemon on the system runs under the unconfined_t domain except for those that have targeted specific domains.  Daemons that run under the unconfined_t domain fall back to using standard Linux security.  As an example the http and ntp daemons run under the targeted policy by default and are therefore protected.  If you haven&#8217;t experienced what happens under this protection, if one of the binaries or configuration files get put into the wrong context the daemon will not start.</p>
<p>This should be starting to sound familiar to the definition of Application Whitelisting above.  It will be interesting to see if the Windows shops buy into this method of protection.  I also expect some announcement from Microsoft or some other big firm how they have developed this new concept and are providing it as a tool to protect Window applications.  I wonder how much the licensing fee and yearly maintenance will be on that&#8230;</p>
<p>-j</p>
<!-- wpms-network-global-inserts -->]]></content:encoded>
			<wfw:commentRss>http://itknowledgeexchange.techtarget.com/linux-lotus-domino/application-whitelisting-for-windowor-is-it-selinux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Maintaining your sanity with SELinux</title>
		<link>http://itknowledgeexchange.techtarget.com/linux-lotus-domino/maintaining-your-sanity-with-selinux/</link>
		<comments>http://itknowledgeexchange.techtarget.com/linux-lotus-domino/maintaining-your-sanity-with-selinux/#comments</comments>
		<pubDate>Wed, 05 Nov 2008 14:56:56 +0000</pubDate>
		<dc:creator>Xjlittle</dc:creator>
				<category><![CDATA[centos]]></category>
		<category><![CDATA[chcon]]></category>
		<category><![CDATA[linux security]]></category>
		<category><![CDATA[red hat]]></category>
		<category><![CDATA[restorecon]]></category>
		<category><![CDATA[sealert]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[selinux]]></category>
		<category><![CDATA[setroubleshoot]]></category>

		<guid isPermaLink="false">http://itknowledgeexchange.techtarget.com/linux-lotus-domino/maintaining-your-sanity-with-selinux/</guid>
		<description><![CDATA[Yes I know..everyone wants to turn off selinux. The Notes Domino people even tell you to turn off selinux before installing Domino. While this is probably a good idea for them in normal server cases it is maybe not such a good idea under normal circumstances. SeLinux is another excellent layer to protecting your system [...]]]></description>
				<content:encoded><![CDATA[<p>Yes I know..everyone wants to turn off selinux.  The Notes Domino people even tell you to turn off selinux before installing Domino.  While this is probably a good idea for them in normal server cases it is maybe not such a good idea under normal circumstances.  SeLinux is another excellent layer to protecting your system along with iptables and hosts.all and hosts.deny.  Keeping a few things in mind will help you maintain your sanity while using selinux.</p>
<p>First up are the /var/log/audit/audit.log, /var/log/security and /var/log/messages.  If selinux is set to enforcing and you&#8217;ve just installed a new application or created a file or directory that is not allowing proper access these three files are the place to go.  Before you do this make sure the following applications are installed:<br />
setroubleshoot.noarch<br />
setroubleshoot-plugins.noarch<br />
setroubleshoot-server.noarch </p>
<p>After installing these make sure that you start the setroubleshoot application and set it to start on reboot:<br />
<code><br />
/etc/init.d/setroubleshoot start<br />
Starting setroubleshootd:                                  [  OK  ]<br />
chkconfig setroubleshoot on<br />
</code></p>
<p>Watch the logs in real time as you attempt to access the application, file or directory like this:<br />
<code><br />
cd /var/logs<br />
tail -f security audit/audit.log messages<br />
</code><br />
After doing this hit enter three times to give you some white space between the old messages and the new ones that are generated.  If selinux is giving you a problem you will see something like the following in the messages log:<br />
<code><br />
Nov  5 08:18:44 centos5-dev setroubleshoot: SELinux is preventing access to files with the label, file_t. For complete SELinux messages. run sealert -l d102b5a4-ac6f-470f-aa34-55ac37dafa37<br />
</code></p>
<p>To find out not only what is going on but how to fix it run the sealert -l d102b5a4-ac6f-470f-aa34-55ac37dafa37 command described in the message.<br />
<code><br />
[root@centos5-dev ~]# sealert -l d102b5a4-ac6f-470f-aa34-55ac37dafa37</p>
<p>Summary:</p>
<p>SELinux is preventing access to files with the label, file_t.</p>
<p>Detailed Description:</p>
<p>SELinux permission checks on files labeled file_t are being denied. file_t is<br />
the context the SELinux kernel gives to files that do not have a label. This<br />
indicates a serious labeling problem. No files on an SELinux box should ever be<br />
labeled file_t. If you have just added a new disk drive to the system you can<br />
relabel it using the restorecon command. Otherwise you should relabel the entire<br />
files system.</p>
<p>Allowing Access:</p>
<p>You can execute the following command as root to relabel your computer system:<br />
"touch /.autorelabel; reboot"</p>
<p>Additional Information:</p>
<p>Source Context                system_u:system_r:hplip_t<br />
Target Context                system_u:object_r:file_t<br />
Target Objects                libc.so.6 [ lnk_file ]<br />
Source                        hpssd.py<br />
Source Path                   /bin/env<br />
Port<br />
Host                          centos5-dev.hendricks.org<br />
Source RPM Packages           coreutils-5.97-14.el5<br />
Target RPM Packages<br />
Policy RPM                    selinux-policy-2.4.6-137.1.el5<br />
Selinux Enabled               True<br />
Policy Type                   targeted<br />
MLS Enabled                   True<br />
Enforcing Mode                Enforcing<br />
Plugin Name                   file<br />
Host Name                     centos5-dev.hendricks.org<br />
Platform                      Linux centos5-dev.hendricks.org<br />
                              2.6.18-92.1.10.el5xen #1 SMP Tue Aug 5 08:46:32<br />
                              EDT 2008 i686 athlon<br />
Alert Count                   3<br />
First Seen                    Wed Nov  5 08:18:39 2008<br />
Last Seen                     Wed Nov  5 08:18:39 2008<br />
Local ID                      d102b5a4-ac6f-470f-aa34-55ac37dafa37<br />
Line Numbers                  </p>
<p>Raw Audit Messages            </p>
<p>host=centos5-dev.hendricks.org type=AVC msg=audit(1225891119.851:12): avc:  denied  { read } for  pid=2634 comm="hpssd.py" name="libc.so.6" dev=dm-0 ino=1547246 scontext=system_u:system_r:hplip_t:s0 tcontext=system_u:object_r:file_t:s0 tclass=lnk_file</p>
<p>host=centos5-dev.hendricks.org type=SYSCALL msg=audit(1225891119.851:12): arch=40000003 syscall=5 success=no exit=-13 a0=b7fb2b4b a1=0 a2=bfd8a2b4 a3=8 items=0 ppid=2633 pid=2634 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm="hpssd.py" exe="/bin/env" subj=system_u:system_r:hplip_t:s0 key=(null)<br />
[root@centos5-dev ~]#<br />
</code><br />
The part that we are interested in is under the above heading <code>Allowing Access: You can execute the following command as root to relabel your computer system:<br />
"touch /.autorelabel; reboot"</code><br />
When we run this command this will fix our problem.  Note that these problems could run from accessing html pages to allowing a public web directory in your home directory.</p>
<p>Next up we have the command:<br />
<code><br />
chcon --reference<br />
</code><br />
Lets say you are using your localhost as your web server.  You decide that you want to add some virtual hosts.  You then add the virtual host directories outside of the normal /var/www/html directory.  You build your virtual hosts but now you can&#8217;t access them.  Watching your messages you see that this is definitely an selinux problem.  Using the above command we can fix our problem like this:<br />
<code><br />
chcon --reference  /var/www/html /srv/www/vhosts #This will fix the selinux properties on the root directory of the virtual hosts<br />
chcon -- reference /var/www/html/* /srv/www/vhosts/*  # This will fix the properties on the files in case they are different from the directory<br />
</code><br />
This code references the contexts of the given files or directories and applies them to the new files and directories.  Now every time that you add a file or directory under /srv/www/vhosts it will get the proper selinux context.</p>
<p>The last way that we are going to discuss is restorecon.  Taking the above scenario under either of the directories  you find that some files or directories did not pick up the correct context or maybe none at all.  Easy enough to fix:<br />
<code><br />
restorecon /var/www/html<br />
</code><br />
The reason this works is because the restorecon looks at the current contexts of the other files and directories and applies that context to the ones with the incorrect or no context.</p>
<p>There you have it.  Keep your sanity and still use SELinux.</p>
<p>-j</p>
<!-- wpms-network-global-inserts -->]]></content:encoded>
			<wfw:commentRss>http://itknowledgeexchange.techtarget.com/linux-lotus-domino/maintaining-your-sanity-with-selinux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
