<?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:series="http://unfoldingneurons.com/"
	>

<channel>
	<title>Geek Freeq&#187; Security Archives  | Geek Freeq</title>
	<atom:link href="http://www.geekfreeq.com/category/security/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.geekfreeq.com</link>
	<description></description>
	<lastBuildDate>Thu, 10 Jun 2010 17:46:01 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>SecuritySwitch Grows Up on Google Code</title>
		<link>http://www.geekfreeq.com/securityswitch-grows-google-code/</link>
		<comments>http://www.geekfreeq.com/securityswitch-grows-google-code/#comments</comments>
		<pubDate>Sat, 06 Feb 2010 03:16:10 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[ASP]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[products]]></category>

		<guid isPermaLink="false">http://www.geekfreeq.com/?p=465</guid>
		<description><![CDATA[Edit: Due to a trademark infringement, this open source project will now  be named SecuritySwitch. What a huge PITA it was to migrate to a new project on Google Code! Since you cannot rename a project, I had to create a new one and move everything over to it. I so enjoyed blowing 2 [...]]]></description>
			<content:encoded><![CDATA[<div class="edit"><strong>Edit</strong>: Due to a trademark infringement, this open source project will now  be named SecuritySwitch. What a huge PITA it was to migrate to a new project on Google Code! Since you cannot rename a project, I had to create a new one and move everything over to it. I so enjoyed blowing 2 hours of my day off on Good Friday.</div>
<p>I recently <a href="/webpagesecurity-becomes-secureswitch/">posted about an update to my WebPageSecurity module</a> project to the newly named <em>SecuritySwitch</em>. One of the best ways to ramp up coding on the project again is to get it into a public code repository.</p>
<h3>Get with Git?</h3>
<p>I thought about using <a href="http://git-scm.com/" target="_blank">Git</a> on <a href="http://github.com/" target="_blank">GitHub</a>, but I want to get moving on this and that would not be the case if I had to fumble through learning Git now. Although, I do really like the concept of a <a href="http://en.wikipedia.org/wiki/Distributed_revision_control" target="_blank">distributed version control system (DVCS)</a>. Instead, I will stick with <a href="http://subversion.apache.org/" target="_blank">Subversion (SVN)</a> for now.</p>
<h3>Google Code</h3>
<p>That lands the project in the capable arms of <a href="http://code.google.com/" target="_blank">Google Code</a>, which I find to be a very nice <a href="http://code.google.com/p/securityswitch/" target="_blank">new home for SecuritySwitch</a>. I will likely have a dedicated page here on GeekFreeq for SecuritySwitch that refers visitors to the project on Google Code, and/or I will just pipe updates from the project site here via RSS.</p>
<p>Anyway, this is the first stage of a &#8220;grown-up&#8221; SecuritySwitch.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.geekfreeq.com/securityswitch-grows-google-code/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>WebPageSecurity becomes SecuritySwitch</title>
		<link>http://www.geekfreeq.com/webpagesecurity-becomes-securityswitch/</link>
		<comments>http://www.geekfreeq.com/webpagesecurity-becomes-securityswitch/#comments</comments>
		<pubDate>Fri, 29 Jan 2010 23:13:40 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[ASP]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[products]]></category>

		<guid isPermaLink="false">http://www.geekfreeq.com/?p=463</guid>
		<description><![CDATA[Edit: Due to a trademark infringement, this open source project will now be named SecuritySwitch. Feel free to read the comment posted by the holder of the trademark on the name I originally planned to use. It was a polite enough message. I think there may be ground for me to stand on with the [...]]]></description>
			<content:encoded><![CDATA[<div class="edit"><strong>Edit</strong>: Due to a trademark infringement, this open source project will now be named SecuritySwitch. Feel free to read the comment posted by the holder of the trademark on the name I originally planned to use. It was a polite enough message. I think there may be ground for me to stand on with the first name, but I don&#8217;t care to go to court over the name of a project that is free for anyone to download.</div>
<p>After a bit of a struggle supporting my <a href="http://www.codeproject.com/KB/web-security/WebPageSecurity_v2.aspx" target="_blank">WebPageSecurity module</a> on Code Project, I&#8217;ve decided to put some quality effort into the project in the very near future. One of the first things that needed attention was the name.</p>
<h3>What&#8217;s in a Name?</h3>
<p>Could I have named it something more generic all those years ago? Perhaps, but not likely. After a few minutes of running through some of the key nouns and verbs that describe the project&#8217;s purpose, it will now be known as <em>SecuritySwitch</em>.</p>
<h3>Educational Value vs. Quality Functionality</h3>
<p>Another change to the project will be the maintenance of the dual source code languages. Since I originally started the module, a distinct project for C# and VB.NET have been maintained. While this was great for the educational aspect of the article and accompanying code, it is not ideal for a quality &#8220;product&#8221;.</p>
<p>After some consideration, I decided to drop the VB.NET version of the source code in favor of a single project written in C#. An immediate benefit to the community of this decision is faster releases.</p>
<h3>What&#8217;s Next?</h3>
<p>All of this change should be balanced with something to make it all worth while. I intend on stopping development on the 2.x version of the module for .NET 1.1 where it is now. Of course, I&#8217;ll fix any bugs, but no new features will likely be added. Version 3.x for .NET 2.0 will continue until version 4.0. That&#8217;s when I will add some of the new features in the queue and enable full support for ASP.NET MVC as well.</p>
<p>Keep checking back for more progress on this project.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.geekfreeq.com/webpagesecurity-becomes-securityswitch/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>ASP.NET &#8220;Remember Me&#8221; Option with Forms Authentication Not Working?</title>
		<link>http://www.geekfreeq.com/aspnet-remember-me-option-forms-authentication-not-working/</link>
		<comments>http://www.geekfreeq.com/aspnet-remember-me-option-forms-authentication-not-working/#comments</comments>
		<pubDate>Mon, 19 Oct 2009 17:23:48 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[ASP]]></category>
		<category><![CDATA[development]]></category>

		<guid isPermaLink="false">http://www.geekfreeq.com/?p=457</guid>
		<description><![CDATA[So, you&#8217;ve set the timeout value for forms authentication to a fairly large value, yet checking the &#8220;remember me&#8221; check box on the Login control still does not persist your users&#8217; authentication, even after a fairly short period of inactivity.
&#60;system.web&#62;
    ...
    &#60;authentication mode="Forms"&#62;
        &#60;forms timeout="10080"/&#62;
    &#60;/authentication&#62;
    ...
&#60;/system.web&#62;
Don&#8217;t spend hours [...]]]></description>
			<content:encoded><![CDATA[<div class="wp-caption alignleft" style="width: 208px"><img title="ASP.NET Login Control" src="http://farm3.static.flickr.com/2493/4025759133_b6c35381b3_o.png" alt="ASP.NET Login Control" width="198" height="108" /><p class="wp-caption-text">ASP.NET Login Control</p></div>
<p>So, you&#8217;ve set the <em>timeout </em>value for forms authentication to a fairly large value, yet checking the &#8220;remember me&#8221; check box on the Login control still does not persist your users&#8217; authentication, even after a fairly short period of inactivity.</p>
<pre class="xml">&lt;system.web&gt;
    ...
    &lt;authentication mode="Forms"&gt;
        &lt;forms timeout="10080"/&gt;
    &lt;/authentication&gt;
    ...
&lt;/system.web&gt;</pre>
<p>Don&#8217;t spend hours trying to figure out why this, <em>seemingly</em>, basic functionality doesn&#8217;t perform as it should. The solution to this problem is very simple, albeit somewhat obscure.</p>
<p><span id="more-457"></span></p>
<h3>Encryption is the Key</h3>
<p>To make the &#8220;remember me&#8221; check box actually obey your users when they check it, you need to ensure that a static <strong>machine key</strong> is added to your website&#8217;s web.config file. That&#8217;s it! <strong>Really.</strong></p>
<pre class="xml">&lt;system.web&gt;
    ...
    &lt;machineKey
        validationKey="xxxxxxxxx"
        decryptionKey="xxx"
        validation="SHA1" decryption="AES"/&gt;
    ...
&lt;/system.web&gt;</pre>
<h4>Generate Random Keys</h4>
<p>Generate your own keys by using <a href="http://www.developmentnow.com/articles/machinekey_generator.aspx" target="_blank">one of the machineKey generator websites</a> available. After using a generator, copy and paste the <em>machineKey </em>element inside the <em>system.web</em> element of your web.config.</p>
<p>The &#8220;remember me&#8221; option for authentication should start working as expected.</p>
<h3>Why this Works</h3>
<p>When a user authenticates on an ASP.NET website with forms authentication enabled, an authentication ticket is generated for that user. This ticket is then stored inside a cookie in the user&#8217;s browser. The cookie&#8217;s purpose is to allow the forms authentication system to recognize subsequent requests by the same user as valid/authenticated.</p>
<p>Of course, this functionality works without issue even before the solution above. When a user leaves the &#8220;remember me&#8221; box unchecked, a session cookie is stored in their browser. Checking that box, sends a persistent cookie back to the browser instead. This persistent cookie is set to expire based on the timeout value mentioned earlier (i.e. it expires approximately timeout minutes from the current date/time). The persistent cookie is also created without issue. A quick look at your cookies during a test should prove this.</p>
<p>So, if the persistent cookie is getting created properly, why are users being forced to login again after only short periods of inactivity? Well, the authentication ticket is <strong>encrypted </strong>before being sent to the browser as a cookie. This is done to secure the details of the ticket and prevent tampering. However, the ticket must be <strong>decrypted </strong>by the forms authentication system on each request that follows.</p>
<h4>Process Recycling</h4>
<p>When the ASP.NET process recycles, the website&#8217;s validation and decryption keys may be randomly re-generated. In fact, the default behavior is to auto-generated these keys per application. If the keys are changed, <strong>those tickets cannot be decrypted</strong>. When the forms authentication system fails to decrypt a ticket from the user&#8217;s cookie, it sends them along to the login page for validation. No amount of checking the &#8220;remember me&#8221; box will help this situation; specifying your own keys in web.config will.</p>
<h4>Causes of Process Recycling</h4>
<p>There are a number of causes for the ASP.NET process getting recycled. Here just a few.</p>
<ul>
<li>IIS determines certain conditions were met</li>
<li>any change in the bin directory of the website</li>
<li>changes to the physical path of the virtual application or website</li>
<li>a sub-directory of the website is deleted</li>
<li>changes to Global.asax, web.config, or machine.config</li>
<li>policy changes</li>
<li>the count threshold of re-compilations is exceeded (<span style="font-family: Tahoma;"><em>numRecompilesBeforeAppRestart </em>on the <em>compilation </em>element)</span></li>
</ul>
<p>If your website is hosted on a shared server, odds are the process for your application will get recycled more often than on a dedicated server. Hosts set the thresholds for recycling pretty low for shared hosing servers to account for poor programming.</p>
<h3>Final Recommendations</h3>
<p>I almost always recommend that one of the first things a developer does with a new ASP.NET website is generate a random <em>machineKey </em>and add to the web.config. This will likely save you many headaches in the future. By the way, this step is absolutely <strong>necessary </strong>for Web farms/gardens.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.geekfreeq.com/aspnet-remember-me-option-forms-authentication-not-working/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Web Page Security &#8211; New Version</title>
		<link>http://www.geekfreeq.com/web-page-security-new-version/</link>
		<comments>http://www.geekfreeq.com/web-page-security-new-version/#comments</comments>
		<pubDate>Wed, 18 Jun 2008 01:10:52 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[ASP]]></category>
		<category><![CDATA[development]]></category>

		<guid isPermaLink="false">http://blog.ventaur.com/?p=18</guid>
		<description><![CDATA[Some of you know me as a friend and code poet. Some know me as the crazy guy trying to get donations for his dad to get him a Wii. Some just know me as &#8220;that guy who wrote the web page security module for ASP.NET&#8220;. Others don&#8217;t know me at all; how did you [...]]]></description>
			<content:encoded><![CDATA[<p>Some of you know me as a friend and code poet. Some know me as the crazy guy trying to get <a href="http://mydadneedsawii.com/" target="_blank">donations for his dad to get him a Wii</a>. Some just know me as &#8220;that guy who wrote the <a href="http://www.codeproject.com/KB/web-security/WebPageSecurity_v2.aspx" target="_blank">web page security module for ASP.NET</a>&#8220;. Others don&#8217;t know me at all; how did you end up here by the way?</p>
<p>Well, I am finally setting out to write the next version of the web page security module. I have quite a list of features requested by its many users. The fact is, I&#8217;ve been wanting to write the new version for nearly 2 years now. I have an idea that will make this thing so much more usable that I&#8217;m beginning to doubt its efficiency. So, before I begin putting too much effort into it, I will be running some tests, like a responsible programmer.</p>
<p>I suspect the new method I have in mind will be a bit more CPU-intensive. The problem is, I have no idea <strong>how much more</strong> CPU I can expect the algorithm to use. I&#8217;ll see how my tests go, beginning tonight. If the metrics show an acceptable increase in CPU (I&#8217;ll have to decide what is acceptable), I will begin coding the new version this week.</p>
<p>Stay tuned.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.geekfreeq.com/web-page-security-new-version/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
