<?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>iCAT &#187; TechBlog</title>
	<atom:link href="http://www.icat.be/category/techblog/feed" rel="self" type="application/rss+xml" />
	<link>http://www.icat.be</link>
	<description></description>
	<lastBuildDate>Fri, 17 Feb 2012 13:23:29 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>What Google Insights for Search can tell us about the Arab world protests</title>
		<link>http://www.icat.be/techblog/google-insights-for-search-arab-world-protests</link>
		<comments>http://www.icat.be/techblog/google-insights-for-search-arab-world-protests#comments</comments>
		<pubDate>Wed, 23 Feb 2011 15:09:43 +0000</pubDate>
		<dc:creator>svaeyens</dc:creator>
				<category><![CDATA[TechBlog]]></category>
		<category><![CDATA[Data analysis]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[Graph]]></category>
		<category><![CDATA[Insights]]></category>
		<category><![CDATA[Trends]]></category>

		<guid isPermaLink="false">http://www.icat.be/?p=411</guid>
		<description><![CDATA[In the ongoing revolution in the Arab world the use of the internet has been widely accredited as contributor to the mobilisation of protests, thousands were mobilized to protest in the streets of Tunis, Cairo and Tripoli using social media platforms like Facebook and Twitter. It's nice that we can also use the internet to [...]]]></description>
			<content:encoded><![CDATA[<p>In the ongoing <a title="2010-2011 Tunisian Revolution" href="http://en.wikipedia.org/wiki/2010%E2%80%932011_Tunisian_revolution" target="_blank">revolution in the Arab world</a> the use of the internet has been widely accredited as contributor to the mobilisation of protests, thousands were mobilized to protest in the streets of Tunis, Cairo and Tripoli using social media platforms like Facebook and Twitter.</p>

<p>It's nice that we can also use the internet to illustrate and graph the evolution of this revolution through the Middle East. A great tool to do this is <a title="Google Insights for Search" href="http://www.google.com/insights/search/#" target="_blank">Google Insights for Search</a>. (One could also use <a title="Google Trends" href="http://www.google.com/trends" target="_blank">Google Trends</a> to accomplish this but Trends has far less features)</p>

<p>If we graph out the search volume of the names of some countries where the revolutions is burning we can immediately see the sequence of countries where major events are taking place</p>

<p>﻿This <a title="Jasmine Revolution in Google Insights" href="http://www.google.com/insights/search/#q=tunisia&amp;date=1%2F2011%202m&amp;cmpt=q" target="_blank">Insights analysis</a> clearly learns us when the Jasmine Revolution in Tunisia began, in fact we only graph out the google search volume for the keyword "Tunesia"</p>

<p><a href="http://www.icat.be/wp-content/uploads/2011/02/tunisia.gif" rel="prettyPhoto[411]"><img class="size-thumbnail wp-image-415 aligncenter" title="tunisia" src="http://www.icat.be/wp-content/uploads/2011/02/tunisia.gif" alt="" /></a></p>

<p>If we align a <a href="http://www.google.com/insights/search/#q=egypt&amp;date=1%2F2011%202m&amp;cmpt=q">similar graph about the keyword "Egypt"</a> we see that the rumors in Cairo were at its maximum about two weeks later:</p>

<p style="text-align: center;"><a href="http://www.icat.be/wp-content/uploads/2011/02/egypt.gif" rel="prettyPhoto[411]"><img class="size-full wp-image-421 aligncenter" title="egypt" src="http://www.icat.be/wp-content/uploads/2011/02/egypt.gif" alt="" width="503" height="232" /></a></p>

<p style="text-align: left;">We can do the same <a title="Insights Algeria Bahrain Libya" href="http://www.google.com/insights/search/#q=Algeria%2CBahrain%2CLibya&amp;date=2%2F2011%201m&amp;cmpt=q">Algeria, Bahrain and Libya</a> to see when major events took place there (actually they are taking place right now in Libya):</p>

<p style="text-align: center;"><a href="http://www.icat.be/wp-content/uploads/2011/02/algiria-bahrain-libya-legend.gif" rel="prettyPhoto[411]"><img class="alignnone size-full wp-image-424" title="algiria-bahrain-libya-legend" src="http://www.icat.be/wp-content/uploads/2011/02/algiria-bahrain-libya-legend.gif" alt="" width="76" height="69" /></a></p>

<p style="text-align: center;"><a href="http://www.icat.be/wp-content/uploads/2011/02/algiria-bahrain-libya1.gif" rel="prettyPhoto[411]"><img class="size-full wp-image-426 aligncenter" title="algiria-bahrain-libya" src="http://www.icat.be/wp-content/uploads/2011/02/algiria-bahrain-libya1.gif" alt="" width="504" height="233" /></a></p>

<p style="text-align: left;">If we import all the Google Insights data as CSV, import it in excel and use some conditional formatting we can show a nice heatmap of the events that took place in the Middle East:</p>

<p style="text-align: center;"><a href="http://www.icat.be/wp-content/uploads/2011/02/middle-east-heatmap.png" rel="prettyPhoto[411]"><img class="alignnone size-full wp-image-430" title="middle-east-heatmap" src="http://www.icat.be/wp-content/uploads/2011/02/middle-east-heatmap.png" alt="" width="500" height="103" /></a></p>

<p style="text-align: center;"><em>click on the image to enlarge</em></p>

<p style="text-align: left;">We can also link this data to Microsoft Mappoint, this is the situation on Feb 21, 2011:</p>

<p style="text-align: center;"><a href="http://www.icat.be/wp-content/uploads/2011/02/middle-east-map-feb-21.png" rel="prettyPhoto[411]"><img class="size-medium wp-image-446 aligncenter" title="middle-east-map-feb-21" src="http://www.icat.be/wp-content/uploads/2011/02/middle-east-map-feb-21-300x163.png" alt="" width="300" height="163" /></a></p>

<p style="text-align: center;">click on the image to enlarge</p>]]></content:encoded>
			<wfw:commentRss>http://www.icat.be/techblog/google-insights-for-search-arab-world-protests/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Secure Plesk 10 With Suhosin for PHP</title>
		<link>http://www.icat.be/techblog/secure-plesk-10-with-suhosin-for-php</link>
		<comments>http://www.icat.be/techblog/secure-plesk-10-with-suhosin-for-php#comments</comments>
		<pubDate>Sat, 29 Jan 2011 13:45:50 +0000</pubDate>
		<dc:creator>svaeyens</dc:creator>
				<category><![CDATA[TechBlog]]></category>
		<category><![CDATA[curl_exec]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Plesk 10]]></category>
		<category><![CDATA[secure]]></category>
		<category><![CDATA[shell_exec]]></category>
		<category><![CDATA[suhosin]]></category>

		<guid isPermaLink="false">http://www.icat.be/?p=364</guid>
		<description><![CDATA[I recently changed my hosting provider and took advantage of the occasion to completely reinstall my hosting servers in order to start with a clean slate and with a more secure hosting environment in mind. One of the things I really wanted to implement was limiting the execution of potentially insecure php functions like: exec [...]]]></description>
			<content:encoded><![CDATA[<p>I recently changed my hosting provider and took advantage of the occasion to completely reinstall my hosting servers in order to start with a clean slate and with a more secure hosting environment in mind.</p>

<p>One of the things I really wanted to implement was limiting the execution of potentially insecure php functions like:</p>

<table border="0">
<tbody>
<tr>
<td>exec</td>
<td>passthru</td>
<td>shell_exec</td>
<td>system</td>
</tr>
<tr>
<td>pcntl_exec</td>
<td>proc_open</td>
<td>proc_nice</td>
<td>proc_terminate</td>
</tr>
<tr>
<td>proc_get_status</td>
<td>proc_close</td>
<td>leak</td>
<td>apache_child_terminate</td>
</tr>
<tr>
<td>posix_kill</td>
<td>posix_mkfifo</td>
<td>posix_setpgid</td>
<td>posix_setsid</td>
</tr>
<tr>
<td>posix_setuid</td>
<td>escapeshellcmd</td>
<td>escapeshellarg</td>
<td>popen</td>
</tr>
<tr>
<td>curl_multi_exec</td>
<td>show_source</td>
<td><strong>curl_exec</strong></td>
<td>parse_ini_file</td>
</tr>
</tbody>
</table>

<p><br class="spacer_" /></p>

<p>It would be fairly easy to disable all these functions by adding the following line to <em>/etc/php.ini</em>:</p>

<p><code class="plain"> disable_functions = exec, passthru, shell_exec, system, pcntl_exec, proc_open, proc_nice, proc_terminate, proc_get_status, proc_close, leak, apache_child_terminate, posix_kill, posix_mkfifo, posix_setpgid, posix_setsid, posix_setuid, escapeshellcmd, escapeshellarg, popen, curl_multi_exec, show_source, curl_exec, parse_ini_file </code></p>

<p>A major disadvantage of this approach would be that all these functions are disabled for all domains, this is unacceptable, quite some wordpress sites use <em>curl_exec</em>, one of my SEO-enhanced OSCommerce sites uses <em>parse_ini_file</em> ... These sites would not function properly anymore...</p>

<p>One could suggest to override the <em>disabled_functions</em> directive in Plesk's per domain vhosts.conf file, but this wouldn't work, once set in <em>/etc/php.ini</em>, <em>disable_functions </em>cannot be overridden.</p>

<p>In a search to tackle this problem I came across <a title="Suhosin" href="http://www.hardened-php.net/suhosin/index.html" target="_blank">suhosin</a>, an an advanced protection system for <acronym title="Hypertext Preprocessor">PHP </acronym>installations, suhosin has a directive called <em><strong>suhosin.executor.func.blacklist</strong></em> that can be set in php.ini and overriden in you per domain vhosts.conf.</p>

<p>So how do we configure all this?</p>

<ul>
	<li>I started with a CentOS 5.5 install with Plesk 10 on it</li>
	<li>Make sure you have yum installed on your system</li>
	<li>Add the atomic repo to your yum repositories by executing:<br />
 <code class="plain">wget -q -O - http://www.atomicorp.com/installers/atomic | sh </code></li>
	<li>Install suhosin,this step is extremely complicated once you have <em> yum </em>and the atomic repo <img src='http://www.icat.be/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  <br />
 <code class="plain"> yum install suhosin</code></li>
	<li>Add the following line to <em>/etc/php.ini</em> :<br />
 <code class="plain"> suhosin.executor.func.blacklist = exec, passthru, shell_exec, system, pcntl_exec, proc_open, proc_nice, proc_terminate, proc_get_status, proc_close, leak, apache_child_terminate, posix_kill, posix_mkfifo, posix_setpgid, posix_setsid, posix_setuid, escapeshellcmd, escapeshellarg, popen, curl_multi_exec, show_source, curl_exec, parse_ini_file, ini_alter</code></li>
	<li>If you want a function to be enabled for a specific domain, just override the <strong><em>suhosin.executor.func.blacklist</em></strong> directive in your domain-specific <em>vhosts.conf</em> file and leave the function you want to re-enable out of the list.<br />
 let's say we want to enable <strong><em>curl_exec </em></strong>on my domain <em>icat.be</em>, we then edit (or create) the file <em>/var/www/vhosts/icat.be/conf/vhost.conf</em> and add the following line: <br />
 <code class="plain"> php_admin_value suhosin.executor.func.blacklist "exec, passthru, shell_exec, system, pcntl_exec, proc_open, proc_nice, proc_terminate, proc_get_status, proc_close, leak, apache_child_terminate, posix_kill, posix_mkfifo, posix_setpgid, posix_setsid, posix_setuid, escapeshellcmd, escapeshellarg, popen, curl_multi_exec, show_source, parse_ini_file, ini_alter"<br />
 </code>Notice the abcense of the <strong><em>curl_exec </em></strong>function</li>
	<li>Apply your settings with:<br />
 <code class="plain">/usr/local/psa/admin/sbin/httpdmng --reconfigure-all</code></li>
	<li>To test all this and make sure you didn't forget to enable any functions that are required for the proper functioning of your websites, check you logs with <br />
 <code class="plain">grep suhosin /var/log/messages </code><br />
 If a function is blocked you'll see something like: <br />
 <code class="plain">Jan 29 14:24:01 iCAT suhosin[19913]: ALERT - function within blacklist called: curl_exec() (attacker '66.249.66.11', file '/var/www/vhosts/icat.be/httpdocs/wp-includes/class-http.php', line 1402)</code></li>
</ul>]]></content:encoded>
			<wfw:commentRss>http://www.icat.be/techblog/secure-plesk-10-with-suhosin-for-php/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
