<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>laststation.net</title>
	<atom:link href="http://blog.laststation.net/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.laststation.net</link>
	<description></description>
	<lastBuildDate>Mon, 12 Oct 2009 21:07:21 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='blog.laststation.net' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/2c6fdf08668490358e51276d61e54ec6?s=96&#038;d=http://s2.wp.com/i/buttonw-com.png</url>
		<title>laststation.net</title>
		<link>http://blog.laststation.net</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://blog.laststation.net/osd.xml" title="laststation.net" />
	<atom:link rel='hub' href='http://blog.laststation.net/?pushpress=hub'/>
		<item>
		<title>FIXED: Amazon EC2 vulnerable to UDP flood attacks</title>
		<link>http://blog.laststation.net/2009/10/11/amazon-ec2-still-vulnerable-to-udp-flood-attacks/</link>
		<comments>http://blog.laststation.net/2009/10/11/amazon-ec2-still-vulnerable-to-udp-flood-attacks/#comments</comments>
		<pubDate>Sun, 11 Oct 2009 14:01:55 +0000</pubDate>
		<dc:creator>Radim Marek</dc:creator>
				<category><![CDATA[cloud]]></category>

		<guid isPermaLink="false">http://blog.laststation.net/?p=261</guid>
		<description><![CDATA[Unfortunate events surrounding the DDoS attack against BitBucket kicked-off heated discussions about the nature of this vulnerability. Where Amazon officially acknowledged this to be a single isolated incident, many others started asking questions why did it happen in first place?
 - Was BitBucket&#8217;s security group configuration set to block UDP traffic?
 - How come they [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.laststation.net&blog=8338629&post=261&subd=radimmarek&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">Unfortunate events surrounding the DDoS attack against BitBucket kicked-off heated discussions about the nature of this vulnerability. Where Amazon officially acknowledged this to be a single isolated incident, many others started asking questions why did it happen in first place?</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;"><span style="white-space:pre;"> </span>- Was BitBucket&#8217;s security group configuration set to block UDP traffic?</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;"><span style="white-space:pre;"> </span>- How come they haven&#8217;t got better visibility of the on-going attack?</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;"><span style="white-space:pre;"> </span>- Is this really Amazon&#8217;s fault?</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;"><span style="white-space:pre;"> </span></div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">Both personal and professional interest led me to find out more. Having designed series of tests how to replicate this scenario, started first instance and set up the target environment.</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;"><span style="white-space:pre;"> </span>instance : c1.medium (us-east-1d)</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;"><span style="white-space:pre;"> </span>EBS volume : 200 GB attached to (/dev/sdf)</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;"><span style="white-space:pre;"> </span>monitoring : vmstat, netstat, iptraf, Amazon CloudWatch</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;"><span style="white-space:pre;"> </span>security group : allowed SSH only (port 22/TCP)</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;"><span style="white-space:pre;"> </span></div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">UDP flood set up to be generated from the second instance (c1.medium) using simple Perl script, managing to generate whopping traffic of 650mbit per second (according to iptraf) using 1KB packets to random ports on the target IP.</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">&lt;b&gt;Test 1. Let it run&lt;/b&gt; has been successful in a way there was no visibility on target machine. Still surprised by the traffic level generated on the source box, I&#8217;ve pointed the UDP flood to another machine &#8211; with security group allowing UDP traffic (ports 0 &#8211; 65535) &#8211; to check if the network traffic is able to reach another box. And it was. Not only from the same availability zone, but even from the different ones (tested us-east-1c and us-east-1b).</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">&lt;b&gt;Test 2. consisted of formatting the prepared EBS, 5 samples for both scenario with and without UDP flood.</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;"><span style="white-space:pre;"> </span>Average Time</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;"><span style="white-space:pre;"> </span>no traffic <span style="white-space:pre;"> </span>1m15s</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;"><span style="white-space:pre;"> </span>UDP flood<span style="white-space:pre;"> </span>2m54s</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;"><span style="white-space:pre;"> </span></div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">During the test there were only moderate increase in IO waits (somewhere between 2 &#8211; 4%)</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">&lt;b&gt;Test 3. Bonnie++ performance test of the EBS volume. Running with no incoming traffic, it took around 8 minutes to produce quite reasonable report. Having switched on the UDP flood I&#8217;ve repeated the same tests and my expectation was to see some results in similar time. Fifteen minutes later and bonnie still haven&#8217;t even finished third step (rewriting). Another 10 minutes without any significant progress pointed me to do some research what&#8217;s going on. The box wasn&#8217;t performing virtually any IO operations, and time spent waiting for IO topped 100% every second reading (1s delay). Bingo!</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">To verify if the problem is really caused by incoming UDP flood, I&#8217;ve stopped the traffic for a brief interval (around 7 seconds) and monitored using vmstat:</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">procs &#8212;&#8212;&#8212;&#8211;memory&#8212;&#8212;&#8212;- &#8212;swap&#8211; &#8212;&#8211;io&#8212;- -system&#8211; &#8212;-cpu&#8212;-</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">0  1 893480  11272   3112 1699240    0    0     0     0   10   11  0  0 66 34</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">0  1 893480  11272   3112 1699240    0    0     0     0    9    6  0  0  0 100</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">0  1 893480  11272   3112 1699240    0    0     0     0   10    9  0  0 67 33</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">0  1 893480  11272   3112 1699240    0    0     0     0   11    8  0  0  0 100</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">0  1 893480   8824   3100 1700052    0    0 23808 24864  962  697  0  1 68 31</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">0  1 893480  12284   3084 1697988    0    0 16384 16576  711  424  0  2  4 93</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">0  1 893480   9020   3084 1700088    0    0 20480 20720  817  563  0  1 68 31</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">0  1 893480  10432   3072 1700192    0    0 20864 20720  907  612  0  4  5 90</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">0  1 893480  10976   3040 1699724    0    0 15620 12432  588  423  0  1 68 31</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">0  1 893480  10872   3044 1698556    0    0 12676 16576  600  350  0  2  2 96</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">0  1 893480  10328   3024 1700676    0    0 19976 16576  761  535  0  1 68 31</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">0  1 893480  12408   3004 1698096    0    0  8708 12432  457  254  0  1  4 95</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">0  1 893480  12408   3004 1698096    0    0     0     0    9    7  0  0 67 33</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">0  1 893480  11636   3004 1699120    0    0  1024     0   38   38  0  0  0 100</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">0  1 893480  10548   3004 1700420    0    0  1280     0   47   45  0  0 66 33</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">0  1 893480  10188   3004 1700756    0    0  3584  4144  195  110  0  0  0 100</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">0  1 893480  10120   2992 1697968    0    0  6404  8288  256  205  0  0 67 33</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">0  1 893480  12468   2992 1696864    0    0  8064  8288  343  250  0  0  2 98</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">0  1 893480  11720   2972 1696984    0    0 12420 12432  495  333  0  0 67 32</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">0  1 893480  10136   2976 1700800    0    0  6916  4144  321  190  0  0  0 100</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">0  1 893480  11972   2956 1698820    0    0  4096  4144  161  117  0  0 67 33</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">0  1 893480  11364   2960 1699480    0    0  3844  4144  200  126  0  0  1 99</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">0  1 893480  11432   2960 1699480    0    0  2944  4144  160   91  0  0 66 34</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">0  1 893480  11156   2960 1699820    0    0   256     0   18   12  0  0  0 100</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">0  1 893480  10884   2960 1700020    0    0   256     0   17   17  0  0 66 34</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">0  1 893480  10856   2960 1700076    0    0     0     0    9    8  0  0  0 100</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">0  1 893480  10856   2960 1700076    0    0     0     0    9    9  0  0 67 33</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">As you can see on line 5 the IO traffic resumed, roughly correlating to the time incoming traffic stopped. Seven seconds later with the UDP traffic back on the box tried to keep up for another quarter of minute before giving it up. Best time to check CloudWatch:</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">&lt;cloud watch image&gt;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">Nothing! Based on my notes the first bonnie run occured at 10:40, switched on the UDP flood at 10:50, and started second bonnie run at 10:52. My patience ran out before 11:30 where there&#8217;s small peak caused by interactive iptraf session.</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">At this point there were no reasons to continue testing. All IO operations to/from EBS volume seemed to be blocked by UDP traffic generated by a single instance!</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">Conclusion</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">BitBucket guys had every reason to be angry. Blocking UDP in the security group configuration only hides the problem. Contraindicating the Jesper Nøhr statement, during this experiment there were no peaks visible using paid monitoring service &#8211; Amazon CloudWatch (see above). Which was probably the amount of information available for AWS 1st line of support.</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">This corresponds to the &#8216;black box&#8217; described by Jesper. Looking back on the results it&#8217;s obvious that</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">- on-demand network capacity backfired in this case</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">- security group configuration is most likely applied on the host system</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">- host architecture seems to be sharing same network interface(s) for actual network traffic as well as network traffic to/from EBS instances. Even though instances got only a single network interface, I would expect this separation to be implemented on the host system. Segregation of the network traffic is one of the first lesson learned in high-exposed clustered environment.</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">- a week after the attack and there isn&#8217;t any fix in place. Hello, Amazon?!?!</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">To be fair, it&#8217;s been the first incident of such a magnitude. Let&#8217;s hope Amazon AWS team will come up with the architecture fix before somebody use the vulnerability in much wider and devastating attack. In mean time, the only workaround we can apply is to hide our instances as much as we can. Load-balancers and proxies in front of the worker instances should be enough, as long as you don&#8217;t share the same host machine.</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">Have a good weekend and good luck protecting your instance&#8217;s IPs!</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">PS: who had the same dark thought as I just had? What about S3?</div>
<p><strong>UPDATE 2009-10-12:</strong> I&#8217;m happy to let you know this post is not longer relevant. Amazon AWS team successfully deployed the fix and the scenario used to simulate Denial of Service attack using UDP flood isn&#8217;t applicable anymore. All that in less than 24 hours after publishing the link on Twitter. Good job!</p>
<p><em>Original post follows.</em></p>
<p><span id="more-261"></span></p>
<p>Unfortunate events surrounding the <a href="http://www.theregister.co.uk/2009/10/09/amazon_cloud_bitbucket_ddos_aftermath/">DDoS attack against BitBucket</a> kicked-off heated discussions about the nature of this vulnerability. Where Amazon officially acknowledged this to be a single isolated incident, many others started asking questions why did it happen in first place?</p>
<ul>
<li>Was BitBucket&#8217;s security group configuration set to block UDP traffic?</li>
<li>How come they haven&#8217;t got better visibility of the on-going attack?</li>
<li>Is this really Amazon&#8217;s fault?</li>
</ul>
<p>Both personal and professional interest led me to find out more. Having designed series of tests how to replicate this scenario, I&#8217;ve started first instance and set up the target environment.</p>
<pre><span style="white-space:pre;">	</span><strong>instance</strong> : c1.medium (us-east-1d)
<span style="white-space:pre;">	</span><strong>EBS volume</strong> : 200 GB attached to (/dev/sdf)
<span style="white-space:pre;">	</span><strong>monitoring</strong> : vmstat, netstat, iptraf, Amazon CloudWatch
<span style="white-space:pre;">	</span><strong>security group</strong> : allowed SSH only (port 22/TCP)</pre>
<p>UDP flood set up to be generated from the second instance (c1.medium) using simple Perl script, managing to generate <strong>whopping traffic of 650mbit per second</strong> (according to iptraf) using 1KB packets to random ports on the target IP.</p>
<p><strong>Test 1. Let it run</strong> has been successful in a way there was no visibility on target machine. Still surprised by the traffic level generated on the source box, I&#8217;ve pointed the UDP flood to another machine &#8211; with security group allowing UDP traffic (ports 0 &#8211; 65535) &#8211; to check if the network traffic is able to reach another box. And it was. Not only from the same availability zone, but even from the different ones (tested us-east-1c and us-east-1b).</p>
<p><strong>Test 2</strong>. consisted of formatting the prepared EBS, 5 samples for both scenario with and without UDP flood.</p>
<pre><span style="white-space:pre;">	</span>No traffic (1m15s)
<span style="white-space:pre;">	</span>UDP Flood (2m54s)</pre>
<p>During the test there were only moderate increase in IO waits (somewhere between 2 &#8211; 4%).</p>
<p><strong>Test 3. Bonnie++ performance test of the EBS volume.</strong> Running with no incoming traffic, it took around 8 minutes to produce quite reasonable report. Having switched on the UDP flood I&#8217;ve repeated the same tests and my expectation was to see some results in similar time. Fifteen minutes later and bonnie still haven&#8217;t even finished third step (rewriting). Another 10 minutes without any significant progress pointed me to do some research what&#8217;s going on. The box wasn&#8217;t performing virtually any IO operations, and time spent waiting for IO topped 100% every second reading (1s delay). Bingo!</p>
<p>To verify if the problem is really caused by incoming UDP flood, I&#8217;ve stopped the traffic for a brief interval (around 7 seconds) and monitored using vmstat:</p>
<pre>procs -----------memory---------- ---swap-- -----io---- -system-- ----cpu----
0  1 893480  11272   3112 1699240    0    0     0     0   10   11  0  0 66 34
0  1 893480  11272   3112 1699240    0    0     0     0    9    6  0  0  0 100
0  1 893480  11272   3112 1699240    0    0     0     0   10    9  0  0 67 33
0  1 893480  11272   3112 1699240    0    0     0     0   11    8  0  0  0 100
0  1 893480   8824   3100 1700052    0    0 23808 24864  962  697  0  1 68 31
0  1 893480  12284   3084 1697988    0    0 16384 16576  711  424  0  2  4 93
0  1 893480   9020   3084 1700088    0    0 20480 20720  817  563  0  1 68 31
0  1 893480  10432   3072 1700192    0    0 20864 20720  907  612  0  4  5 90
0  1 893480  10976   3040 1699724    0    0 15620 12432  588  423  0  1 68 31
0  1 893480  10872   3044 1698556    0    0 12676 16576  600  350  0  2  2 96
0  1 893480  10328   3024 1700676    0    0 19976 16576  761  535  0  1 68 31
0  1 893480  12408   3004 1698096    0    0  8708 12432  457  254  0  1  4 95
0  1 893480  12408   3004 1698096    0    0     0     0    9    7  0  0 67 33
0  1 893480  11636   3004 1699120    0    0  1024     0   38   38  0  0  0 100
0  1 893480  10548   3004 1700420    0    0  1280     0   47   45  0  0 66 33
0  1 893480  10188   3004 1700756    0    0  3584  4144  195  110  0  0  0 100
0  1 893480  10120   2992 1697968    0    0  6404  8288  256  205  0  0 67 33
0  1 893480  12468   2992 1696864    0    0  8064  8288  343  250  0  0  2 98
0  1 893480  11720   2972 1696984    0    0 12420 12432  495  333  0  0 67 32
0  1 893480  10136   2976 1700800    0    0  6916  4144  321  190  0  0  0 100
0  1 893480  11972   2956 1698820    0    0  4096  4144  161  117  0  0 67 33
0  1 893480  11364   2960 1699480    0    0  3844  4144  200  126  0  0  1 99
0  1 893480  11432   2960 1699480    0    0  2944  4144  160   91  0  0 66 34
0  1 893480  11156   2960 1699820    0    0   256     0   18   12  0  0  0 100
0  1 893480  10884   2960 1700020    0    0   256     0   17   17  0  0 66 34
0  1 893480  10856   2960 1700076    0    0     0     0    9    8  0  0  0 100
0  1 893480  10856   2960 1700076    0    0     0     0    9    9  0  0 67 33</pre>
<p>As you can see on line 5 the IO traffic resumed, roughly correlating to the time incoming traffic stopped. Seven seconds later with the UDP traffic back on the box tried to keep up for another quarter of minute before giving it up. Best time to check CloudWatch:</p>
<p><img class="alignnone size-full wp-image-263" title="CloudWatch monitoring" src="http://radimmarek.files.wordpress.com/2009/10/instance-load.jpg?w=500&#038;h=229" alt="CloudWatch monitoring" width="500" height="229" /></p>
<p>Nothing! Based on my notes the first bonnie run occured at 10:40, switched on the UDP flood at 10:50, and started second bonnie run at 10:52. My patience ran out before 11:30 where there&#8217;s small peak caused by interactive iptraf session.</p>
<p>At this point there were no reasons to continue testing. All IO operations to/from EBS volume seemed to be blocked by UDP traffic generated by a single instance!</p>
<h2>Conclusion</h2>
<p>BitBucket guys had every reason to be angry. Blocking UDP in the security group configuration only hides the problem. Contraindicating the Jesper Nøhr statement, during this experiment there were no peaks visible using paid monitoring service &#8211; Amazon CloudWatch (see above). Which was probably the amount of information available to AWS 1st line of support.</p>
<p>This corresponds to the &#8216;black box&#8217; described by Jesper. Looking back on the results it&#8217;s obvious that</p>
<ul>
<li>on-demand network capacity backfired in this case</li>
<li>security group configuration is most likely applied on the host system</li>
<li>host architecture seems to be sharing same network interface(s) for actual network traffic as well as network traffic to/from EBS instances. Even though instances got only a single network interface, I would expect this separation to be implemented on the host system. Segregation of the network traffic is one of the first lesson learned in high-exposed clustered environment.</li>
<li>a week after the attack and there isn&#8217;t any fix in place. Hello, Amazon?!?!</li>
</ul>
<p>To be fair, it&#8217;s been the first incident of such a magnitude. Let&#8217;s hope Amazon AWS team will come up with the architecture fix before somebody use the vulnerability in much wider and devastating attack. In mean time, the only workaround we can apply is to hide our instances as much as we can. Load-balancers and proxies in front of the worker instances should be enough, as long as you don&#8217;t share the same host machine.</p>
<p>Have a good weekend and good luck protecting your instance&#8217;s IPs!</p>
<p>PS: who had the same dark thought as I just had? What about S3?</p>
<p>[UPDATE 2009-10-11 7:00pm] c1.xlarge instances are able to generate UDP flood in the rate of 800 mbps. I guess, Amazon AWS is running 1Gbps network infrastructure.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/radimmarek.wordpress.com/261/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/radimmarek.wordpress.com/261/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/radimmarek.wordpress.com/261/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/radimmarek.wordpress.com/261/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/radimmarek.wordpress.com/261/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/radimmarek.wordpress.com/261/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/radimmarek.wordpress.com/261/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/radimmarek.wordpress.com/261/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/radimmarek.wordpress.com/261/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/radimmarek.wordpress.com/261/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.laststation.net&blog=8338629&post=261&subd=radimmarek&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://blog.laststation.net/2009/10/11/amazon-ec2-still-vulnerable-to-udp-flood-attacks/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/482a7936cd83ef263090c6d4dbc22179?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">Radim Marek</media:title>
		</media:content>

		<media:content url="http://radimmarek.files.wordpress.com/2009/10/instance-load.jpg" medium="image">
			<media:title type="html">CloudWatch monitoring</media:title>
		</media:content>
	</item>
		<item>
		<title>Open Source as a commodification driver</title>
		<link>http://blog.laststation.net/2009/07/10/open-source-as-a-commodification-driver/</link>
		<comments>http://blog.laststation.net/2009/07/10/open-source-as-a-commodification-driver/#comments</comments>
		<pubDate>Fri, 10 Jul 2009 05:43:07 +0000</pubDate>
		<dc:creator>Radim Marek</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[opinion]]></category>
		<category><![CDATA[OSS]]></category>

		<guid isPermaLink="false">http://blog.laststation.net/?p=249</guid>
		<description><![CDATA[If you play with fire, you&#8217;ll get burned. Exactly same happened to me in the post Cloud Perspectives, in which I had wandered off my usual comfort zones and with proper amount of clumsiness stumbled upon the topic I haven&#8217;t been able to describe properly. As it was too late to delete it, I am [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.laststation.net&blog=8338629&post=249&subd=radimmarek&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">If you play with fire, you&#8217;ll get burned. Exactly same happened to me in the post Cloud Perspectives, in which I had wandered off my usual comfort zones and with proper amount of clumsiness stumbled upon the topic I haven&#8217;t been able to describe properly. As it was too late to delete it, I am bound to explain myself properly.</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">We we all agree the technology is driven by the innovation and the value added to its users. At the beginning of every progression there&#8217;s an innovation that demonstrates potential economic value assigned to something previously not recognized or possible. In most areas the innovation (IP) and it&#8217;s strategic value plays important part in the establishing or changing market place. Once the strategic value drops significantly, either by increased competition or by mass adoption, commodization is taking progress. From technology perspective it usually happens by:</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;"><span style="white-space:pre;"> </span>- standardization</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;"><span style="white-space:pre;"> </span>- adoption growth not manageable by a single or limited number of entities</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;"><span style="white-space:pre;"> </span>- transfer of IP to 3rd parties</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;"><span style="white-space:pre;"> </span>- containment of innovation itself in the mainstream know-how</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">In the process of commodification the competitive rivalry of the market will sooner or later face the loss of added value and therefore diminishing strategic value of particular innovation and diversity of competitors &#8211; finishing the process of commodification by the containment of original idea in the general know-how. Which will created environment best described as a pure competition (see Porter&#8217;s Five Force Analysis [http://en.wikipedia.org/wiki/Porter_5_forces_analysis]).</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">Now let&#8217;s take the Open Source into the equation. The movement itself is already recognized by doing all of this &#8211; removing technological barriers for adoption, providing a platform for innovation, reducing the cost of ownership compared to the proprietary technologies and establishing new environment for de-facto standardization of selected projects. Which, on its own, should give us perfect strategic way of achieving technology commodization.</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">The question remains though. Right now Open Source has been reduced to handful of products in order to simplify it and come up with the new business model. But reality is much more complex. Open source has been one of the major enablers of what we&#8217;re calling cloud computing, changing technological landscape as we knew it. As noted by Roman in his original post, the cloud environment comes with different layer of interaction. The technological challenges we&#8217;ve faced before are already recognized and therefore commodified. Now it&#8217;s a question what new projects (or frameworks) swe&#8217;ll have to solve the new challenges? Or better &#8211; as service nature of cloud computing changed the impact of open source is there a way how to project an open source ideas into them as well?</div>
<p>If you play with fire, you&#8217;ll get burned. Exactly same happened to me in the post <a href="http://blog.laststation.net/2009/07/09/cloud-perspectives/">Cloud Perspectives</a>, in which I had wandered off my usual comfort zones and with proper amount of clumsiness stumbled upon the topic I haven&#8217;t been able to describe properly. As it was too late to delete it, so I am bound to explain myself properly.</p>
<p>We we all agree the technology is driven by the innovation and the value added to its users. At the beginning of every progression there&#8217;s an innovation that demonstrates potential economic value assigned to something previously not recognized or possible. In most areas the innovation (IP) and it&#8217;s strategic value plays important part in the establishing or changing market place. Once the strategic value drops significantly, either by increased competition or by mass adoption, commodization is taking progress. From technology perspective it usually happens by:</p>
<ul>
<li>standardization</li>
<li>adoption growth not manageable by a single or limited number of entities</li>
<li>transfer of IP to 3rd parties</li>
<li>containment of innovation itself in the mainstream know-how</li>
</ul>
<p>In the process of commodification the competitive rivalry of the market will sooner or later face the loss of added value and therefore diminishing strategic value of particular innovation and diversity of competitors &#8211; finishing the process of commodification by the containment of original idea in the general know-how. Which will created environment best described as a pure competition (see <a href="http://en.wikipedia.org/wiki/Porter_5_forces_analysis">Porter&#8217;s Five Force Analysis</a>).</p>
<p>Now let&#8217;s take the Open Source into the equation. The movement itself is already recognized by doing all of this &#8211; removing technological barriers for adoption, providing a platform for innovation, reducing the cost of ownership compared to the proprietary technologies and establishing new environment for de-facto standardization of selected projects. Which, on its own, should give us perfect strategic way of achieving technology commodization.</p>
<p>The question remains though. Right now Open Source has been reduced to handful of products in order to simplify it and come up with the new business model. But reality is much more complex. Open source has been one of the major enablers of what we&#8217;re calling cloud computing, changing technological landscape as we knew it. As noted by Roman in<a href="http://roman.stanek.org/2009/07/09/open-source-in-the-cloud/"> his original post</a>, the cloud environment comes with a different layer of interaction. The technological challenges we&#8217;ve faced before are already recognized and therefore commodified. Now it&#8217;s a question what new projects (or frameworks) we&#8217;ll have to solve the new challenges? Or better &#8211; as service nature of cloud computing changed the impact of open source, is there any way how to project an open source ideas into the service provisioning as well?</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/radimmarek.wordpress.com/249/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/radimmarek.wordpress.com/249/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/radimmarek.wordpress.com/249/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/radimmarek.wordpress.com/249/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/radimmarek.wordpress.com/249/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/radimmarek.wordpress.com/249/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/radimmarek.wordpress.com/249/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/radimmarek.wordpress.com/249/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/radimmarek.wordpress.com/249/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/radimmarek.wordpress.com/249/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.laststation.net&blog=8338629&post=249&subd=radimmarek&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://blog.laststation.net/2009/07/10/open-source-as-a-commodification-driver/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/482a7936cd83ef263090c6d4dbc22179?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">Radim Marek</media:title>
		</media:content>
	</item>
		<item>
		<title>Cloud Perspectives</title>
		<link>http://blog.laststation.net/2009/07/09/cloud-perspectives/</link>
		<comments>http://blog.laststation.net/2009/07/09/cloud-perspectives/#comments</comments>
		<pubDate>Thu, 09 Jul 2009 13:32:47 +0000</pubDate>
		<dc:creator>Radim Marek</dc:creator>
				<category><![CDATA[cloud]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[opinion]]></category>

		<guid isPermaLink="false">http://blog.laststation.net/?p=226</guid>
		<description><![CDATA[In his latest blog post, Roman Stanek contemplated about the disruptive effect of cloud computing. We already experienced its power in relation to the boom of social networking and as he notes it is undoubtedly going to disrupt the business model behind commercial software. Now, Roman asks how it will affect the open source movement?
For me the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.laststation.net&blog=8338629&post=226&subd=radimmarek&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>In his latest blog post, <a href="http://roman.stanek.org/">Roman Stanek</a> contemplated about the disruptive effect of cloud computing. We already experienced its power in relation to the boom of social networking and as he notes it is undoubtedly going to disrupt the business model behind commercial software. Now, Roman asks <a href="http://roman.stanek.org/2009/07/09/open-source-in-the-cloud/">how it will affect the open source movement?</a></p>
<p>For me the answer to this question lies in the position of the cloud computing itself. As a technology it&#8217;s nothing more than an evolutionary step. To understand my view let&#8217;s make a step back and have a look into the history and see what preceded our latest source of buzz.</p>
<p>First here was a network connectivity. Back in 1995 I tried to build my very first ISP. Daring I hear you saying? It certainly was. Some tried to fight it, some opposed it, most of us were amazed by the possibilities (however limited at the time) and the others were just oblivious. Connectivity was scarce, expensive and limited. As adoption progressed all these problems started to disappear. By the end of the 90s connectivity wasn&#8217;t any longer a privilege but a commodity. Bought, resold, aggregated, and extended. Would you even considering building own ISP today? I doubt so [1].</p>
<p>Next on the line was hosting. Everybody who missed the ISP game, and even ISPs themselves, entered a big chase for the ultimate hosting package. Story is the same as with connectivity. Originally it was scarce, expensive and limited. And its fate is similar as well. Hosting as a service has been commodified. You know the story.</p>
<p>As our needs increased, the next step was to focus on data centres. Transit connectivity and mass demand for hosting services increased pressure to provide huge data centres. Server provisioning become important. Numbers changed, from dozens to hundreds, from hundreds to thousands. You can probably guess what I&#8217;m going to say: it was scarce, expensive and limited. Physical kit just wasn&#8217;t enough. Virtualization matured and brought as where we are know. Into the cloud age.</p>
<p>Open source played major role in these transformations. As the need for commodification increased pressure to lower the price, existing software business models couldn&#8217;t cope with the increasing competition from the free software. Model started to changing into <strong>*aaS</strong>. Not much longer after that the open source technologies stopped being perceived as a disruption but rather as a competitive advantage.</p>
<p>Now it&#8217;s a good time to go back to Roman&#8217;s post. Where I agree with him is the fact the utility computing provides excellent environment for OSS to flourish. And increasingly complex world needs to be build on stable and open APIs, protocols and standards. Where my view differs is possible solution to the &#8216;problem&#8217; open source is facing.</p>
<p>First I don&#8217;t really see a problem in the bazaar style development in the cloud perspective. Cloud computing, as it stands right now, is still in its infancy. And although we started calling our servers <em>instances</em>, talking about <em>OS-level abstraction/virtualization</em> and focusing on the <em>streamlining provisioning</em>, we are pretty much repeating what we&#8217;ve done before. Just changed the business model and created new horizons. Despite my reluctance, from perspective of innovation the future of the cloud computing is better characterized by platforms (like <a href="http://code.google.com/appengine/">Google App Engine</a>) &#8211; not IaaS as we perceive it today. For me underlying technology does not longer matter. I&#8217;m happy to leave so-called Cloud OS to existing providers. Because if I use the analogy of the internet connectivity and hosting, they are going to be cannibalized by their own approach. Bought, resoled and aggregated.</p>
<p>Second, I would like to use Roman&#8217;s terminology and change the outcome from two colliding solutions into their natural progression.</p>
<ul>
<li>For me <strong>Benevolent dictators</strong> are just a logical mark of the evolution itself. Leading providers will keep their stack closed for a certain (very limited) time, no matter if it&#8217;s build on open or closed source technologies. But with the growing demand to facilitate the interoperability and facing increasing competition at the same time it&#8217;s predictable they will open-source their complete stacks in order to utilize their momentum. In order to stay on top of the race, existing players will be ultimately forced to initiate commodification of the cloud services itself and expand their offering. For this to happen there are still some prerequisites we&#8217;re missing &#8211; at least standardisation of APIs/models behind IaaS and unified measurement of the cloud mass/computing power/matter. The signs of this development are already visible.</li>
</ul>
<ul>
<li><strong>The new model </strong>will eventually follow. The rational behind it is very simple. Industry wouldn&#8217;t be any longer able to build solutions on top of the increasingly complex architectures and face lack of the skilled professionals like you and me. As Roman pointed out, change itself will bring rise of conflicting opinions. In past, we managed to get over the virtual memory allocation, running our code within the virtual machines and cloud computing itself (as it&#8217;s just happening). But all these concepts addressed only existing problems. Now we&#8217;re facing new challenges. Building stones are already here &#8211; take *aaS, SOA, REST, hypermedia, microformats, orchestration and who knows what else, put it together and whoever will get the simple result will deliver it as a winner. Open source will definitely play important role not just as a facilitator for competitive advantage, but also as a instrument for companies to off-load their products when they become commoditized.</li>
</ul>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:1305px;width:1px;height:1px;">To summarize my rather long post, I believe the question is not how cloud computing will affect the movement. In my mind there only one alternative: is the open source going to have same affect to production of resources and services as a mass production had on commodification of physical goods? Cloud computing is certainly showing us a way. But to find the answer we must adopt other aspects of our society.</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:1305px;width:1px;height:1px;"><span style="white-space:pre;"> </span></div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:1305px;width:1px;height:1px;"><span style="white-space:pre;"> </span>Sorry, but have to leave this one open&#8230; There are much better qualified people to talk about it.</div>
<p>To summarize my rather long post, I believe the question is not how cloud computing will affect the movement itself. In my mind, open source complements cloud computing, exactly as mass production allowed commodification of physical goods. The question is whatever the cloud is going to provide future platform for open source concept adoption even outside the IT industry? Social networking is certainly showing us the way. But to find the answer is outside the scope of this post&#8230;</p>
<p>[1] This analogy perfectly reflects my view on the private clouds.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/radimmarek.wordpress.com/226/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/radimmarek.wordpress.com/226/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/radimmarek.wordpress.com/226/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/radimmarek.wordpress.com/226/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/radimmarek.wordpress.com/226/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/radimmarek.wordpress.com/226/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/radimmarek.wordpress.com/226/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/radimmarek.wordpress.com/226/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/radimmarek.wordpress.com/226/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/radimmarek.wordpress.com/226/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.laststation.net&blog=8338629&post=226&subd=radimmarek&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://blog.laststation.net/2009/07/09/cloud-perspectives/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/482a7936cd83ef263090c6d4dbc22179?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">Radim Marek</media:title>
		</media:content>
	</item>
		<item>
		<title>How volatile Compute Clouds are supposed to be?</title>
		<link>http://blog.laststation.net/2009/06/15/how-volatile-compute-clouds-are-supposed-to-be/</link>
		<comments>http://blog.laststation.net/2009/06/15/how-volatile-compute-clouds-are-supposed-to-be/#comments</comments>
		<pubDate>Mon, 15 Jun 2009 21:09:03 +0000</pubDate>
		<dc:creator>Radim Marek</dc:creator>
				<category><![CDATA[cloud]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[amazon]]></category>
		<category><![CDATA[aws]]></category>
		<category><![CDATA[ec2]]></category>
		<category><![CDATA[iaas]]></category>
		<category><![CDATA[vps]]></category>

		<guid isPermaLink="false">http://laststation.net/?p=202</guid>
		<description><![CDATA[Yesterday afternoon, while relaxing in the garden I&#8217;ve suddenly realized why &#8211; in my mind &#8211; there was always a bit of hesitation to brand some of the emerging offerings as a true Cloud Computing. Amazon EC2 has always ticked the box. Why not the other providers? I knew the answer is going to be [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.laststation.net&blog=8338629&post=202&subd=radimmarek&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>Yesterday afternoon, while relaxing in the garden I&#8217;ve suddenly realized why &#8211; in my mind &#8211; there was always a bit of hesitation to brand some of the emerging offerings as a true Cloud Computing. <a href="http://aws.amazon.com/ec2/">Amazon EC2</a> has always ticked the box. Why not the other providers? I knew the answer is going to be simple, but it took me quite a long time to figure it out.</p>
<p>Watching the sky where the strong winds were playing with the <a href="http://en.wikipedia.org/wiki/Cloud">masses of condensed water vapor</a> I&#8217;ve suddenly realized it&#8217;s not just a name these two phenomenas share together. It&#8217;s also volatility. Faithfully to their atmospheric cousins, compute clouds are definitely not representing static set of resources controlled by its users. Due to its nature where &#8216;perishable and intangible&#8217; computing power is shared among multiple tenants to improve utilization rates, and therefore significantly reduce the cost, compute clouds are not just elastic but also indistinct, measured only by the mass of the resources currently allocated. </p>
<p>Having said that, I am obviously not suggesting Amazon EC2 resources are  less resilient. Quite opposite. It&#8217;s simple a matter of the architecture where systems are <b>designed for failure</b> which at the end of the day will result in less failures affecting day-to-day business operations. Our personal experience might prove it, but nevertheless it&#8217;s always win-win situation if such a pattern is contained within the service itself. In this perspective I can see clear difference between Amazon EC2 and the other offerings. So until we&#8217;ll get more of the cloud nature, and less of re-branded VPS provisioning system, it&#8217;s going to be tough call.</p>
<p>Let&#8217;s try not to scale-in the IaaS resources or make them ever-so-resilient, approach more applicable within traditional infrastructure provisioning, but rather design our systems around this characteristic. And if you can&#8217;t get on with the indistinctive nature, try to have a look into a growing range of Platform as a service solutions. It&#8217;s a thin dividing line, I know, but the important one.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/radimmarek.wordpress.com/202/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/radimmarek.wordpress.com/202/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/radimmarek.wordpress.com/202/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/radimmarek.wordpress.com/202/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/radimmarek.wordpress.com/202/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/radimmarek.wordpress.com/202/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/radimmarek.wordpress.com/202/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/radimmarek.wordpress.com/202/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/radimmarek.wordpress.com/202/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/radimmarek.wordpress.com/202/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.laststation.net&blog=8338629&post=202&subd=radimmarek&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://blog.laststation.net/2009/06/15/how-volatile-compute-clouds-are-supposed-to-be/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/482a7936cd83ef263090c6d4dbc22179?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">Radim Marek</media:title>
		</media:content>
	</item>
		<item>
		<title>Cloud computing security (it&#8217;s not something new)</title>
		<link>http://blog.laststation.net/2009/05/29/cloud-computing-security-its-not-something-new/</link>
		<comments>http://blog.laststation.net/2009/05/29/cloud-computing-security-its-not-something-new/#comments</comments>
		<pubDate>Fri, 29 May 2009 22:42:22 +0000</pubDate>
		<dc:creator>Radim Marek</dc:creator>
				<category><![CDATA[cloud]]></category>

		<guid isPermaLink="false">http://laststation.net/?p=197</guid>
		<description><![CDATA[Following the rocket like boom of the cloud computing by the end of 2007, countless questions have been asked about security aspect of such a solutions. For many businesses this concern may overshadow other benefits &#8211; like agility, cost effectivity or scalability. This post is my reflection on true considerations one should take into account [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.laststation.net&blog=8338629&post=197&subd=radimmarek&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>Following the rocket like boom of the cloud computing by the end of 2007, countless questions have been asked about security aspect of such a solutions. For many businesses this concern may overshadow other benefits &#8211; like agility, cost effectivity or scalability. This post is my reflection on true considerations one should take into account when moving into the cloud; all in perspective of the small to medium size businesses.</p>
<p>Many articles and studies casted a dark shadows on the general idea of on-demand provisioning of infrastructure. And they are right in one perspective: if you are not able to provide adequate security measures to your local hosted data or solution, you won&#8217;t be any better in the cloud (well, almost). Added remote access will only exponentially increase number of the potential intruders. But where this shadows do not reveal complete truth is the fact the lack of security is very often given by inability or negligence in businesses itself to establish adequate security. Which is not only the problem of small business, as we learned last year (2008) by <a href="http://www.guardian.co.uk/uk/2008/nov/02/privacy">series of blunders</a> going all the way up to the British government.</p>
<p>Going back to the security of the cloud offering, where increased number of the security threats is anticipated, providers are (hopefully) taking preventive measures in place which we, regular users, wouldn&#8217;t be able to afford locally, especially in situations where the expectation is to bear the upfront cost of such a protection &#8211; no matter if it&#8217;s a physical equipment or operations staff (it&#8217;s up to you to pick the one more expensive for your business). As there&#8217;s no vendor able to address all the possible aspects and requirements, many of them choose openness to allow partners to provider added services. Perfect example of such a cooperation is the community surrounding <a href="http://aws.amazon.com/">Amazon AWS</a>. Service aggregators will and have already started filling in the missing picture.</p>
<p>Other reactions are continually disputing physical security of the cloud computing and how such an anonymous solution can replace traditional collocation, dedicated or managed hosting services.	It may sound bold, but I feel confident to say not only it can replace them but it certainly will, unless their are proactive in their offering. Based on personal experiences with even the most reputable companies on the market today we have to accept the accidents do happen, always due to the good old human factor. Especially when operation support is focused on an individual and very often not related resources, rather than anonymous blobs managed as a whole. Luckily traditional hosting market is not sleeping and we can already see different cloud based services coming from companies like Rackspace (<a href="http://www.mosso.com/">Mosso</a>) on one side and UK2 (<a href="http://vps.net/">vps.net</a>) on another. To polarize the opinions a bit more I can&#8217;t wait who will knock in a final nail in the coffin of the companies refusing to change by introducing hosting platform provisioning on top of the existing clouds.</p>
<p>Due to the varied nature of the different cloud computing services it would be outside the scope of this post to list all the different security concerns, recovery scenarios and long-term viability options. This make selection of the provider important task, but the point is the process itself hasn&#8217;t changed so much compared to what we already know. Cloud computing is changing IT as never before, but it&#8217;s not technical rules that are changing (they&#8217;re evolving), but the business model is where the revision is being done; the rest is just a reflection of it.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/radimmarek.wordpress.com/197/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/radimmarek.wordpress.com/197/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/radimmarek.wordpress.com/197/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/radimmarek.wordpress.com/197/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/radimmarek.wordpress.com/197/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/radimmarek.wordpress.com/197/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/radimmarek.wordpress.com/197/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/radimmarek.wordpress.com/197/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/radimmarek.wordpress.com/197/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/radimmarek.wordpress.com/197/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.laststation.net&blog=8338629&post=197&subd=radimmarek&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://blog.laststation.net/2009/05/29/cloud-computing-security-its-not-something-new/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/482a7936cd83ef263090c6d4dbc22179?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">Radim Marek</media:title>
		</media:content>
	</item>
		<item>
		<title>RESTEasy integration with JBoss Microcontainer</title>
		<link>http://blog.laststation.net/2009/02/06/resteasy-integration-with-jboss-microcontainer/</link>
		<comments>http://blog.laststation.net/2009/02/06/resteasy-integration-with-jboss-microcontainer/#comments</comments>
		<pubDate>Fri, 06 Feb 2009 14:42:31 +0000</pubDate>
		<dc:creator>Radim Marek</dc:creator>
				<category><![CDATA[jboss]]></category>
		<category><![CDATA[microcontainer]]></category>
		<category><![CDATA[integration]]></category>
		<category><![CDATA[jbossmc]]></category>
		<category><![CDATA[resteasy]]></category>

		<guid isPermaLink="false">http://laststation.net/?p=184</guid>
		<description><![CDATA[With the JBoss JAX-RS implementation RESTEasy reaching version 1.0.1.GA I have finally managed to switch over from Jersey. Because my latest project has got all internal services and framework components represented as a JBossMC beans  I needed a simple way how to export them directly as Restful resources without requiring any unnecessary boiler plate [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.laststation.net&blog=8338629&post=184&subd=radimmarek&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>With the JBoss <a href="http://jcp.org/en/jsr/detail?id=311">JAX-RS</a> implementation <a href="http://jboss.org/resteasy/">RESTEasy</a> <a href="http://bill.burkecentral.com/2009/01/30/resteasy-101ga-released-minor-bug-fixes/">reaching version 1.0.1.GA</a> I have finally managed to switch over from Jersey. Because my latest project has got all internal services and framework components represented as a <a href="http://www.jboss.org/jbossmc/">JBossMC</a> beans  I needed a simple way how to export them directly as Restful resources without requiring any unnecessary boiler plate code.</p>
<p>I got inspired by <a href="http://resteasy.svn.sourceforge.net/viewvc/resteasy/trunk/jaxrs/resteasy-spring/">Spring integration</a> (which comes as part of the RESTEasy distribution) and wrote own <a href="http://bitbucket.org/obrien99/resteasy-int-jbossmc/">resteasy-int-jbossmc</a> which can be used under JBoss AS 5.0. Main difference is the application context scope &#8211; with Spring it has to be deployed as part of the same web application, whereas when deployed under JBossAS beans are instantiated within the microcontainer of the whole application server. To prevent scanning of unnecessary code I had to use feature called <a href="http://laststation.net/2009/01/31/jbossmc-scoped-kernel/">scoped kernel/controller</a> and force restful resources to be scoped into own context, where they can be easily located.</p>
<p>Configuration (done in web.xml) then looks like this:</p>
<pre class="brush: xml;">
&lt;web-app&gt;
    &lt;display-name&gt;Archetype Created Web Application&lt;/display-name&gt;

    &lt;!-- configuration --&gt;
    &lt;context-param&gt;
        &lt;param-name&gt;jbossmc-int.name&lt;/param-name&gt;
        &lt;param-value&gt;APPLICATION&lt;/param-value&gt;
    &lt;/context-param&gt;

    &lt;context-param&gt;
        &lt;param-name&gt;jbossmc-int.qualifier&lt;/param-name&gt;
        &lt;param-value&gt;demo-app&lt;/param-value&gt;
    &lt;/context-param&gt;

    &lt;!-- RESTEasy bootstrap --&gt;

    &lt;listener&gt;
        &lt;listener-class&gt;org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap&lt;/listener-class&gt;
    &lt;/listener&gt;

    &lt;!--
       !! Integration has to be configured after Reasteasy Bootstrap !!
    --&gt;
    &lt;listener&gt;
        &lt;listener-class&gt;net.laststation.tools.resteasy.plugins.MicrocontainerContextListener&lt;/listener-class&gt;
    &lt;/listener&gt;

    &lt;servlet&gt;
        &lt;servlet-name&gt;Resteasy&lt;/servlet-name&gt;
        &lt;servlet-class&gt;org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher&lt;/servlet-class&gt;
    &lt;/servlet&gt;

    &lt;!-- seems like mapping for now doesn't anything else than /* --&gt;
    &lt;servlet-mapping&gt;
        &lt;servlet-name&gt;Resteasy&lt;/servlet-name&gt;
        &lt;url-pattern&gt;/*&lt;/url-pattern&gt;
    &lt;/servlet-mapping&gt;
&lt;/web-app&gt;
</pre>
<p>The integration is configured by <b>jbossmc-int.name</b>, specifying scoped context you want to use (APPLICATION is recommended), and the <b>jbossmc-int.qualifier</b> with he scope name itself (demo-app in this case). Also, please, note that <i>ResteasyBootstrap</i> must be configured first as it exports object required by <i>MicrocontainerContextListener</i>.</p>
<p>To export objects is then as easy as deploying them to microcontainer. Can be done using BeanMetadataBuilder, annotation or XML deployment descriptor as demostrated here:</p>
<pre class="brush: xml;">
&lt;deployment xmlns=&quot;urn:jboss:bean-deployer:2.0&quot;&gt;
    &lt;bean name=&quot;library&quot; class=&quot;net.laststation.demo.model.Library&quot;&gt;
        &lt;annotation&gt;@org.jboss.metadata.plugins.scope.ApplicationScope(&quot;demo-app&quot;)&lt;/annotation&gt;
    &lt;/bean&gt;
&lt;/deployment&gt;
</pre>
<p>The bean is exposed to <i>MicrocontainerContextListener</i> by annotation @ApplicationScope, which in this case specifies name &#8216;demo-app&#8217;.</p>
<h4>Known Limitations</h4>
<p>JBoss Microcontainer kernel scoping support at the prototype stages. Also similar to the Spring integration, Resteasy Servlet Dispatched must be mapped to the /*, otherwise it won&#8217;t work.</p>
<h4>Download</h4>
<p>Source code is available within my public <a href="http://bitbucket.org/">BitBucket</a> respository.</p>
<ul>
<li><a href="http://bitbucket.org/obrien99/resteasy-int-jbossmc/">resteasy-int-jbossmc</a></li>
</ul>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/radimmarek.wordpress.com/184/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/radimmarek.wordpress.com/184/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/radimmarek.wordpress.com/184/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/radimmarek.wordpress.com/184/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/radimmarek.wordpress.com/184/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/radimmarek.wordpress.com/184/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/radimmarek.wordpress.com/184/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/radimmarek.wordpress.com/184/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/radimmarek.wordpress.com/184/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/radimmarek.wordpress.com/184/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.laststation.net&blog=8338629&post=184&subd=radimmarek&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://blog.laststation.net/2009/02/06/resteasy-integration-with-jboss-microcontainer/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/482a7936cd83ef263090c6d4dbc22179?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">Radim Marek</media:title>
		</media:content>
	</item>
		<item>
		<title>JBossMC &#8211; Scoped Kernel</title>
		<link>http://blog.laststation.net/2009/01/31/jbossmc-scoped-kernel/</link>
		<comments>http://blog.laststation.net/2009/01/31/jbossmc-scoped-kernel/#comments</comments>
		<pubDate>Sat, 31 Jan 2009 22:59:36 +0000</pubDate>
		<dc:creator>Radim Marek</dc:creator>
				<category><![CDATA[microcontainer]]></category>
		<category><![CDATA[jbossmc]]></category>
		<category><![CDATA[kernel]]></category>
		<category><![CDATA[pojo]]></category>

		<guid isPermaLink="false">http://laststation.net/?p=178</guid>
		<description><![CDATA[Building the services using JBoss Microcontainer isn&#8217;t complicated at all;  create necessary classes and wire them together using XML descriptor or couple of annotations. But unless you&#8217;re building just a very simple components, you might want to be able to hide the implementation and expose only the special interface (public) beans to the outside [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.laststation.net&blog=8338629&post=178&subd=radimmarek&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>Building the services using <a href="http://www.jboss.org/jbossmc/">JBoss Microcontainer</a> isn&#8217;t complicated at all;  create necessary classes and wire them together using XML descriptor or couple of annotations. But unless you&#8217;re building just a very simple components, you might want to be able to hide the implementation and expose only the special interface (public) beans to the outside world. JBossMC has handy feature to support this using scoped kernel / controller.</p>
<p>Let&#8217;s start with the example:</p>
<pre class="brush: xml;">
&lt;deployment xmlns=&quot;urn:jboss:bean-deployer:2.0&quot;&gt;
	&lt;bean name=&quot;sample1&quot; class=&quot;net.laststation.demo.mc.SampleBean&quot;&gt;
    	&lt;annotation&gt;@org.jboss.metadata.plugins.scope.ApplicationScope(&quot;testApp&quot;)&lt;/annotation&gt;
	&lt;/bean&gt;

     &lt;bean name=&quot;myService&quot; class=&quot;net.laststation.demo.mc.MyServiceDemo&quot;&gt;
        &lt;property name=&quot;holder&quot;&gt;&lt;search bean=&quot;sample1&quot; type=&quot;leaves&quot;/&gt;&lt;/property&gt;
     &lt;/bean&gt;
&lt;/deployment&gt;
</pre>
<p>In this deployment we&#8217;ve got a sample bean annotated by @ApplicationScope which will force <b>sample1</b> to be instantiated within the application scope <i>testApp</i>. Publicly exposed service, represented by <b>myService</b>, requires this object, but instead of the regular injection it must apply the search method &#8211; using the XML element (as shown above) or annotation @Search, in both cases specifying the bean identification and required strategy.</p>
<p>Search strategies are implemented within the package <a href="http://anonsvn.jboss.org/repos/jbossas/projects/microcontainer/trunk/dependency/src/main/java/org/jboss/dependency/plugins/graph/"><code>org.jboss.dependency.plugins.graph</code></a> and in general consists form the two kind of implementations, based on only the local scope or hierarchy. Current list includes:</p>
<ul>
<li>DEFAULT</li>
<li>LOCAL</li>
<li>TOP</li>
<li>PARENT_ONLY</li>
<li>PARENT</li>
<li>DEPTH</li>
<li>LEAVES</li>
<li>WIDTH</li>
<li>CHILD_ONLY_DEPTH</li>
<li>CHILD_ONLY_LEAVES</li>
<li>CHILD_ONLY_WIDTH</li>
</ul>
<p>If you want to break the example, just change the search type to one that doesn&#8217;t take children scopes into account &#8211; for example TOP.</p>
<h4>Below the line</h4>
<p>Please note, the scoped kernel implementation is currently at the prototype stages. I wouldn&#8217;t expect significant changes in the functionality but configuration might be &#8216;adjusted&#8217;.</p>
<p>Personally, I would love to see support for the scope definition other than using annotations. Such an improvement would be much more coherent in the perspective of the meta data builder and XML configuration, where for example might be a place for the XML element &lt;scope&gt;. </p>
<p>Second comment goes to the requirement to use the search method instead of injection, for which the specification of the search strategy might be equally adequate.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/radimmarek.wordpress.com/178/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/radimmarek.wordpress.com/178/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/radimmarek.wordpress.com/178/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/radimmarek.wordpress.com/178/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/radimmarek.wordpress.com/178/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/radimmarek.wordpress.com/178/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/radimmarek.wordpress.com/178/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/radimmarek.wordpress.com/178/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/radimmarek.wordpress.com/178/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/radimmarek.wordpress.com/178/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.laststation.net&blog=8338629&post=178&subd=radimmarek&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://blog.laststation.net/2009/01/31/jbossmc-scoped-kernel/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/482a7936cd83ef263090c6d4dbc22179?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">Radim Marek</media:title>
		</media:content>
	</item>
		<item>
		<title>JBoss AS 5.0 and Beyond</title>
		<link>http://blog.laststation.net/2009/01/25/jboss-as-50-and-beyond/</link>
		<comments>http://blog.laststation.net/2009/01/25/jboss-as-50-and-beyond/#comments</comments>
		<pubDate>Sun, 25 Jan 2009 16:01:35 +0000</pubDate>
		<dc:creator>Radim Marek</dc:creator>
				<category><![CDATA[jboss]]></category>
		<category><![CDATA[enterprise]]></category>
		<category><![CDATA[opinion]]></category>

		<guid isPermaLink="false">http://laststation.net/?p=141</guid>
		<description><![CDATA[UPDATE 28-05-2009 &#8211; Release of JBoss AS 5.1 has made this blog post obsolete and because I don&#8217;t longer feel any urgency nor think that is appropriate to comment on RedHat release or quality control process I&#8217;ve decided to retract the text.
       <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.laststation.net&blog=8338629&post=141&subd=radimmarek&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p><strong>UPDATE 28-05-2009</strong> &#8211; <em>Release of JBoss AS 5.1 has made this blog post obsolete and because I don&#8217;t longer feel any urgency nor think that is appropriate to comment on RedHat release or quality control process I&#8217;ve decided to retract the text.</em></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/radimmarek.wordpress.com/141/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/radimmarek.wordpress.com/141/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/radimmarek.wordpress.com/141/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/radimmarek.wordpress.com/141/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/radimmarek.wordpress.com/141/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/radimmarek.wordpress.com/141/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/radimmarek.wordpress.com/141/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/radimmarek.wordpress.com/141/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/radimmarek.wordpress.com/141/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/radimmarek.wordpress.com/141/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.laststation.net&blog=8338629&post=141&subd=radimmarek&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://blog.laststation.net/2009/01/25/jboss-as-50-and-beyond/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/482a7936cd83ef263090c6d4dbc22179?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">Radim Marek</media:title>
		</media:content>
	</item>
		<item>
		<title>Mercurial hosting and bitbucket.org</title>
		<link>http://blog.laststation.net/2008/12/05/mercurial-hosting-and-bitbucketorg/</link>
		<comments>http://blog.laststation.net/2008/12/05/mercurial-hosting-and-bitbucketorg/#comments</comments>
		<pubDate>Thu, 04 Dec 2008 23:35:31 +0000</pubDate>
		<dc:creator>Radim Marek</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[hosting]]></category>
		<category><![CDATA[mercurial]]></category>

		<guid isPermaLink="false">http://laststation.net/?p=108</guid>
		<description><![CDATA[Having spent some time this week resolving problems with Subversion repository due to poor network performance I&#8217;d like to intensify my efforts towards Mercurial (Hg). In this blog post not just the application itself, but rather introduce hosting capabilities and one of the projects from it&#8217;s biosphere.
No matter how decentralized version system might be, hosting [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.laststation.net&blog=8338629&post=108&subd=radimmarek&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>Having spent some time this week resolving problems with Subversion repository due to poor network performance I&#8217;d like to intensify my efforts towards <a href="http://www.selenic.com/mercurial/wiki/">Mercurial</a> (<i>Hg</i>). In this blog post not just the application itself, but rather introduce hosting capabilities and one of the projects from it&#8217;s biosphere.</p>
<p>No matter how decentralized version system might be, hosting is very important part of the infrastructure. Easiest way how to share <i>Hg</i> repository is to publish it using HTTP protocol. This can be easily achieved through CGI script called <b>hgweb</b> and in detail described in the document <a href="http://www.selenic.com/mercurial/wiki/index.cgi/PublishingRepositories">Publishing Repositories</a>. To give you some idea how the interface look like, the list of some well known public sites follows.</p>
<ul>
<li> <a href="http://hg.mozilla.org/">Mozilla</a></li>
<li> <a href="http://hg.netbeans.org/">Netbeans</a></li>
<li> <a href="http://xenbits.xensource.com/">Xen</a></li>
</ul>
<p>Success of a project is very often given by the quality of available solutions. Perfect example in Mercurial world is <a href="http://www.bitbucket.org/">Bitbucket.org</a>, the code hosting site with social aspects, which allows you to host up to 150 MB for free, with unlimited number of the public and maximum of one private repositories. These limits can be increased by choosing one of the available <a href="http://www.bitbucket.org/plans/">commercial plans</a>, starting with 5 USD a month for 500 MB quota. The public repository concept is key to understand social aspects of this site, which gives you possibility to track changes in different projects and actively participate. I wouldn&#8217;t mention this project if it would be just for code hosting. Integral part of <b>bitbucket</b> is full featured <a href="http://www.bitbucket.org/jespern/puck/wiki/Home">wiki</a> and <b>bug tracking</b> system, very similar to my personal favourite application &#8211; <a href="http://trac.edgewall.org/">Trac</a>. Everything packaged in snappy web interface, easy to use and exposing even advanced Mercurial functionality &#8211; like <a href="http://hgbook.red-bean.com/hgbookch12.html">change queues</a>.</p>
<p>I definitely recommended to try bitbucket.org, even if you just want to get more comfortable with Mercurial. As a new service there&#8217;s still a lot of functionality to be added, but that doesn&#8217;t detract from its qualities.</p>
<p>My only wish in regards to the Bitbucket might be provisioning of some background information about the company behind, future plans, and (fingers crossed) possibility to make it open source! That would ultimately establish this project as one of the fundamental companion products for every developer.</p>
<p>
Links:</p>
<ul>
<li><a href="http://www.bitbucket.org/">Bitbucket.org</a></li>
</ul>
<p></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/radimmarek.wordpress.com/108/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/radimmarek.wordpress.com/108/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/radimmarek.wordpress.com/108/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/radimmarek.wordpress.com/108/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/radimmarek.wordpress.com/108/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/radimmarek.wordpress.com/108/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/radimmarek.wordpress.com/108/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/radimmarek.wordpress.com/108/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/radimmarek.wordpress.com/108/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/radimmarek.wordpress.com/108/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.laststation.net&blog=8338629&post=108&subd=radimmarek&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://blog.laststation.net/2008/12/05/mercurial-hosting-and-bitbucketorg/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/482a7936cd83ef263090c6d4dbc22179?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">Radim Marek</media:title>
		</media:content>
	</item>
		<item>
		<title>Generic JSF Converter for Seam</title>
		<link>http://blog.laststation.net/2008/11/16/seam-generic-jsf-converter/</link>
		<comments>http://blog.laststation.net/2008/11/16/seam-generic-jsf-converter/#comments</comments>
		<pubDate>Sun, 16 Nov 2008 17:45:39 +0000</pubDate>
		<dc:creator>Radim Marek</dc:creator>
				<category><![CDATA[seam]]></category>
		<category><![CDATA[converter]]></category>
		<category><![CDATA[jsf]]></category>

		<guid isPermaLink="false">http://laststation.net/?p=70</guid>
		<description><![CDATA[JBoss Seam provides excellent support for mapping of the managed entities back and forth between the select items and the actual entities. Tag s:convertEntity supplies JSF converter which renders option values and consequently translate them back, using Entity Loader (either Hibernate Session or EntityManager), to the appropriate entity. Whole process relies on the provision of [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.laststation.net&blog=8338629&post=70&subd=radimmarek&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://seamframework.org/">JBoss Seam</a> provides excellent support for mapping of the managed entities back and forth between the select items and the actual entities. Tag <i>s:convertEntity</i> supplies JSF converter which renders option values and consequently translate them back, using Entity Loader (either Hibernate Session or EntityManager), to the appropriate entity. Whole process relies on the provision of the entity identifier. This is indeed very powerful solution, but unfortunately so far I&#8217;ve haven&#8217;t got much chances to use it, except the training or with very simple applications. In most scenarios, the problem comes with strict separation of the presentation layer from business logic and therefore persistence support. And without Entity Loader, there&#8217;s not much fun with <i>s:convertEntity</i>.</p>
<p>Solution to this problem is quite simple &#8211; introduction of the custom JSF converter, where only requirement is to implement <i>javax.faces.convert.Converter</i> interface. There&#8217;s plenty of <a href="http://www.roseindia.net/jsf/customconverter.shtml">examples</a> available on-line or you can refer to Chapter 15.5 of <a href="http://www.manning.com/mann/">JSF In Action</a>. If it&#8217;s for a single use, this is perfect solution. A bit more systematic approach to keep the code manageable is to create a generic converter.
	</p>
<p>This particular solution is based on the assumption there&#8217;s a collection of objects of the same class, and the need for identifier distinguishing these instances. Following the same approach as with <i>s:convertEntity</i> the first step would be to introduce thecustom Facelet tag.</p>
<pre class="brush: xml;">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;!DOCTYPE facelet-taglib PUBLIC
  &quot;-//Sun Microsystems, Inc.//DTD Facelet Taglib 1.0//EN&quot;
  &quot;http://java.sun.com/dtd/facelet-taglib_1_0.dtd&quot;&gt;
&lt;facelet-taglib xmlns=&quot;http://java.sun.com/JSF/Facelet&quot;&gt;
  &lt;namespace&gt;http://laststation.net/utils/jsf&lt;/namespace&gt;

  &lt;tag&gt;
    &lt;tag-name&gt;convertGeneric&lt;/tag-name&gt;
    &lt;converter&gt;
	  &lt;converter-id&gt;net.laststation.utils.jsf.converter.GenericConverter&lt;/converter-id&gt;
    &lt;/converter&gt;
  &lt;/tag&gt;
&lt;/facelet-taglib&gt;	</pre>
<p>Save this file as META-INF/cg.taglib.xml and using namespace you can refer it within your XHTML view.	Next step is to implement <i>GenericConverter</i>. Example follows.</p>
<pre class="brush: java;">
package net.laststation.utils.jsf.converter;

import static org.jboss.seam.ScopeType.STATELESS;
import static org.jboss.seam.annotations.Install.FRAMEWORK;

import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.Scope;
import org.jboss.seam.annotations.Install;
import org.jboss.seam.annotations.intercept.BypassInterceptors;
import org.jboss.seam.annotations.faces.Converter;
import org.apache.commons.logging.LogFactory;
import org.apache.commons.logging.Log;

import java.io.Serializable;
import java.util.Collection;
import java.beans.IntrospectionException;
import java.beans.PropertyDescriptor;
import java.lang.reflect.InvocationTargetException;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;

/**
 * Supports conversion of an object to/from an object
 *
 * @author radimm
 */
@Name(&quot;net.laststation.utils.jsf.converter.GenericConverter&quot;)
@Scope(STATELESS)
@Install(precedence = FRAMEWORK)
@Converter
@BypassInterceptors
public class GenericConverter implements javax.faces.convert.Converter {
    private Log log = LogFactory.getLog(GenericConverter.class);
    private String identifier;
    private Collection collection;

    public Object getAsObject(FacesContext ctx, UIComponent component, String s) {
        if (s == null)
            return null;

        if (collection != null) {
            for (Object item : collection) {
                String id = getItemIdentifier(item, s);

                if (id != null &amp;&amp; id.equals(s)) {
                    return item;
                }
            }
        }

        return null;
    }

    public String getAsString(FacesContext ctx, UIComponent component, Object o) {
        return getItemIdentifier(o, identifier);
    }

    protected String getItemIdentifier(Object o, String property) {
        PropertyDescriptor desc;
        Object result;

        try {
            desc = new PropertyDescriptor(property, o.getClass());
            result = desc.getReadMethod().invoke(o);

            return result.toString();
        } catch (Throwable e) {
            log.error(&quot;Unable to get object identifier!&quot;, e);
        }

        return null;
    }

    public Collection getCollection() {
        return collection;
    }

    public void setCollection(Collection collection) {
        this.collection = collection;
    }

    public String getIdentifier() {
        return identifier;
    }

    public void setIdentifier(String identifier) {
        this.identifier = identifier;
    }
}
</pre>
<p>Implementation is quite straightforward, following the same principles as I&#8217;ve shown in the post <a href="http://laststation.net/2007/10/14/extending-seam-components/">Extending Seam components</a>. It&#8217;s important to keep this component stateless (or at least bound them to EVENT scope) to make sure the supplied collection and the identifier are used only within a single call. Provided code is nothing close to perfect, it&#8217;s supposed to serve as an example to various different implementations. Also it&#8217;s supposed to be an example how easy is to write custom Facelet tag.</p>
<p>To use this converter just place code similar to following example where appropriate:</p>
<pre class="brush: java;">
		&lt;cg:convertGeneric collection=&quot;#{mycomponent.countries}&quot; identifier=&quot;code&quot;/&gt;
	</pre>
<p>Where <i>countries</i> is collection like <i>List&lt;Country&gt; countries</i>, and <i>code</i> is property of the objects within it. Using all the power of EL expressions and Seam functionality &#8211; like factories &#8211; there&#8217;s a plenty of use cases for this converter.
</p>
<p>Complete source code is available for download as maven project (see links below). This example omits use of JSPs, because I hope nobody is really using them these days &#8211; especially with Seam projects.</p>
<p>
Links:</p>
<ul>
<li><a href="http://www2.laststation.net/temp/code/convertGeneric-1.0.tar.gz">convertGeneric source code</a></li>
</ul>
<p></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/radimmarek.wordpress.com/70/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/radimmarek.wordpress.com/70/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/radimmarek.wordpress.com/70/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/radimmarek.wordpress.com/70/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/radimmarek.wordpress.com/70/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/radimmarek.wordpress.com/70/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/radimmarek.wordpress.com/70/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/radimmarek.wordpress.com/70/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/radimmarek.wordpress.com/70/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/radimmarek.wordpress.com/70/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.laststation.net&blog=8338629&post=70&subd=radimmarek&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://blog.laststation.net/2008/11/16/seam-generic-jsf-converter/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/482a7936cd83ef263090c6d4dbc22179?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">Radim Marek</media:title>
		</media:content>
	</item>
	</channel>
</rss>