<?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>BuildDocs.com - Operating System and Application Build Documents Repository &#187; Security</title>
	<atom:link href="http://builddocs.com/categories/security_applications/feed/" rel="self" type="application/rss+xml" />
	<link>http://builddocs.com</link>
	<description>Better Docs / Better Systems</description>
	<lastBuildDate>Thu, 15 Jul 2010 11:22:39 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>10 Simple Steps to RedHat Linux Security</title>
		<link>http://builddocs.com/security_applications/10-simple-steps-to-redhat-linux-security/</link>
		<comments>http://builddocs.com/security_applications/10-simple-steps-to-redhat-linux-security/#comments</comments>
		<pubDate>Tue, 20 Oct 2009 11:42:57 +0000</pubDate>
		<dc:creator>joshhrob</dc:creator>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[Server]]></category>
		<category><![CDATA[hardening]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[redhat]]></category>

		<guid isPermaLink="false">http://builddocs.com/?p=1074</guid>
		<description><![CDATA[This document outlines 10 easy-to-implement steps to lockdown a RedHat Linux server. This document assumes a fresh vanilla RedHat 5.4 install as described in the post Installing RedHat 5.4 64 bit.
Not all of the below steps are appropriate for all systems. You will need to use your judgment to pick and choose which security measures [...]]]></description>
			<content:encoded><![CDATA[<p>This document outlines 10 easy-to-implement steps to lockdown a RedHat Linux server. This document assumes a fresh vanilla RedHat 5.4 install as described in the post <a href="http://builddocs.com/server_os_builds/installing-redhat-5-4-64-bit/">Installing RedHat 5.4 64 bit</a>.</p>
<p>Not all of the below steps are appropriate for all systems. You will need to use your judgment to pick and choose which security measures are relevant to your environment.</p>
<p>1. <a href="#banner">Configure Security Banners/Disclaimers</a><br />
2. <a href="#grub">Set GRUB boot loader password</a><br />
3. <a href="#single">Password protect single user mode</a><br />
4. <a href="#passwords">Configure Password Policy</a><br />
5. <a href="#services">Disable Unnecessary Services</a><br />
6. <a href="#accounts">Delete Unnecessary accounts and groups</a><br />
7. <a href="#sysadmin">Restrict su to sysadmin group</a><br />
8. <a href="#ssh">Prevent root login through ssh</a><br />
9. <a href="#tcp_wrappers">Configure IP Access Controls with tcp_wrappers</a><br />
10. <a href="#limits">Resource Limits</a></p>
<p><a name="banner"></a></p>
<h2><a name="banner">Configure Security Banners/Disclaimers<br />
</a></h2>
<p>The Security Banner refers to the message that is displayed when users log in. Banners provide legal protection against unauthorized access attempts and provide a means to prosecute violators.</p>
<p>Here is an example of a generic banner:<br />
<em><br />
Warning! This is a private system.  Unauthorized access to or use of this system is strictly prohibited. Unauthorized users are subject to criminal prosecution and penalties. </em></p>
<p><em><img class="aligncenter size-full wp-image-1137" title="6" src="http://builddocs.com/wp-content/uploads/2009/10/61.jpg" alt="6" width="466" height="288" /><br />
</em></p>
<p>To configure a banner in Redhat, edit the file /etc/issue:</p>
<p><strong>su root</strong><br />
<em>Enter root password</em><br />
<strong>vi /etc/issue</strong></p>
<p>Use vi commands to edit file and replace with your banner text. Enter <strong>ESC:x!</strong> when finished to save file.</p>
<p><img class="aligncenter size-full wp-image-1135" title="2" src="http://builddocs.com/wp-content/uploads/2009/10/23.jpg" alt="2" width="560" height="420" /></p>
<p>In order for this banner to be displayed when users attempt to ssh to your server you will need to add it to the sshd_config file.</p>
<p><strong>vi /etc/ssh/sshd_config</strong></p>
<p>Arrow down to the line that begins with Banner. By default it should be</p>
<p><em>#Banner /some/banner</em></p>
<p>Edit this line, removing the # character and change the path to point to the /etc/issue file from above.</p>
<p><strong>Banner /etc/issue</strong></p>
<p>Enter <strong>ESC:x!</strong> when finished to save file.</p>
<p><img class="aligncenter size-full wp-image-1136" title="4" src="http://builddocs.com/wp-content/uploads/2009/10/42.jpg" alt="4" width="560" height="420" /></p>
<p>Enter the following command to restart the ssh server for the changes to take effect:</p>
<p><strong>/etc/init.d/sshd restart</strong></p>
<p><a name="grub"></a></p>
<h2><a name="grub">Set GRUB boot loader password</a></h2>
<p>Setting a password on the grub boot loader will require you to enter a password before booting the system. Although this is a recommended security practice, it is worth mentioning that this can be annoying, especially if you ever need to reboot the system remotely. I would not recommend this if you do not have physical access to the server.</p>
<p>The first step is to create a MD5 representation of your password. Enter the following to execute the grub md5 utility:</p>
<p><strong>/sbin/grub-md5-crypt</strong></p>
<p>Enter your password and confirm it. The program will generate an encrypted string. Carefully copy this string to a notepad.</p>
<p><img class="aligncenter size-full wp-image-1139" title="7" src="http://builddocs.com/wp-content/uploads/2009/10/72.jpg" alt="7" width="560" height="420" /></p>
<p>Next you will need to edit the grub config file and add this encrypted password:</p>
<p><strong>su root</strong><br />
<em>Enter root password</em><br />
<strong>vi /boot/grub/grub.conf</strong></p>
<p>Insert a new line as following, placing your md5 password string after the &#8211;md5:</p>
<p>password &#8211;md5 $5Hhd9D4HEO7$%df8fHdLO9PDjU70</p>
<p>Save the file by entering <strong>ESC:x!</strong></p>
<p><strong><img class="aligncenter size-full wp-image-1140" title="9" src="http://builddocs.com/wp-content/uploads/2009/10/92.jpg" alt="9" width="560" height="420" /><br />
</strong></p>
<p>Reboot and verify that the new password is working.</p>
<p><img class="aligncenter size-full wp-image-1141" title="10" src="http://builddocs.com/wp-content/uploads/2009/10/102.jpg" alt="10" width="504" height="280" /></p>
<p>Note: If for some reason this doesn&#8217;t work you may be locked out of your system. You will need to insert the RedHat installation CD/DVD and boot the system in recovery mode in order to undo the changes. To undo above edit the /boot/grub/grub.conf file and remove or comment out the password line.</p>
<p><a name="single"></a></p>
<h2>Password protect single user mode</h2>
<p>Single user mode is a system maintenance mode similar to windows safemode. If an attacker obtains access to the console he/she could potentially exploit this capability to bypass security controls and obtain root access to the system. It is a good idea to protect single user mode with a password to help prevent this.</p>
<p>Doing so is actually quite easy. Edit the /etc/inittab as followsg:</p>
<p><strong>su root</strong><br />
<em>Enter root password</em><br />
<strong>vi /etc/inittab</strong></p>
<p>Insert the following line:</p>
<p><strong>~~:S:wait:/sbin/sulogin</strong></p>
<p>Type <strong>ESC:x!</strong> to save and exit.</p>
<p><img class="aligncenter size-full wp-image-1143" title="12" src="http://builddocs.com/wp-content/uploads/2009/10/122.jpg" alt="12" width="560" height="420" /></p>
<p><a name="passwords"></a></p>
<h2>Configure Password Policy</h2>
<p>The following settings force users to change their password every 90 days and enforce passwords at least 8 characters long.</p>
<p><strong>su root</strong><br />
<em>Enter root password</em><br />
<strong>vi /etc/login.defs</strong></p>
<p>Edit the file as follows:</p>
<p>PASS_MAX_DAYS 90<br />
PASS_MIN_DAYS 1<br />
PASS_MIN_LEN 8<br />
PASS_WARN_AGE 14</p>
<p>Type <strong>ESC:x!</strong> to save and exit</p>
<p><img class="aligncenter size-full wp-image-1144" title="14" src="http://builddocs.com/wp-content/uploads/2009/10/142.jpg" alt="14" width="560" height="420" /></p>
<p><a name="services"></a></p>
<h2>Disable Unnecessary Services</h2>
<p>An important security principle is &#8220;if you don&#8217;t need it, disable it&#8221;. All running services expose the system to some level of risk. Obviously, some services are much more vulnerable than others but often you don&#8217;t know what the vulnerabilities of any given service are, and some may yet to have been discovered.</p>
<p>To see what services are enabled enter:</p>
<p><strong>/sbin/chkconfig &#8211;list</strong></p>
<p><strong><img class="aligncenter size-full wp-image-1146" title="15" src="http://builddocs.com/wp-content/uploads/2009/10/152.jpg" alt="15" width="560" height="420" /><br />
</strong></p>
<p>To disable a service enter:</p>
<p><strong>/sbin/chkconfig -del</strong> <em>service</em></p>
<p>At a minimum the following should be disabled:</p>
<p>/sbin/chkconfig -del bluetooth<br />
/sbin/chkconfig -del cups<br />
/sbin/chkconfig -del autofs<br />
/sbin/chkconfig -del isdn<br />
/sbin/chkconfig -del portmap<br />
/sbin/chkconfig -del vncserver<br />
/sbin/chkconfig -del mdmonitor<br />
/sbin/chkconfig -del winbind</p>
<p><img class="aligncenter size-full wp-image-1147" title="16" src="http://builddocs.com/wp-content/uploads/2009/10/163.jpg" alt="16" width="560" height="420" /></p>
<p>It is also a good idea to go through the /etc/xinetd.d directory and delete any unused services here. For example:</p>
<p>rm /etc/xinetd.d/gssftp<br />
rm /etc/xinetd.d/krb5-telnet<br />
rm /etc/xinetd.d/tftp<br />
rm /etc/xinetd.d/daytime*<br />
rm /etc/xinetd.d/chargen*<br />
rm /etc/xinetd.d/ekrg5-telnet*</p>
<p><img class="aligncenter size-full wp-image-1148" title="17" src="http://builddocs.com/wp-content/uploads/2009/10/172.jpg" alt="17" width="560" height="420" /></p>
<p><a name="accounts"></a></p>
<h2>Delete Unnecessary accounts and groups</h2>
<p>There are a number of default accounts and groups that you probably will never need and having them around can be a potential risk. Use the following commands to delete them:</p>
<p><strong>/sbin/userdel adm<br />
/sbin/groupdel adm<br />
/sbin/userdel lp<br />
/sbin/groupdel lp<br />
/sbin/userdel shutdown<br />
/sbin/groupdel shutdown<br />
/sbin/userdel halt<br />
/sbin/groupdel halt<br />
/sbin/userdel news<br />
/sbin/groupdel news<br />
/sbin/userdel uucp<br />
/sbin/groupdel uucp<br />
/sbin/userdel operator<br />
/sbin/groupdel operator<br />
/sbin/userdel games<br />
/sbin/groupdel games<br />
/sbin/userdel gopher<br />
/sbin/groupdel gopher<br />
/sbin/userdel ftp<br />
/sbin/groupdel ftp<br />
/sbin/userdel mail<br />
/sbin/groupdel mail<br />
/sbin/userdel xfs<br />
/sbin/groupdel xfs<br />
/sbin/userdel ntp<br />
/sbin/groupdel ntp<br />
/sbin/userdel mailnull<br />
/sbin/groupdel mailnull<br />
/sbin/userdel pcap<br />
/sbin/groupdel pcap<br />
</strong></p>
<p><a name="sysadmin"></a></p>
<h2>Restrict su to sysadmin group</h2>
<p>Another layer of protection is to prevent unprivileged users from being able to execute the su command, denying them the ability to become more powerful users.</p>
<p>The first step is to create a system administrators group. Only trusted system admins should be made members of this group.</p>
<p><strong>/usr/sbin/groupadd sysadmin</strong></p>
<p><img class="aligncenter size-full wp-image-1153" title="24" src="http://builddocs.com/wp-content/uploads/2009/10/24.jpg" alt="24" width="560" height="420" /></p>
<p>Next, enter the following commands to restrict the su command to this group:</p>
<p>chgrp sysadmin /bin/su<br />
chmod o-rwx /bin/su</p>
<p><img class="aligncenter size-full wp-image-1154" title="25" src="http://builddocs.com/wp-content/uploads/2009/10/25.jpg" alt="25" width="560" height="420" /></p>
<p>Finally, make sure to add existing system admins to the sysadmin group. For each account execute the following:</p>
<p><strong>/usr/sbin/usermod -g sysadmin <em>username</em></strong></p>
<p><strong><em><img class="aligncenter size-full wp-image-1155" title="26" src="http://builddocs.com/wp-content/uploads/2009/10/26.jpg" alt="26" width="560" height="420" /><br />
</em></strong></p>
<p><a name="ssh"></a></p>
<h2>Prevent root login through ssh</h2>
<p>There is one very well known account that you can&#8217;t really get rid of: root. However, one measure you can take to prevent people from trying to access this account is to disallow login as root through ssh.</p>
<p>This is another very easy one to implement. All you need to do is edit the /etc/ssh/sshd_config, uncomment the PermitRootLogin line and set it to no.</p>
<p><strong>su root</strong><br />
<em>Enter root password</em><br />
<strong>vi /etc/ssh/sshd_config</strong></p>
<p>Change the line:</p>
<p><em>#PermitRootLogin yes</em></p>
<p>To:</p>
<p><strong>PermitRootLogin no</strong></p>
<p><strong><img class="aligncenter size-full wp-image-1149" title="19" src="http://builddocs.com/wp-content/uploads/2009/10/191.jpg" alt="19" width="560" height="420" /></strong></p>
<p><a name="tcp_wrappers"></a></p>
<h2>Configure IP Access Controls with tcp_wrappers</h2>
<p>TCP_Wrappers is a security framework used to enforce ip address access controls on services such as ssh and ftp. It is installed by default in RedHat and most linux/unix distros. It can be used two ways: you can deny specified ip address or you can restrict access to only allowed ip addresses. In the following example we will do the later.</p>
<p>There are two configuration files that control the access: /etc/hosts.allow and /etc/hosts.deny. As the names imply, hosts.allow lists ip addresses that are allowed, and hosts.deny lists ip addressses that are not allowed.</p>
<p>In the following example we will first configure the hosts.deny file to deny ALL, and then configure the hosts.allow file to only permit ssh for users on the 192.168.1 subnet.</p>
<p><strong>su root</strong><br />
<em>Enter root password</em><br />
<strong>vi /etc/hosts.deny</strong></p>
<p>add the line:</p>
<p><strong>ALL: ALL</strong></p>
<p><strong>ESC:x!</strong> to save</p>
<p><img class="aligncenter size-full wp-image-1150" title="20" src="http://builddocs.com/wp-content/uploads/2009/10/20.jpg" alt="20" width="560" height="420" /></p>
<p><strong>vi /etc/hosts.allow</strong></p>
<p>add the line:</p>
<p><strong>sshd: 192.168.1</strong></p>
<p><strong>ESC:x!</strong> to save</p>
<p><img class="aligncenter size-full wp-image-1152" title="23" src="http://builddocs.com/wp-content/uploads/2009/10/231.jpg" alt="23" width="560" height="420" /></p>
<p><a name="limits"></a></p>
<h2>Resource Limits</h2>
<p>These settings will prevent users from consuming too many resources. These changes will have the following effects: file sized will be limited to 100 MB and users can have a maximum of 150 concurrent processes running.</p>
<p>su root<br />
Enter root password<br />
vi /etc/security/limits</p>
<p>Insert the following lines at the bottom of the file:<br />
hard fsize 102400<br />
hard nproc 150</p>
<p><img class="aligncenter size-full wp-image-1156" title="27" src="http://builddocs.com/wp-content/uploads/2009/10/27.jpg" alt="27" width="560" height="420" /></p>
]]></content:encoded>
			<wfw:commentRss>http://builddocs.com/security_applications/10-simple-steps-to-redhat-linux-security/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Building a WSUS 3.0 Server On Windows 2003</title>
		<link>http://builddocs.com/security_applications/building-a-wsus-3-0-server-on-windows-2003/</link>
		<comments>http://builddocs.com/security_applications/building-a-wsus-3-0-server-on-windows-2003/#comments</comments>
		<pubDate>Thu, 27 Aug 2009 23:05:03 +0000</pubDate>
		<dc:creator>cmarino2</dc:creator>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[Server]]></category>
		<category><![CDATA[windows update]]></category>
		<category><![CDATA[wsus]]></category>

		<guid isPermaLink="false">http://builddocs.com/?p=869</guid>
		<description><![CDATA[Please note that WSUS requires IIS to be installed, along with SQL Server 2005.
Part I: Installing WSUS
Begin by launching the WSUS Installer. Click Next.

Choose &#8220;Full Server Installation including Administration Console&#8221;.

Choose &#8220;I accept the terms of this Licence Agreement&#8221;.

Choose &#8220;Store Updates Locally&#8221; Browse to the folder you want to store your Microsoft patches and Updates. Choose [...]]]></description>
			<content:encoded><![CDATA[<p>Please note that WSUS requires IIS to be installed, along with SQL Server 2005.</p>
<p>Part I: Installing WSUS</p>
<p>Begin by launching the WSUS Installer. Click Next.</p>
<p><img class="size-full wp-image-871 alignnone" src="http://builddocs.com/wp-content/uploads/2009/08/1.jpg" alt="1" width="502" height="384" /></p>
<p>Choose &#8220;Full Server Installation including Administration Console&#8221;.</p>
<p><img class="alignnone size-full wp-image-872" src="http://builddocs.com/wp-content/uploads/2009/08/2.jpg" alt="2" width="500" height="381" /></p>
<p>Choose &#8220;I accept the terms of this Licence Agreement&#8221;.</p>
<p><img class="alignnone size-full wp-image-873" src="http://builddocs.com/wp-content/uploads/2009/08/3.jpg" alt="3" width="543" height="411" /></p>
<p>Choose &#8220;Store Updates Locally&#8221; Browse to the folder you want to store your Microsoft patches and Updates. Choose next.</p>
<p><img class="alignnone size-full wp-image-874" src="http://builddocs.com/wp-content/uploads/2009/08/4.jpg" alt="4" width="546" height="408" /></p>
<p>Choose &#8220;Use an existing database on this computer&#8221;. WSUS will connect to the SQL Server database you have already installed on the server. If you have more than one database, choose the appropriate database from the drop down.(Default is if you only have one databse).</p>
<p>Click Next.</p>
<p><img class="alignnone size-full wp-image-875" src="http://builddocs.com/wp-content/uploads/2009/08/5.jpg" alt="5" width="544" height="410" /></p>
<p>WSUS will attempt to connect to the database you have chosen. Click next.</p>
<p><img class="alignnone size-full wp-image-876" src="http://builddocs.com/wp-content/uploads/2009/08/6.jpg" alt="6" width="547" height="410" /></p>
<p>Click Next.</p>
<p><img class="alignnone size-full wp-image-877" src="http://builddocs.com/wp-content/uploads/2009/08/8.jpg" alt="8" width="542" height="413" /></p>
<p>Click Finish. WSUS is now installed.</p>
<p><img class="alignnone size-full wp-image-878" src="http://builddocs.com/wp-content/uploads/2009/08/9.jpg" alt="9" width="502" height="384" /></p>
<p>Part II: Initial Configuration</p>
<p>Click Next.</p>
<p><img class="aligncenter size-full wp-image-894" title="10" src="http://builddocs.com/wp-content/uploads/2009/08/101.jpg" alt="10" width="452" height="398" /></p>
<p>Click Next (Joining the Microsoft Update Improvement Program is a personal decision).</p>
<p><img class="aligncenter size-full wp-image-895" title="11" src="http://builddocs.com/wp-content/uploads/2009/08/111.jpg" alt="11" width="450" height="398" /></p>
<p>Select &#8220;Synchronize from Microsoft Update&#8221;. This now your primary (parent) WSUS server. WSUS will go to Microsoft Update to download all the patches chosen by the WSUS administrator.</p>
<p><img class="aligncenter size-full wp-image-897" title="12" src="http://builddocs.com/wp-content/uploads/2009/08/121.jpg" alt="12" width="450" height="398" /></p>
<p>OPTIONAL: If you already have a parent WSUS server, you may choose &#8220;Synchronize from another Windows Server Update Services Server&#8221;. This server will get its updates from the parent, and is used in cases in which there are different subnets. (For instance putting the parent server on a production network, and the child server on a development network). This will allow you to keep your servers in synch across subnets.</p>
<p><img class="aligncenter size-full wp-image-898" title="12a" src="http://builddocs.com/wp-content/uploads/2009/08/12a1.jpg" alt="12a" width="450" height="399" /></p>
<p>Whether or not to use a proxy is based on your network configuration. WSUS has been know to have issues using proxy servers.</p>
<p><img class="aligncenter size-full wp-image-899" title="13" src="http://builddocs.com/wp-content/uploads/2009/08/131.jpg" alt="13" width="451" height="399" /></p>
<p>Click &#8220;Start Connecting&#8221;. How long this takes is dependent on your network connection.</p>
<p><img class="aligncenter size-full wp-image-900" title="14" src="http://builddocs.com/wp-content/uploads/2009/08/141.jpg" alt="14" width="451" height="397" /></p>
<p>Choose the languages you want for you updates. Click next.</p>
<p><img class="aligncenter size-full wp-image-902" title="15" src="http://builddocs.com/wp-content/uploads/2009/08/151.jpg" alt="15" width="448" height="349" /></p>
<p>Choose to synchonize manually or automatically. Click next.</p>
<p><img class="aligncenter size-full wp-image-903" title="16" src="http://builddocs.com/wp-content/uploads/2009/08/161.jpg" alt="16" width="449" height="350" /></p>
<p>Check both boxes to begin using your WSUS server. Click Finish.</p>
<p><img class="aligncenter size-full wp-image-904" title="17" src="http://builddocs.com/wp-content/uploads/2009/08/171.jpg" alt="17" width="449" height="398" /></p>
<p>HAPPY PATCHING!</p>
]]></content:encoded>
			<wfw:commentRss>http://builddocs.com/security_applications/building-a-wsus-3-0-server-on-windows-2003/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
