<?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>Steven R. Wamsley &#187; Computer Technology</title>
	<atom:link href="http://ne0phyte.com/blog/category/home-page/computer-technology/feed/" rel="self" type="application/rss+xml" />
	<link>http://ne0phyte.com</link>
	<description>Musician, developer, and software architect... aka ne0phyte</description>
	<lastBuildDate>Thu, 11 Aug 2011 14: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>PHP Quiz: Passing Objects By Value vs. Reference</title>
		<link>http://ne0phyte.com/blog/2010/04/06/php-quiz-passing-objects-by-value-vs-reference/</link>
		<comments>http://ne0phyte.com/blog/2010/04/06/php-quiz-passing-objects-by-value-vs-reference/#comments</comments>
		<pubDate>Tue, 06 Apr 2010 23:50:36 +0000</pubDate>
		<dc:creator>ne0phyte</dc:creator>
				<category><![CDATA[Computer Technology]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://ne0phyte.com/?p=176</guid>
		<description><![CDATA[Here is something to test your knowledge of how PHP handles passing objects by value vs. reference. Try to figure this out without using a PHP interpreter. What is the output of the following code: class Foo { private $bar; public function Foo($x) { $this-&#62;bar = $x; } public function getBar() { return $this-&#62;bar; } [...]]]></description>
			<content:encoded><![CDATA[<p>Here is something to test your knowledge of how PHP handles passing objects by value vs. reference. Try to figure this out without using a PHP interpreter.</p>
<p>What is the output of the following code:</p>
<pre>class Foo {
  private $bar;
  public function Foo($x) {
    $this-&gt;bar = $x;
  }
  public function getBar() {
    return $this-&gt;bar;
  }
  public function setBar($x) {
    $this-&gt;bar = $x;
  }
}

function changeFooByValue($foo) {
 $foo-&gt;setBar('high');
 $foo = new Foo('too low');
}

function changeFooByRef(&amp;$foo) {
  $foo-&gt;setBar('just high enough');
  $foo = new Foo('too high');
}

$foo = new Foo('low');
echo "Bar: " . $foo-&gt;getBar() . "\n";

changeFooByValue($foo);
echo "Bar: " . $foo-&gt;getBar() . "\n";

changeFooByRef($foo);
echo "Bar: " . $foo-&gt;getBar() . "\n";
</pre>
<p>Is it:</p>
<p>A:</p>
<pre>Bar: low
Bar: too low
Bar: too high</pre>
<p>B:</p>
<pre>Bar: low
Bar: too low
Bar: too high</pre>
<p>C:</p>
<pre>Bar: low
Bar: too low
Bar: too high</pre>
<p>D:</p>
<p>Parse/syntax error</p>
<p>E:</p>
<p>None of the above</p>
]]></content:encoded>
			<wfw:commentRss>http://ne0phyte.com/blog/2010/04/06/php-quiz-passing-objects-by-value-vs-reference/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Using PHP/cURL to grok your public IP address</title>
		<link>http://ne0phyte.com/blog/2009/07/23/using-phpcurl-to-grok-your-public-ip-address/</link>
		<comments>http://ne0phyte.com/blog/2009/07/23/using-phpcurl-to-grok-your-public-ip-address/#comments</comments>
		<pubDate>Thu, 23 Jul 2009 21:10:33 +0000</pubDate>
		<dc:creator>ne0phyte</dc:creator>
				<category><![CDATA[Computer Technology]]></category>

		<guid isPermaLink="false">http://ne0phyte.com/?p=159</guid>
		<description><![CDATA[I had the occasion to create a PHP page that displays the server&#8217;s current public IP address. Not necessarily a good thing to display. But, I have several internal web sites on a development server where the host names are not available on a public DNS server. Displaying the server&#8217;s current public IP address is [...]]]></description>
			<content:encoded><![CDATA[<p>I had the occasion to create a PHP page that displays the server&#8217;s current public IP address. Not necessarily a good thing to display. But, I have several internal web sites on a development server where the host names are not available on a public DNS server. Displaying the server&#8217;s current public IP address is handy to prevent needing to nslookup my dyndns host name when altering my host file.</p>
<p>So, here is how I did it:</p>
<pre>$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "www.checkip.org");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$output = curl_exec($ch);

$pattern = '/Your IP:  ([\d]{1,3}.[\d]{1,3}.[\d]{1,3}.[\d]{1,3})&lt;\/span&gt;/';
$matches = array();
preg_match($pattern, $output, $matches);

$yourIP = 'N/A';
if (count($matches) &gt; 1) {
  $yourIP = $matches[1];
}
curl_close($ch);</pre>
<p>What I&#8217;m doing here is using cURL to get the page at checkip.org and then using a regular expressing to get the IP address returned in that page.</p>
<p>Albeit not completely fault-tolerant, as the web site can change it&#8217;s structure, but this type of quick&#8217;n'dirty screen scraping was what I needed at the time.</p>
]]></content:encoded>
			<wfw:commentRss>http://ne0phyte.com/blog/2009/07/23/using-phpcurl-to-grok-your-public-ip-address/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>New app, coming soon to an App Store near you: Cheapest</title>
		<link>http://ne0phyte.com/blog/2008/12/25/new-app-coming-soon-to-an-app-store-near-you-cheapest/</link>
		<comments>http://ne0phyte.com/blog/2008/12/25/new-app-coming-soon-to-an-app-store-near-you-cheapest/#comments</comments>
		<pubDate>Thu, 25 Dec 2008 20:40:26 +0000</pubDate>
		<dc:creator>ne0phyte</dc:creator>
				<category><![CDATA[Computer Technology]]></category>
		<category><![CDATA[iPhone App]]></category>

		<guid isPermaLink="false">http://ne0phyte.com/?p=88</guid>
		<description><![CDATA[What is cheapest? Two 12 oz. cans for $4.99 or one pint for $3.99? Find out with the newest iPhone App from Katanaa: Cheapest. We submitted the app to the store last Friday. It will be a day or two before it&#8217;s available. Stay tuned. Update: Cheapest is now available in the App Store: Get [...]]]></description>
			<content:encoded><![CDATA[<p>What is cheapest? Two 12 oz. cans for $4.99 or one pint for $3.99? Find out with the newest iPhone App from Katanaa: Cheapest. We submitted the app to the store last Friday. It will be a day or two before it&#8217;s available. Stay tuned.</p>
<p>Update: Cheapest is now available in the App Store: <a href="http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=300770393&amp;mt=8">Get the Cheapest application from iTunes</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://ne0phyte.com/blog/2008/12/25/new-app-coming-soon-to-an-app-store-near-you-cheapest/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>iPhone Electronic Formula Calculator</title>
		<link>http://ne0phyte.com/blog/2008/11/13/iphone-electronic-formula-calculator/</link>
		<comments>http://ne0phyte.com/blog/2008/11/13/iphone-electronic-formula-calculator/#comments</comments>
		<pubDate>Fri, 14 Nov 2008 01:29:11 +0000</pubDate>
		<dc:creator>ne0phyte</dc:creator>
				<category><![CDATA[Computer Technology]]></category>
		<category><![CDATA[Electronics]]></category>
		<category><![CDATA[iPhone App]]></category>

		<guid isPermaLink="false">http://ne0phyte.com/?p=87</guid>
		<description><![CDATA[My latest adventure has been in the iPhone/iTouch application development world. The first application to hit the iTunes Store is Formula Sensei, a formula database and calculator. Formula Sensei will encompass a suite of formula calculators, the first of which is the Electronic Formula Calculator. This app has been developed and uploaded for review/approval to [...]]]></description>
			<content:encoded><![CDATA[<p>My latest adventure has been in the iPhone/iTouch application development world. The first application to hit the iTunes Store is Formula Sensei, a formula database and calculator. Formula Sensei will encompass a suite of formula calculators, the first of which is the Electronic Formula Calculator. This app has been developed and uploaded for review/approval to the iTunes store. Future editions of Formula Sensei will include financial, real estate, physics, etc. A web site has been set up to provide more information about the product:</p>
<p><a title="Formula Sensei" href="http://formulasensei.com">formulasensei.com</a></p>
<p>Update: the E-Formulas app has now been approved for sale! See it at the iTunes Store: <a title="E-Formulas at the iTunes Store" href="http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=296288975&amp;mt=8">E-Formulas</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://ne0phyte.com/blog/2008/11/13/iphone-electronic-formula-calculator/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Apache Performance: Rotate your logs (duh)</title>
		<link>http://ne0phyte.com/blog/2008/10/07/apache-performance-rotate-your-logs/</link>
		<comments>http://ne0phyte.com/blog/2008/10/07/apache-performance-rotate-your-logs/#comments</comments>
		<pubDate>Wed, 08 Oct 2008 02:21:38 +0000</pubDate>
		<dc:creator>ne0phyte</dc:creator>
				<category><![CDATA[Computer Technology]]></category>

		<guid isPermaLink="false">http://ne0phyte.com/?p=51</guid>
		<description><![CDATA[Seems kinda silly, doesn&#8217;t it? After following all the Apache performance tips found on Google, I noticed that the site I was tuning (rss2.com) had access logs exceeding 2GB in size. Now if you imagine each httpd process having to load a file that size, you can imagine why it took so long for new [...]]]></description>
			<content:encoded><![CDATA[<p>Seems kinda silly, doesn&#8217;t it? After following all the Apache performance tips found on Google, I noticed that the site I was tuning (rss2.com) had access logs exceeding 2GB in size. Now if you imagine each httpd process having to load a file that size, you can imagine why it took so long for new httpd processes to load.</p>
<p>I configured logrotate to rotate logs each hour when the logs exceeded 100K. What a difference! Of course, restarting Apache every hour helps, too. But the change made a significant difference.</p>
]]></content:encoded>
			<wfw:commentRss>http://ne0phyte.com/blog/2008/10/07/apache-performance-rotate-your-logs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JavaScript Keypress Event &#8211; the right way</title>
		<link>http://ne0phyte.com/blog/2008/09/02/javascript-keypress-event/</link>
		<comments>http://ne0phyte.com/blog/2008/09/02/javascript-keypress-event/#comments</comments>
		<pubDate>Tue, 02 Sep 2008 19:35:15 +0000</pubDate>
		<dc:creator>ne0phyte</dc:creator>
				<category><![CDATA[Computer Technology]]></category>

		<guid isPermaLink="false">http://ne0phyte.com/?p=41</guid>
		<description><![CDATA[I had an occassion where I had to capture the &#8220;enter&#8221; key press in a text box and couldn&#8217;t quite remember how to do that. So, like the well-adjusted web developer I am, I Google&#8217;d for the answer. I was suprised to find how many different solutions there were and how some of them just [...]]]></description>
			<content:encoded><![CDATA[<p>I had an occassion where I had to capture the &#8220;enter&#8221; key press in a text box and couldn&#8217;t quite remember how to do that. So, like the well-adjusted web developer I am, I Google&#8217;d for the answer. I was suprised to find how many different solutions there were and how some of them just plain didn&#8217;t work.</p>
<p>I turned to the tried-and-true Prototype library (because that&#8217;s how I remembered doing it in the first place). The bonus with using Prototype is that it will actually be browser compatible.</p>
<p>Here is the penultimate solution to capturing an &#8220;enter&#8221; keypress in an HTML input text box.</p>
<p>The HTML:</p>
<p><code>&lt;input type="text" name="my_text" id="my_text" value="" /&gt;</code></p>
<p>The JavaScript:</p>
<p><code>&lt;script type="text/javascript"&gt;&lt;!--<br />
function onMyTextKeypress(event)<br />
{<br />
if (Event.KEY_RETURN == event.keyCode) {<br />
// do something usefull<br />
alert('Enter key was pressed.');<br />
}<br />
return;<br />
}</code></p>
<p><code>Event.observe('my_text', 'keypress', onMyTextKeypress);</code><br />
<code> //--&gt;<br />
&lt;/script&gt;</code></p>
<p>Now, don&#8217;t forget to include the prototype.js script in the HTML page!</p>
<p><code>&lt;script type="text/javascript" src="/js/prototype.js"&gt;&lt;/script&gt;</code></p>
<p>The JavaScript must execute <em>after</em> the DOM elements are rendered. One way to do it is to put the JavaScript code in a SCRIPT element after the INPUT element. However, another way would be to put the following code in the SCRIPT element in the HEAD element:</p>
<p><code>Event.observe(window, 'load', function() {<br />
Event.observe(Event.observe('my_text', 'keypress', onMyTextKeypress);<br />
});<br />
</code></p>
<p>I like this method because all the JavaScript can be kept in the HEAD, or in a JS library file, instead of splattering the code throughout the document body.</p>
<p>References:</p>
<p><a href="http://prototypejs.org/api/event/observe">Prototype Event.observe API</a></p>
]]></content:encoded>
			<wfw:commentRss>http://ne0phyte.com/blog/2008/09/02/javascript-keypress-event/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>PHPKeyStore Update</title>
		<link>http://ne0phyte.com/blog/2008/07/01/phpkeystore-update/</link>
		<comments>http://ne0phyte.com/blog/2008/07/01/phpkeystore-update/#comments</comments>
		<pubDate>Tue, 01 Jul 2008 21:18:22 +0000</pubDate>
		<dc:creator>ne0phyte</dc:creator>
				<category><![CDATA[Computer Technology]]></category>
		<category><![CDATA[KeyStore]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://ne0phyte.com/?p=35</guid>
		<description><![CDATA[The KeyStore API is code complete. Check it out at phpkeystore.org. The current development release can always be installed with PEAR using: pear install http://phpkeystore.org/download/KeyStore-current.tgz All that really remains right now is internal tweaking for best practices and performance. To summarize the functionality, the key management functionality consists of: Loading and storing the key store [...]]]></description>
			<content:encoded><![CDATA[<p>The KeyStore API is code complete. Check it out at <a href="http://phpkeystore.org">phpkeystore.org</a>. The current development release can always be installed with PEAR using:</p>
<p><code>pear install http://phpkeystore.org/download/KeyStore-current.tgz</code></p>
<p>All that really remains right now is internal tweaking for best practices and performance.</p>
<p>To summarize the functionality, the key management functionality consists of:</p>
<ul>
<li>Loading and storing the key store</li>
<li>Creating secret keys, certificate signing requests, importing signed certificates, and deleting key store entries</li>
<li>Querying the key store for the existence of an entry and what type of entry it is</li>
</ul>
<p>And the key usage functionality consists of:</p>
<ul>
<li>Loading the key store</li>
<li>Using a public/private key pair to encrypt, decrypt, sign, and verify</li>
<li>Using a secret symmetric key to encrypt and decrypt</li>
</ul>
<p>The current to-do list:</p>
<ul>
<li>Add configuration file for system default values</li>
<li>Support file-based passwords</li>
<li>Support user-supplied options on the interface methods in order to support cryptographic functionality other than the default, baked-in settings</li>
<li>Add failure-case unit tests</li>
<li>Code review</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://ne0phyte.com/blog/2008/07/01/phpkeystore-update/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Internet/Network Gotchas</title>
		<link>http://ne0phyte.com/blog/2008/05/16/internet-network-gotchas/</link>
		<comments>http://ne0phyte.com/blog/2008/05/16/internet-network-gotchas/#comments</comments>
		<pubDate>Fri, 16 May 2008 16:46:29 +0000</pubDate>
		<dc:creator>ne0phyte</dc:creator>
				<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://ne0phyte.com/?p=24</guid>
		<description><![CDATA[The following forty five (45) Internet/network security gotchas are taken from Firewalls and Internet Security &#8211; Repelling the Wily Hacker, Second Edition (ISBN: 0-201-63344-X) by William R. Cheswick, et. al. IP source addresses aren&#8217;t trustable. Fragmented packets have been abused to avoid security checks. ARP-spoofing can lead to session-hijacking. Sequence number attacks can be used [...]]]></description>
			<content:encoded><![CDATA[<p>The following forty five (45) Internet/network security gotchas are taken from <a title="Preview Book" href="http://books.google.com/books?id=_ZqIh0IbcrgC&amp;printsec=frontcover&amp;source=gbs_summary_r&amp;cad=0" target="_blank">Firewalls and Internet Security &#8211; Repelling the Wily Hacker, Second Edition</a> (ISBN: 0-201-63344-X) by William R. Cheswick, et. al.</p>
<ol>
<li><abbr title="Internet Protocol">IP</abbr> source addresses aren&#8217;t trustable.</li>
<li>Fragmented packets have been abused to avoid security checks.</li>
<li><abbr title="Address Resolution Protocol">ARP</abbr>-spoofing can lead to session-hijacking.</li>
<li>Sequence number attacks can be used to subvert address-based authentication.</li>
<li>It is easy to spoof <abbr title="User Datagram Packet">UDP</abbr> packets.</li>
<li><abbr title="Internet Control Message Protocol">ICMP</abbr> <code>Redirect</code> messages can subvert routing tables.</li>
<li><abbr title="Internet Protocol">IP</abbr> source routing can address-based authentication.</li>
<li>It is easy to generate bogus <abbr title="Routing Information Protocol">RIP</abbr> messages.</li>
<li>The inverse <abbr title="Domain Name Server">DNS</abbr> tree can be used for name-spoofing.</li>
<li>The <abbr title="Domain Name Server">DNS</abbr> cache can be contaminated to foil cross-checks.</li>
<li><abbr title="Internet Protocol version 6">IPv6</abbr> network numbers may change frequently.</li>
<li><abbr title="Internet Protocol version 6">IPv6</abbr> host addresses change frequently, too.</li>
<li><abbr title="Wired Equivalent Privacy">WEP</abbr> is useless.</li>
<li>Attackers have the luxury of using nonstandard equipment.</li>
<li>Return addresses in mail aren&#8217;t reliable, and this fact is easily forgotten.</li>
<li>Don&#8217;t blindly execute <abbr title="Multipurpose Internet Mail Extension">MIME</abbr> messages.</li>
<li>Don&#8217;t trust <abbr title="Remote Procedure Call">RPC</abbr>&#8216;s machine name field.</li>
<li><em>Rpcbind</em> can call <abbr title="Remote Procedure Call">RPC</abbr> services for its caller.</li>
<li><abbr title="Network Information Service">NIS</abbr> can often be persuaded to give out password files.</li>
<li>It is sometimes possible to direct machines to phony <abbr title="Network Information Service">NIS</abbr> servers.</li>
<li>If misconfigured, <abbr title="Trivial File Transfer Protocol">TFTP</abbr> will had over sensitive files.</li>
<li>Don&#8217;t make <em>ftp</em>&#8216;s home directory writable by <em>ftp</em>.</li>
<li>Don&#8217;t put a real password file in the anonymous <em>ftp</em> area.</li>
<li>It is easy to wiretap <em>telnet</em> sessions.</li>
<li>The <em>r</em> commands rely on address-based authentication.</li>
<li>Be careful about interpreting <abbr title="World Wide Web">WWW</abbr> format information.</li>
<li><abbr title="World Wide Web">WWW</abbr> servers should be careful about <abbr title="Uniform Resource Locator">URL</abbr>s.</li>
<li>Poorly written query scripts pose a danger to <abbr title="World Wide Web">WWW</abbr> servers.</li>
<li>The <abbr title="Multicast Backbone">MBone</abbr> can be used to route through some firewalls.</li>
<li>Scalable security administration of peer-to-peer nodes is difficult.</li>
<li>An attacker anywhere on the Internet can probe for X11 servers.</li>
<li><abbr title="User Datagram Packet">UDP</abbr>-based services can be abused to create broadcast storms.</li>
<li>Web servers shouldn&#8217;t believe uploaded state variables.</li>
<li>Signed code is not necessarily safe code.</li>
<li>[Client-side script] is dangerous.</li>
<li>Users are ill-equipped to make correct security choices.</li>
<li>Humans choose lousy passwords.</li>
<li>There are lots of ways to grab <code>/etc/passwd</code>.</li>
<li>There is no absolute remedy for a denial-of-service attack.</li>
<li>Hackers plant sniffers.</li>
<li>Network monitoring tools can be very dangerous on an exposed machine.</li>
<li>Don&#8217;t believe port numbers supplied by outside machines.</li>
<li>It is all but impossible to permit most <abbr title="User Datagram Packet">UDP</abbr> traffic through a packet filter safely.</li>
<li>A tunnel can be built on top of almost any transport mechanism.</li>
<li>If the connection is vital, don&#8217;t use a public network.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://ne0phyte.com/blog/2008/05/16/internet-network-gotchas/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Security Truisms in Application Design and Architechture</title>
		<link>http://ne0phyte.com/blog/2008/05/16/application-security-truisms/</link>
		<comments>http://ne0phyte.com/blog/2008/05/16/application-security-truisms/#comments</comments>
		<pubDate>Fri, 16 May 2008 15:41:44 +0000</pubDate>
		<dc:creator>ne0phyte</dc:creator>
				<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://ne0phyte.com/?p=23</guid>
		<description><![CDATA[Designing applications for the web requires an up-front security mind-set. It does not matter if the application takes credit card payments or if it hosts static web content. A public web site is just that: a public portal to computer assets that someone out there on the Internet will eventually find and will want to [...]]]></description>
			<content:encoded><![CDATA[<p>Designing applications for the web requires an up-front security mind-set. It does not matter if the application takes credit card payments or if it hosts static web content. A public web site is just that: a public portal to computer assets that someone out there on the Internet will eventually find and will want to exploit for whatever nefarious reason entertains their interests, whatever it is.</p>
<p>The purpose of this post is to discuss the web application design and architecture security truisms that I have held true during my experience as a developer and architect. The following fifteen (15) security truisms are taken from <a title="Preview Book" href="http://books.google.com/books?id=_ZqIh0IbcrgC&amp;printsec=frontcover&amp;source=gbs_summary_r&amp;cad=0" target="_blank">Firewalls and Internet Security &#8211; Repelling the Wily Hacker, Second Edition</a> (ISBN: 0-201-63344-X) by William R. Cheswick, et. al. These truisms are key to any security model &#8211; not just information security. For the purposes of this post, I will discuss how they relate to application design and architecture.</p>
<ol>
<li><strong>There is no such thing as absolute security.</strong> Any web application deployed to a network, be it publicly on the Internet, internally on an Intranet, or even privately on an extranet, will not be absolutely secure. This is due to the fact that it is <em>connected</em> to a network &#8211; the level of it&#8217;s security has been diminished purely by it&#8217;s nature of been <em>deployed</em>. This is a fact.</li>
<li><strong>Security is always a question of economics.</strong> The amount of security that a web application design employs is dependent upon the amount of security infrastructure the application owner is willing to pay for. Though tighter security can be bought with hardware cryptography, <abbr title="Lightweight Directory Access Protocol">LDAP</abbr> servers, etc., it&#8217;s always a question of cost vs. how much risk the application owner is willing to accept. In the end, it&#8217;s a question of balance.</li>
<li><strong>Keep the level of all your defenses at the same height.</strong> This is a tricky one that many people overlook &#8211; balance. The level of an application&#8217;s should balance the level of security of the environment in which it is being deployed. This includes, but is not limited to, the level of physical and software firewall protection, the amount and type of intrusion detection systems, etc. It doesn&#8217;t make a lot of sense to blow out the security architecture of a web application if it&#8217;s going to be deployed in your brother&#8217;s basement on his Wi-Fi router. Conversely, it makes equally less sense to deploy a an insecure web application in a shared hosting environment that hosts credit card payment applications.</li>
<li><strong>An attacker doesn&#8217;t go through security, but around it.</strong> The web application should not be designed as another security hole in the web site&#8217;s security! Attackers will look for weaknesses in web applications deployed to a web site and exploit them.</li>
<li><strong>Put your defenses in layers.</strong></li>
<li><strong>It&#8217;s a bad idea to rely on &#8220;security through obscurity.&#8221;</strong> Compiling the password into the source code, believing it won&#8217;t be found because it has been &#8220;obscured&#8221;, is stupid. I&#8217;m sorry, I said it. I&#8217;ve seen it done before. Put hope in the cost/benefit of hiding secrets in plain site will only reek havoc in the end.</li>
<li><strong>Keep it simple.</strong> Cleaner, well documented code is easier to maintain. Easier maintained code is even easier to secure.</li>
<li><strong>Don&#8217;t give a person or a program any more privileges than those necessary to do the job.</strong> Developers don&#8217;t need access to secured resources. The exception is source code repositories, development databases, development <abbr title="Lightweight Directory Access Protocol">LDAP</abbr> servers, etc. Web applications should be deployed by deployers, not developers. The production authentication credentials should be provided to system administrators that set up the web application server infrastructure. A truly well designed application architecture will not require a developer or deployer to know the production authentication credentials of protected resources such as databases, LDAP servers, or hardware key stores.</li>
<li><strong>Programming is hard.</strong> Secure programming is harder. Don&#8217;t make the job harder than it needs to be. Use common components commonly accepted by the global development community. Don&#8217;t reinvent the wheel by rewriting cryptography algorithms. Reuse code and see #7.</li>
<li><strong>Security should be an integral part of the original design.</strong></li>
<li><strong>If you do not run a program, it does not matter if it has security holes.</strong> If you do not deploy a web application, it does not matter if it is insecure. However, no one will be able to access it.</li>
<li><strong>A program or protocol is insecure until proven secure.</strong> Run web application vulnerability scanning tools. You will be surprised what you will find &#8211; and what you will learn about secure programming practices. See <a href="http://en.wikipedia.org/wiki/List_of_Web_Apps_Security_Scanners" target="_blank">http://en.wikipedia.org/wiki/List_of_Web_Apps_Security_Scanners</a> for a list of web application scanners.</li>
<li><strong>A chain is only as strong as its weakest link.</strong> Our hosting environment can provide us with the strongest firewalls and intrusion detection systems. However, we are writing software, too. The software we write is just one more link the chain. That link must be designed as strong as the rest of the links in chain.</li>
<li><strong>Security is a trade-off with convenience.</strong> And, as security often inconveniences users, the application owner will often feel inconvenienced by higher levels of security. This is where discussions on &#8220;single-sign-on&#8221; begin. For any given company, a users will want to sign-in to the web site once. To sign-in again will be an inconvenience. To have to remember more than one password is even more inconvenient. Ergo, without a &#8220;single-sign-on&#8221; solution in place, users will feel inconvenienced if they have to sign-in every time the visit a different web site that requires authentication for a given company.</li>
<li><strong>Don&#8217;t underestimate the value of your assets. </strong>Just because the web application does not perform secure payment transactions does not mean that it isn&#8217;t attractive to attackers. Any computer resource on the Internet can be used as a host for an attack for whatever reason.</li>
</ol>
<p>All this being said, secure web application design is possible, affordable, and necessary. It must be thought out and balanced against the needs of the application owner and deployment environment. As technology professionals, we are all responsible for the web applications that we design, implement, and deploy because, as any software being run in a remote hosting environment, we provide the gateway between our computer assets and the world wide web.</p>
]]></content:encoded>
			<wfw:commentRss>http://ne0phyte.com/blog/2008/05/16/application-security-truisms/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

