<?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>Sheepdog IT &#187; s3</title>
	<atom:link href="http://www.sheepdogit.com/category/s3/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.sheepdogit.com</link>
	<description>Herding Penguins for over 5 years</description>
	<lastBuildDate>Tue, 15 Jun 2010 20:35:17 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>AWS S3, PHP Security for Shared Servers</title>
		<link>http://www.sheepdogit.com/2007/04/16/aws-s3-php-security-shared-server/</link>
		<comments>http://www.sheepdogit.com/2007/04/16/aws-s3-php-security-shared-server/#comments</comments>
		<pubDate>Tue, 17 Apr 2007 00:00:48 +0000</pubDate>
		<dc:creator>Bozzie</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[s3]]></category>

		<guid isPermaLink="false">http://bozziesfw.wordpress.com/2007/04/16/aws-s3-php-security-for-shared-servers/</guid>
		<description><![CDATA[The Amazon Web Services Simple Storage Service (AWS S3) agreement makes it clear that you the user are completely liable for any unauthorized use of your secret key. However, their PHP, Python, and Ruby code examples usually start off with &#8220;$secretKey = &#60;insert your key here&#62;&#8221; followed by a caution to &#8220;only use this example [...]]]></description>
			<content:encoded><![CDATA[<p>The Amazon Web Services Simple Storage Service (AWS S3) agreement makes it clear that you the user are completely liable for any unauthorized use of your secret key.  However, their PHP, Python, and Ruby code examples usually start off with &#8220;$secretKey = &lt;insert your key here&gt;&#8221; followed by a caution to &#8220;only use this example code on a secure server.&#8221;</p>
<p>I want to host a PHP application on a shared, remote server where I have only <em>ftp</em> access. I have to assume such a server is not secure, since any  sysadmin at the hosting service can browse at will.  I&#8217;m surely not the first person to host an S3 application on a remote server, yet there are only unanswered threads in the AWS forums regarding best security practices.  So I&#8217;m guessing that some users are uploading the AWS secret keys and hoping for the best.</p>
<p>Here are the ways I&#8217;ve considered for using S3 from a Shared, Remote Web server:</p>
<ol>
<li><strong>Upload Secret Key &#8211; </strong>either in plain text or nominally concealed by an XOR hash or hex encoding.  It would be concealment only, not encryption, since PHP is not compiled.</li>
<li><strong>Encrypt and Upload &#8211; </strong>use another language (Java) or extension (Zend engine) that provides some security.  AWS has some sample Java code that does this.</li>
<li><strong>Use Public Buckets &#8211; </strong>from a secure machine, create a public_read_write bucket on S3.  The PHP application on the shared server can then use anonymous access to read and write objects without requiring the secret key.</li>
<li><strong>User Grantee &#8211; </strong>the AWS documentation states that access can be granted to anyone who has an account on <em>amazon.com</em>, even those without an AWS account.  Obviously, such a person would not have a secret key.  So the shared server application could use an amazon account to access a bucket with such a grant.  However, the <a href="http://docs.amazonwebservices.com/AmazonS3/2006-03-01/" title="Authenticating REST Requests">documentation</a> does not explain how to sign a request with a canonical account name without a secret key.</li>
</ol>
<p>I rejected options 2 &amp; 4 as having too many unknowns at this stage of development.  Adding a new language just to encrypt a key is a big hit in complexity.  Similarly, with no cookbook example and the rather hastily assembled user documentation, I expect lots of trial and error for option 4.  But once documented, option 4 would be my clear first choice.</p>
<p>Options 1 &amp; 3 shift risk between a particular bucket and one&#8217;s secret key.  With option 3, anyone who discovers the publicly read/writable bucket can use it immediately without even needing to find my PHP source code.  But since they don&#8217;t have my secret key, I still have control over the bucket and can turn it off (delete it or make it private).</p>
<p>Option 1 exposes no public buckets on the web.  But the worst case (someone gaining access to the remote server and stealing the secret key) has a big exposure.  Only Amazon customer service can turn off a secret key, and they&#8217;re available only by email and only during business hours. If they take a week to shut off the key, I&#8217;d be liable for all of the charges.</p>
<p>My choice is option 3.  I&#8217;m more comfortable with the risk profile being concentrated onto one bucket.  Also, option 4 is a straighforward upgrade once more documentation becomes available.  One unknown: is there any easy way for hackers to scan AWS S3 searching for public buckets? Let&#8217;s hope not.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sheepdogit.com/2007/04/16/aws-s3-php-security-shared-server/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>AWS S3 PHP Interface Classes</title>
		<link>http://www.sheepdogit.com/2007/04/11/aws-s3-php-interface/</link>
		<comments>http://www.sheepdogit.com/2007/04/11/aws-s3-php-interface/#comments</comments>
		<pubDate>Wed, 11 Apr 2007 10:26:47 +0000</pubDate>
		<dc:creator>Bozzie</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[s3]]></category>

		<guid isPermaLink="false">http://bozziesfw.wordpress.com/2007/04/11/aws-s3-php-interface-classes/</guid>
		<description><![CDATA[I&#8217;ve been investigating the following code bundles to help me to get underway with the Amazon Web Services Simple Storage Service (AWS S3): Test Utility for Amazon S3 in PHP &#8211; from the AWS Developer Connection, it provides s3-test-utility-php.zip which contains: s3.php, index.php, and readme.html. Using the browser GUI provided by index.php to control s3.php, [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been investigating the following code bundles to help me to get underway with the Amazon Web Services Simple Storage Service (AWS S3):</p>
<ul>
<li> <a href="http://developer.amazonwebservices.com/connect/entry.jspa?externalID=482&amp;categoryID=47" title="Test Utility for Amazon S3 in PHP">Test Utility for Amazon S3 in PHP</a> &#8211; from the AWS Developer Connection, it provides <em>s3-test-utility-php.zip</em> which contains: <em>s3.php, index.php,</em> and <em>readme.html.</em>  Using  the browser GUI provided by <em>index.php </em>to control  <em>s3.php,</em> I was able to create a bucket and upload an object.  Code is documented and lists the derivation history of the code (see Storage3 and Mission Data Blog below).</li>
<li><span class="aws-h1"><a href="http://developer.amazonwebservices.com/connect/entry.jspa?externalID=126&amp;categoryID=47" title="Amazon S3 Sample in PHP">Amazon S3 Sample in PHP</a> &#8211; an alternative <em>s3.php</em> that has some common heritage with the Test Utility <em>s3.php.</em></span></li>
<li><span class="aws-h1"><a href="http://blog.apokalyptik.com/storage3" title="Storage3">Storage3 Project</a> &#8211; the predecessor of the AWS Test Utility package, provides file <span style="font-style:italic;">Storage3.php</span> plus the required PEAR modules (making it easy to install on a remote server where PEAR can&#8217;t be invoked).</span></li>
<li><span class="aws-h1"><a href="http://www.missiondata.com/blog/linux/49/s3-streaming-with-php/" title="Mission Data putObjectStream()">Mission Data Blog</a> &#8211; presents the original <span style="font-style:italic;">putObjectStream()</span> method that has now been modified to use a file in the AWS Test Utility. </span></li>
</ul>
<p>I want to stream data directly to S3 (without first saving to a file) thus the current form of the AWS Test Utility package won&#8217;t work directly.  I can either use the Storage3 project or substitute the Mission Data <span style="font-style:italic;">putObjectStream() </span>method back into the AWS Test Utility s3 class.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sheepdogit.com/2007/04/11/aws-s3-php-interface/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
