<?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>Blog Smarter &#187; linux</title>
	<atom:link href="http://mattdunlap.org/tag/linux/feed" rel="self" type="application/rss+xml" />
	<link>http://mattdunlap.org</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Thu, 29 Jul 2010 17:32:52 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>How to secure a cloud webserver with iptables</title>
		<link>http://mattdunlap.org/website-development/webservers/how-to-secure-a-cloud-webserver-with-iptables.html</link>
		<comments>http://mattdunlap.org/website-development/webservers/how-to-secure-a-cloud-webserver-with-iptables.html#comments</comments>
		<pubDate>Fri, 16 Jul 2010 15:00:53 +0000</pubDate>
		<dc:creator>Matt Dunlap</dc:creator>
				<category><![CDATA[Webservers]]></category>
		<category><![CDATA[cloud]]></category>
		<category><![CDATA[firewalls]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[webserver]]></category>

		<guid isPermaLink="false">http://mattdunlap.org/?p=1686</guid>
		<description><![CDATA[Probably the most confusing aspect of managing a cloud server is how to keep it secure. Well I have some good news, most hacks occur from bad passwords, not from someone breaking in through an open port.]]></description>
			<content:encoded><![CDATA[<p>Probably the most confusing aspect of managing a cloud server is how to keep it secure. Well I have some good news, most hacks occur from bad passwords, not from someone breaking in through an open port.</p>
<p>The bad news is that WordPress is notorious for allowing bad guys in via plugins. Since anyone can write a plugin for wordpress, many times the coding standards are not very high. I&#8217;ve been bitten by a bad plugin before. It took me a while to figure out what was happening to my server. As soon as I rebuilt it, the hacker would break in&#8230; I finally narrowed it down to a plugin. Unfortunately it was days of downtime beck then because I was on a dedicated server. With cloud server, it sucks, but at least you can be back up in a couple hours.</p>
<p>With that being said, WordPress also gets falsely blamed for a lot of websites getting hacked, but in reality, the user probably had a bad, easy to crack password.</p>
<p>Let&#8217;s get started</p>
<p>When you first start a cloud webserver, the only open port  is 22 (ssh). You never want to shut this port down, because it is your lifeline to manage a server if all hell breaks loose. When I first start a server, I flush the firewall, just so I can get moving quickly.</p>
<pre class="brush: plain;">
iptables -F
</pre>
<p>I then go and do my business of installing <a href="http://mattdunlap.org/website-development/webservers/how-to-deploy-a-cloud-webserver-lamp.html">LAMP</a> and <a href="http://mattdunlap.org/website-development/webservers/cloud-servers-made-easy-introduction-to-webmin.html">webmin</a>.</p>
<p>After LAMP is working properly, it&#8217;s time to secure the server. Remember, at this point it is all wide open</p>
<p>My first warning is to remember that iptables work in order, so if you first directive is to drop all, you are going to get locked out immediately&#8230; You will probably have to reboot the cloud server, and hopefully it will use the old configuration with port 22 open. So you want to create all your allowed ports first, then shut the door on the rest.</p>
<p>Allow port 22, 80 and 10000. This is ssh, web, and webmin</p>
<pre class="brush: plain;">
iptables -A INPUT -p tcp --dport 22 -j ACCEPT
iptables -A INPUT -p tcp --dport 80 -j ACCEPT
iptables -A INPUT -p tcp --dport 10000 -j ACCEPT
</pre>
<p>That allows access on our three main ports.</p>
<p>Now I <del datetime="2010-07-16T04:44:01+00:00">need</del> want to allow ICMP&#8217;s &#8211; The <strong><a rel="nofollow" href="http://en.wikipedia.org/wiki/Internet_Control_Message_Protocol">Internet Control Message Protocol</a></strong><a href="http://en.wikipedia.org/wiki/Internet_Control_Message_Protocol"> (</a><strong><a href="http://en.wikipedia.org/wiki/Internet_Control_Message_Protocol">ICMP</a></strong><a href="http://en.wikipedia.org/wiki/Internet_Control_Message_Protocol">)</a> is one of the core protocols of the Internet Protocol Suite. It is chiefly used by the operating systems of networked computers to send error messages—indicating, for instance, that a requested service is not available or that a host or router could not be reached.</p>
<pre class="brush: plain;">
iptables -A INPUT -p icmp -j ACCEPT
</pre>
<p>I also want to allow traffic on the loopback adapter</p>
<pre class="brush: plain;">
iptables -A INPUT -i lo -j ACCEPT
</pre>
<p>Next, we will want to use some standard rules for general network traffic. This goes a bit beyond the basic stuff, however iptables can determine the &#8216;state&#8217; that a packet is in. This has to do with standard TCP communication. For example, the 3 way handshake between two hosts when transmitting data. <strong>Source:</strong> <a href=" http://www.5dollarwhitebox.org/wiki/index.php/Howtos_Basic_IPTables">Howto Basic Ip Tables</a></p>
<pre class="brush: plain;">
iptables -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -A FORWARD -i eth0 -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -A OUTPUT -m state --state NEW,RELATED,ESTABLISHED -j ACCEPT
</pre>
<p>Now let&#8217;s shut out everything else, save the config and then restart ip tables</p>
<pre class="brush: plain;">
iptables -A INPUT -i eth0 -j DROP
service iptables save
/etc/init.d/iptables restart
</pre>
<p><strong>Below is a screenshot of the Linux firewall in Webmin one you are done</strong></p>
<p><img class="aligncenter size-full wp-image-1690" title="iptables webmin linux firewall" src="http://mattdunlap.org/wp-content/uploads/2010/07/iptables.jpg" alt="iptables webmin linux firewall" width="640" height="475" /></p>
<p>Doing the research for this setup, I found many different ways that people secure their servers. I think this is a very solid solution for a typical cloud webserver.</p>
<p>References used for this blog post:</p>
<p><a href="http://www.tty1.net/blog/2007-02-06-iptables-firewall_en.html">Advanced firewall techniques, including solutions to brute force attacks</a></p>
<p><a href="http://www.5dollarwhitebox.org/wiki/index.php/Howtos_Basic_IPTables">5dollarwhitebox.org - Easy to follow firewall example solution</a></p>
<img src="http://mattdunlap.org/?ak_action=api_record_view&id=1686&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://mattdunlap.org/website-development/webservers/how-to-secure-a-cloud-webserver-with-iptables.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Why Google ChromeOS is all Hype</title>
		<link>http://mattdunlap.org/my-personal-blog/opinion/why-google-chromeos-is-all-hype.html</link>
		<comments>http://mattdunlap.org/my-personal-blog/opinion/why-google-chromeos-is-all-hype.html#comments</comments>
		<pubDate>Thu, 09 Jul 2009 04:31:33 +0000</pubDate>
		<dc:creator>Matt Dunlap</dc:creator>
				<category><![CDATA[Opinion]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[chromeOS]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[microsoft]]></category>
		<category><![CDATA[opensocial]]></category>
		<category><![CDATA[palm pre]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://mattdunlap.org/?p=370</guid>
		<description><![CDATA[Earlier today there was a huge buzz about Google dropping a nuclear bomb on Microsoft with the announcement of ChromeOS. The second OS released by Google. The first OS is Android, which runs on the Google G1 phone. Android can run on netwbooks We already know that Google’s intentions aren’t to limit the Android platform [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignright size-full wp-image-375" style="margin: 20px;" title="chrome" src="http://mattdunlap.org/wp-content/uploads/2009/07/chrome.jpg" alt="chrome" width="220" height="293" />Earlier today there was a huge buzz about <a href="http://www.techcrunch.com/2009/07/07/google-drops-a-nuclear-bomb-on-microsoft-and-its-made-of-chrome/">Google dropping a nuclear bomb on Microsoft with the announcement of ChromeOS</a>. The second OS released by Google. The first OS is Android, which runs on the Google G1 phone. <a href="http://gigaom.com/2008/12/23/a-netbook-with-android-far-fetched-or-coming-soon/">Android can run on netwbooks</a></p>
<blockquote><p>We already know that Google’s intentions aren’t to limit the Android platform to mobile phones. With the right hardware and expectations that these devices can truly be portable thin clients, an Android netbook might not be so far-fetched after all.</p></blockquote>
<p>The problem with Google making an OS isn&#8217;t the fact that they are notorious for announcing products that turn out to be nothing more then feeble attempt to gain media exposure when a competitor is about to release a product or service. Google buys a ton of start-ups and <a href="http://blogmaverick.com/2009/07/05/the-freemium-company-lifecycle-challenge/">Mark Cuban has an explaination why</a>. Case in point, <a href="http://code.google.com/apis/opensocial/">Opensocial</a>. Opensocial was announce way too early because of the release of the Facebook platform, AKA Facebook apps. I was really excited about Opensocial and followed for about a year, learning how to implement it because all the major communities were jumping on like Linkedin, Myspace, Orkut (for you Brazilians), but it turned out to be absolutely useless. The concept behind Opensocial was to run common function across many website enabling personal data to exchange between communities.</p>
<p>Why did they release so early? Simple to create buzz. how cares what happens 2 years down the road. How many people will remember the service when it fades away? They got the press they wanted in 2007, they did their job.  Google needs to take notes from Apple about how to squash a release. <a href="http://blogs.wsj.com/marketbeat/2009/06/09/palm-misdialed-pre-release-date-as-iphone-makes-the-connection-with-investors/">Apple owned the Palm Pre on the release date</a>.</p>
<p><strong>So, why did Google announce the ChromeOS now? it&#8217;s still 2 years from release date?</strong></p>
<ol>
<li>Both Microsoft and Apple have new OS&#8217;s this year. Windows 7 is basically a service patch for Vista, or Mojave, or Longhorn, whatever MS calls it now&#8230; Hell MS just wishes Vista would go away too&#8230;</li>
<li>The New smartphone OS&#8217;s will run on netbooks. &#8211; Imagine the iPhone OS on an 8 inch netbook&#8230; To me that sounds awesome. Other OS&#8217;s include the android OS and the Palm OS, which is HTML based&#8230; All these have app markets which fits in nicely to the lightweight netbook market.</li>
<li>There is another OS out their called Linux, you might have heard about it from your grandma. It&#8217;s open source which is great, but also allows for many, many distributions. Will this happen to ChromeOS? too many choices makes people choose Apple or MS.</li>
<li>If you really think about it, ChromeOS, runs on the Linux kernel? so doesn&#8217;t that just make it another distribution? I would assume that Google&#8217;s not going to hide the terminal?</li>
<li>Linux already has an app market called Synaptic. Of course everything is free on synaptic and it&#8217;s not really an app market, it&#8217;s a GUI to apt-get, but can easily accommodate a marketplace. I even think <a href="http://store.steampowered.com/">Steam</a> can be a full blown app market.</li>
</ol>
<p>We all now Google is gunning for MS, and we all now Google has the power to make an OS&#8230; I&#8217;m just wondering why they are talking about it now.</p>
<img src="http://mattdunlap.org/?ak_action=api_record_view&id=370&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://mattdunlap.org/my-personal-blog/opinion/why-google-chromeos-is-all-hype.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
