<?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>Linux System Administration and Security &#187; NSA</title>
	<atom:link href="http://www.jasonbrown.us/category/security/nsa/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.jasonbrown.us</link>
	<description></description>
	<lastBuildDate>Tue, 31 Jan 2012 02:58:29 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Editing SELinux Policies</title>
		<link>http://www.jasonbrown.us/2010/02/editing-selinux-policies/</link>
		<comments>http://www.jasonbrown.us/2010/02/editing-selinux-policies/#comments</comments>
		<pubDate>Mon, 15 Feb 2010 17:46:55 +0000</pubDate>
		<dc:creator>jason</dc:creator>
				<category><![CDATA[NSA]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[SELinux]]></category>
		<category><![CDATA[ausearch]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[ClamAV]]></category>
		<category><![CDATA[RHEL]]></category>

		<guid isPermaLink="false">http://www.jasonbrown.us/?p=8</guid>
		<description><![CDATA[There are times where SELinux just does not want to play nice. For instance, after installing ClamAV I began running into problems where if I did not turn off SELinux while ClamAV was running, then SMTP traffic would fail. To fix this issue we must first look at the messages file under /var/log. Within this ]]></description>
			<content:encoded><![CDATA[<p>There are times where SELinux just does not want to play nice. For instance, after installing ClamAV I began running into problems where if I did not turn off SELinux while ClamAV was running, then SMTP traffic would fail. To fix this issue we must first look at the messages file under /var/log. Within this file we will see error messages like:<br />
<code>setroubleshoot: SELinux is preventing cleanup (postfix_cleanup_t) "search" to ./clamav (clamd_var_lib_t).</code></p>
<p>Which tells you to run the command:<br />
<code>sealert -l a1bc9b39-80a2-4f2e-963f-12daf766a8d4</code></p>
<p>Usually the report is very good and diagnosing and telling you which booleans to activate, however in this instance we have to create our own module.</p>
<p>First: Download and install selinux-policy-devel<br />
Second: Parse through the raw audit messages. We are looking for two things; message type and comm name.<br />
Third: Run the ausearch command and pipe it to audit2allow<br />
For instance: <code>ausearch -m AVC --comm cleanup | audit2allow -M ClamAV</code></p>
<p>Once the files have been generated then run: <code>semodule -i ClamAV.pp</code> and see if the problem has been resolved. If not, tail the messages log again to see if there is any additional SEAlerts that you should be aware of.</p>
<div class="tweetthis" style="text-align:left;"><p> <a target="_blank" rel="nofollow" class="tt" href="http://twitter.com/intent/tweet?text=Editing+SELinux+Policies+http%3A%2F%2Fjasonbrown.us%2F%3Fp%3D8" title="Post to Twitter"><img class="nothumb" src="http://www.jasonbrown.us/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter-big2.png" alt="Post to Twitter" /></a></p></div>]]></content:encoded>
			<wfw:commentRss>http://www.jasonbrown.us/2010/02/editing-selinux-policies/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>RHEL/CentOS 5 server security</title>
		<link>http://www.jasonbrown.us/2010/01/rhelcentos-5-server-security/</link>
		<comments>http://www.jasonbrown.us/2010/01/rhelcentos-5-server-security/#comments</comments>
		<pubDate>Sun, 17 Jan 2010 13:52:09 +0000</pubDate>
		<dc:creator>jason</dc:creator>
				<category><![CDATA[NSA]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[RHEL]]></category>
		<category><![CDATA[SELinux]]></category>
		<category><![CDATA[sysctl]]></category>

		<guid isPermaLink="false">http://www.jasonbrown.us/?p=14</guid>
		<description><![CDATA[As a part of the sys admin&#8217;s job, it is important to take a few extra minutes to go through and properly secure a newly installed Linux server. These steps include enabling SELinux on the machine, configuring the firewall, and setting user permissions. There are however additional steps one should take in order to secure ]]></description>
			<content:encoded><![CDATA[<p>As a part of the sys admin&#8217;s job, it is important to take a few extra minutes to go through and properly secure a newly installed Linux server. These steps include enabling SELinux on the machine, configuring the firewall, and setting user permissions. There are however additional steps one should take in order to secure their server. One would be to tune and secure kernel parameters, set limits on kernel dumps, prevent IPv6 from loading if you company is not using it, and turning off unnecessary services.</p>
<p><em><strong><code>Networking</code></strong></em><br />
First, lets take a look at configuring kernel parameters to prevent network based attacks. These include disallowing intruders to alter routing tables and source routed packets, preventing an intruder from configuring the server to become a router, and turning on reverse path filtering. To change these settings edit the /etc/sysctl.conf file and enter:<br />
<code>net.ipv4.conf.all.accept_source_route = 0<br />
net.ipv4.conf.all.accept_redirects = 0<br />
net.ipv4.conf.all.secure_redirects = 0<br />
net.ipv4.conf.all.log_martians = 1<br />
net.ipv4.conf.default.accept_source_route = 0<br />
net.ipv4.conf.default.accept_redirects = 0<br />
net.ipv4.conf.default.secure_redirects = 0<br />
net.ipv4.icmp_echo_ignore_broadcasts = 1<br />
net.ipv4.icmp_ignore_bogus_error_messages = 1<br />
net.ipv4.tcp_syncookies = 1<br />
net.ipv4.conf.all.rp_filter = 1<br />
net.ipv4.conf.default.rp_filter = 1</code></p>
<p>If you are currently running IPv6 at your company, here are a few kernel parameters to prevent network based attacks:<br />
<code>net.ipv6.conf.default.router_solicitations = 0<br />
net.ipv6.conf.default.accept_ra_rtr_pref = 0<br />
net.ipv6.conf.default.accept_ra_pinfo = 0<br />
net.ipv6.conf.default.accept_ra_defrtr = 0<br />
net.ipv6.conf.default.autoconf = 0<br />
net.ipv6.conf.default.dad_transmits = 0<br />
net.ipv6.conf.default.max_addresses = 1</code></p>
<p>To make these settings effective without rebooting the server type <code>sysctl -p</code></p>
<p>We can go a step further by disabling unused network functions such as IPv6 and prevent self assigned addressing.</p>
<p>To detect whether or not IPv6 is running on a server type: <code>ifconfig | grep inet6</code> which will return:<br />
<code>inet6 addr: fe80::240:5ff:fe32:ef19/64 Scope:Link<br />
inet6 addr: ::1/128 Scope:Host<br />
inet6 addr: fe80::200:ff:fe00:0/64 Scope:Link</code><br />
To prevent IPv6 from loading, run the following command:<br />
<code>echo "install ipv6 /bin/true" &gt; /etc/modprobe.d/ipv6</code><br />
Then add the following lines to <code>/etc/sysconfig/network</code>:<br />
<code>NETWORKING_IPV6=no<br />
IPV6INIT=no</code><br />
This will deactivate the IPv6 protocol from running on the server.</p>
<p>To prevent self assigned addressing on network cards, open the <code>/etc/sysconfig/network</code> file and add:<br />
<code>NOZEROCONF=yes</code></p>
<p><em><strong><code>Server security</code></strong></em><br />
Turning off the ability to create core dumps is important as intruders can use this to gather information about running services and configurations in order to exploit them. To do so, edit the <code>/etc/security/limits.conf</code> file and insert:<br />
* hard core 0<br />
We should also prevent setuid programs from creating these as well:<br />
<code>sysctl -w fs.suid_dumpable=0</code></p>
<p>There are also built in kernel features which can help protect against buffer overflow attacks. These features are turned on by default, however these kernel parameters should be enabled in case they have been turned off:<br />
<code>sysctl -w kernel.exec-shield=1<br />
sysctl -w kernel.randomize_va_space=1</code><br />
These settings ensure randomization of the stack and memory regions, which are refereed to as the ExecShield.</p>
<p>There are many services which are running on a default installation which include cups, sendmail, isdn, bluetooth, and many others. If these services are not being used on the server then they should be turned off and configured not to start up on a reboot. To do so we can run the following bash script:<br />
<code>for i in acpid autofs avahi-daemon luetooth cups firstboot gpm hidd ip6tables sendmail exim xfs xinetd yum-updatesd rhnsd pcscd readahead_early readahead_later apmd hplip isdn ip6tables mcstrans<br />
do<br />
service $i stop<br />
chkconfig $i off<br />
done</code></p>
<p>Your services will vary depending on the installation. We should also ensure that X does not run on reboot, placing the server in run level three. To do so, edit the <code>/etc/inittab</code> file and change <code>id:5:initdefault:</code> to <code>id:3:initdefault:</code></p>
<div class="tweetthis" style="text-align:left;"><p> <a target="_blank" rel="nofollow" class="tt" href="http://twitter.com/intent/tweet?text=RHEL%2FCentOS+5+server+security+http%3A%2F%2Fjasonbrown.us%2F%3Fp%3D14" title="Post to Twitter"><img class="nothumb" src="http://www.jasonbrown.us/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter-big2.png" alt="Post to Twitter" /></a></p></div>]]></content:encoded>
			<wfw:commentRss>http://www.jasonbrown.us/2010/01/rhelcentos-5-server-security/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

