<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Alik Levin's : Authentication</title><link>http://blogs.msdn.com/alikl/archive/tags/Authentication/default.aspx</link><description>Tags: Authentication</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Security Code Review – String Search Patterns For Authentication Vulnerabilities</title><link>http://blogs.msdn.com/alikl/archive/2008/07/21/security-code-review-string-search-patterns-for-authentication-vulnerabilities.aspx</link><pubDate>Mon, 21 Jul 2008 15:39:59 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8761384</guid><dc:creator>alikl</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/alikl/comments/8761384.aspx</comments><wfw:commentRss>http://blogs.msdn.com/alikl/commentrss.aspx?PostID=8761384</wfw:commentRss><wfw:comment>http://blogs.msdn.com/alikl/rsscomments.aspx?PostID=8761384</wfw:comment><description>&lt;p&gt;&lt;/p&gt;  &lt;p&gt;This post contains string search patterns that can help identifying authentication vulnerabilities during &lt;a href="http://msdn.microsoft.com/en-us/library/ms998375.aspx" target="_blank"&gt;security code inspection for your ASP.NET application&lt;/a&gt;. Most common vulnerability is about insecurely manipulating credentials in the code. The question we want to actually ask is:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;strong&gt;Are you passing clear text credentials?&lt;/strong&gt; &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;The associated &lt;strong&gt;&lt;em&gt;threat&lt;/em&gt;&lt;/strong&gt; is identity theft or identity spoof that can be achieved by disclosing the credentials or/and tampering it.&lt;/p&gt;  &lt;h3&gt;What to Search for and Why&lt;/h3&gt;  &lt;p&gt;Credentials are usually required when accessing a down stream resource – database, web service, active directory, MQSeries, or any other. This information can be easily obtained from the architecture document. Following are possible searches that can lead you to the hotspots to nail potential authentication vulnerabilities:&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;DB Connections&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;findstr /S /I &amp;quot;.Open( &amp;quot; *.cs&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Web Services&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;findstr /S /I &amp;quot;.Credentials =&amp;quot; *.cs&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;LogonUser API – usually used for impersonation&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;findstr /S /I &amp;quot;LogonUser&amp;quot; *.cs&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;IIdentity usage&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;This one is my favorite. This search pattern is actually trying to spot the anti-pattern of identifying end user. The assumption here is that when there is no matches for that search then the solution either does not identifies the requests or uses home grown solution which might be potential vulnerability in both cases.&lt;/p&gt;  &lt;p&gt;findstr /S /I “.Identity&amp;quot; *.cs&lt;/p&gt;  &lt;p&gt;Other than above searches it is good idea to review the web.config file for potential clear text credentials.&lt;/p&gt;  &lt;p&gt;Got more suggestions for search patters to identify potential authentication vulnerabilities? - Please, share!&lt;/p&gt;  &lt;h3&gt;Related posts&lt;/h3&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://blogs.msdn.com/alikl/archive/2008/07/11/security-code-review-string-search-patterns-for-finding-input-validation-vulnerabilities.aspx" target="_blank"&gt;Security Code Review – String Search Patterns For Finding Input Validation Vulnerabilities&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://blogs.msdn.com/alikl/archive/2007/12/08/avoid-manipulating-passwords-in-memory-it-is-easy-to-reveal.aspx" target="_blank"&gt;Avoid Manipulating Passwords In Memory - It Is Easy To Reveal&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://blogs.msdn.com/alikl/archive/2007/09/05/authentication-and-identity-flow-when-asp-page-consumes-asp-net-web-service.aspx" target="_blank"&gt;Authentication And Identity Flow When ASP Page Consumes ASP.NET Web Service&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://blogs.msdn.com/alikl/archive/2007/05/31/security-educational-workshop-authentication-explained.aspx" target="_blank"&gt;Security Educational Workshop - Authentication Explained&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://blogs.msdn.com/alikl/archive/2007/05/30/soa-strong-authentication-standard-authorization-cool-solution.aspx" target="_blank"&gt;SOA, Strong Authentication, Standard Authorization - Cool Solution&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://blogs.msdn.com/alikl/archive/2007/04/11/authentication-hub.aspx"&gt;Authentication Hub&lt;/a&gt; &lt;/li&gt; &lt;/ul&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8761384" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/alikl/archive/tags/Test+Phase/default.aspx">Test Phase</category><category domain="http://blogs.msdn.com/alikl/archive/tags/Security/default.aspx">Security</category><category domain="http://blogs.msdn.com/alikl/archive/tags/Authentication/default.aspx">Authentication</category></item><item><title>Avoid Manipulating Passwords In Memory - It Is Easy To Reveal</title><link>http://blogs.msdn.com/alikl/archive/2007/12/08/avoid-manipulating-passwords-in-memory-it-is-easy-to-reveal.aspx</link><pubDate>Sat, 08 Dec 2007 08:55:40 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:6701111</guid><dc:creator>alikl</dc:creator><slash:comments>3</slash:comments><comments>http://blogs.msdn.com/alikl/comments/6701111.aspx</comments><wfw:commentRss>http://blogs.msdn.com/alikl/commentrss.aspx?PostID=6701111</wfw:commentRss><wfw:comment>http://blogs.msdn.com/alikl/rsscomments.aspx?PostID=6701111</wfw:comment><description>&lt;p&gt;Revealing clear text passwords in memory seems to be a trivial task. This post describes how to reveal clear text passwords and what countermeasures to apply.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Summary of steps:&lt;/strong&gt;&lt;/p&gt; &lt;ul&gt; &lt;li&gt;&lt;strong&gt;Install WinDbg&lt;/strong&gt;&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Attach to process or open dump file&lt;/strong&gt;&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Load SOS .Net extensions for WinDbg&lt;/strong&gt;&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Enumerate threads&lt;/strong&gt;&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Enumerate objects in thread&lt;/strong&gt;&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Dump object's values&lt;/strong&gt;&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Countermeasures and guidelines&lt;/strong&gt;&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;&lt;strong&gt;Install WinDbg&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;Download and install WinDbg as described in &lt;a href="http://blogs.msdn.com/johan/archive/2007/01/11/how-to-install-windbg-and-get-your-first-memory-dump.aspx"&gt;How to install Windbg and get your first memory dump&lt;/a&gt;. &lt;/p&gt; &lt;p&gt;&lt;strong&gt;Attach to process or open dump file&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;WinDbg can analyze both running processes and memory dumps which conveniently can be taken offsite for further investigation. I've created simple console application that accepts user name and password pair as its parameters and stores in local variables in memory:&lt;/p&gt; &lt;p&gt;&lt;font color="#0000ff"&gt;static void&lt;/font&gt; Main(&lt;font color="#0000ff"&gt;string&lt;/font&gt;[] args)&lt;br&gt;{&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color="#0000ff"&gt;string&lt;/font&gt; userName = Console.ReadLine();&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color="#0000ff"&gt;string&lt;/font&gt; password = Console.ReadLine();  &lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Console.ReadLine();&lt;br&gt;} &lt;p&gt;Compile and run the application. I called it SecretsInMemory. This is how it looks when running: &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/AvoidManipulatingPasswordsInMemoryItisEa_1032B/image_12.png"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="89" alt="image" src="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/AvoidManipulatingPasswordsInMemoryItisEa_1032B/image_thumb_5.png" width="284" border="0"&gt;&lt;/a&gt;  &lt;p&gt;Attach WinDbg to the running application by opening File-&amp;gt;Attach to a Process: &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/AvoidManipulatingPasswordsInMemoryItisEa_1032B/image_2.png"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="89" alt="image" src="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/AvoidManipulatingPasswordsInMemoryItisEa_1032B/image_thumb.png" width="390" border="0"&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp; &lt;p&gt;and press Ok. &lt;p&gt;Alternatively, we can create dump file - for detailed how-to refer to &lt;a href="http://blogs.msdn.com/johan/archive/2007/01/11/how-to-install-windbg-and-get-your-first-memory-dump.aspx" target="_blank"&gt;How to install Windbg and get your first memory dump&lt;/a&gt;. &lt;p&gt;To Investigate resulting dump file in WinDbg open File-&amp;gt;Open Crash Dump &lt;p&gt;&lt;strong&gt;Load SOS .Net extensions for WinDbg&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;To analyze .Net assemblies we need to load .Net extensions by typing .load sos and hitting Enter:&lt;/p&gt; &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/AvoidManipulatingPasswordsInMemoryItisEa_1032B/image_4.png"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="96" alt="image" src="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/AvoidManipulatingPasswordsInMemoryItisEa_1032B/image_thumb_1.png" width="229" border="0"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;&lt;strong&gt;Enumerate threads&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;Run !threads command to enlist available threads:&lt;/p&gt; &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/AvoidManipulatingPasswordsInMemoryItisEa_1032B/image_6.png"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="109" alt="image" src="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/AvoidManipulatingPasswordsInMemoryItisEa_1032B/image_thumb_2.png" width="350" border="0"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;and then choose specific thread - use left most column for thread identification as follows ~[thread number goes here]s:&lt;/p&gt; &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/AvoidManipulatingPasswordsInMemoryItisEa_1032B/image_8.png"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="97" alt="image" src="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/AvoidManipulatingPasswordsInMemoryItisEa_1032B/image_thumb_3.png" width="330" border="0"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;&lt;strong&gt;Enumerate objects in thread&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;Use !dso command to dump all objects in the thread:&lt;/p&gt; &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/AvoidManipulatingPasswordsInMemoryItisEa_1032B/image_10.png"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="143" alt="image" src="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/AvoidManipulatingPasswordsInMemoryItisEa_1032B/image_thumb_4.png" width="412" border="0"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;&lt;strong&gt;Dump object's values&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;Use !do &amp;lt;object address&amp;gt; to dump specific object's values. Object address is a second column in the list generated by !dso command, the column named "Object" - just copy and paste it:&lt;/p&gt; &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/AvoidManipulatingPasswordsInMemoryItisEa_1032B/image_14.png"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="271" alt="image" src="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/AvoidManipulatingPasswordsInMemoryItisEa_1032B/image_thumb_6.png" width="328" border="0"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;The password is revealed either by attaching to the process or analyzing a crash file that was taken offsite.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Countermeasures and guidelines&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;As rule of thumb avoid using custom built identification and authentication mechanisms and leverage those that the infrastructure offers - preferably Windows Integrated authentication. In case where all options exhausted and there is no other way but accept end user credentials, refer to the following article - &lt;a href="http://msdn2.microsoft.com/en-us/library/aa302353.aspx" target="_blank"&gt;Using Credential Management in Windows XP and Windows Server 2003&lt;/a&gt;. Techniques described in the article allow to leverage built in mechanism of accepting credentials from end user in more secure manner. It also keeps common familiar look and feel across custom application and built in Windows mechanisms leaving less room for end user confusion.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;My related posts:&lt;/strong&gt;&lt;/p&gt; &lt;ul&gt; &lt;li&gt;&lt;a href="http://blogs.msdn.com/alikl/archive/2007/04/11/authentication-hub.aspx"&gt;Authentication Hub&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;&lt;strong&gt;Other resources:&lt;/strong&gt;&lt;/p&gt; &lt;ul&gt; &lt;li&gt;This post is inspired by &lt;a href="http://blogs.msdn.com/johan/archive/2007/11/13/getting-started-with-windbg-part-i.aspx" target="_blank"&gt;Getting started with windbg - part I&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="http://blogs.msdn.com/johan/archive/2007/11/13/getting-started-with-windbg-part-ii.aspx" target="_blank"&gt;Getting started with windbg - part II&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="http://kentb.blogspot.com/2007/11/windbg-sos-cheat-sheet.html" target="_blank"&gt;WinDbg + SOS Cheat Sheet&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="http://www.securityguidanceshare.com/wiki/ASP.NET_2.0_Security_Questions_and_Answers_-_Sensitive_Data" target="_blank"&gt;ASP.NET 2.0 Security Questions and Answers - Sensitive Data&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="http://www.securityguidanceshare.com/wiki/ASP.NET_2.0_Security_Questions_and_Answers_-_Authentication" target="_blank"&gt;ASP.NET 2.0 Security Questions and Answers - Authentication&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=6701111" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/alikl/archive/tags/Test+Phase/default.aspx">Test Phase</category><category domain="http://blogs.msdn.com/alikl/archive/tags/Security/default.aspx">Security</category><category domain="http://blogs.msdn.com/alikl/archive/tags/Sensitive+Data/default.aspx">Sensitive Data</category><category domain="http://blogs.msdn.com/alikl/archive/tags/Authentication/default.aspx">Authentication</category><category domain="http://blogs.msdn.com/alikl/archive/tags/Planning+Phase/default.aspx">Planning Phase</category></item><item><title>Authentication And Identity Flow When ASP Page Consumes ASP.NET Web Service</title><link>http://blogs.msdn.com/alikl/archive/2007/09/05/authentication-and-identity-flow-when-asp-page-consumes-asp-net-web-service.aspx</link><pubDate>Wed, 05 Sep 2007 19:04:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4765827</guid><dc:creator>alikl</dc:creator><slash:comments>4</slash:comments><comments>http://blogs.msdn.com/alikl/comments/4765827.aspx</comments><wfw:commentRss>http://blogs.msdn.com/alikl/commentrss.aspx?PostID=4765827</wfw:commentRss><wfw:comment>http://blogs.msdn.com/alikl/rsscomments.aspx?PostID=4765827</wfw:comment><description>&lt;P&gt;"Classic" ASP has&amp;nbsp;application isolation that is different from ASP.NET. Here is one of the&amp;nbsp;real world scenarios&amp;nbsp;where it might matter.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/IdentityFlowWhenASPPageCon.NETWebService_CB38/image.png" atomicselection="true" mce_href="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/IdentityFlowWhenASPPageCon.NETWebService_CB38/image.png"&gt;&lt;IMG style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height=178 alt=image src="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/IdentityFlowWhenASPPageCon.NETWebService_CB38/image_thumb.png" width=408 border=0 mce_src="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/IdentityFlowWhenASPPageCon.NETWebService_CB38/image_thumb.png"&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;There is a legacy web application written in ASP and hosted on Win2K3 box (IIS 6.0). It is of course in the process of migration to ASP.NET. As part of the migration process there were several ASP.NET web services factored out of the classic ASP app. These web services are hosted on another Win2K3 box and require windows authentication. Classic ASP must consume these web services while satisfying the requirement of windows authentication. ASP page consumes the web service via .Net COM interop invoking .Net component:&lt;/P&gt;
&lt;P&gt;The question here is what is this account that ASP page authenticates to ASP.NET web service&amp;nbsp;on another machine?&lt;/P&gt;
&lt;P&gt;It is common mistake assuming that the account is the application pool's one. ASP does not run in the context of the application pool. In case of anonymous access It runs in the context of what defined for anonymous user:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/IdentityFlowWhenASPPageCon.NETWebService_CB38/image_1.png" atomicselection="true" mce_href="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/IdentityFlowWhenASPPageCon.NETWebService_CB38/image_1.png"&gt;&lt;IMG style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height=333 alt=image src="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/IdentityFlowWhenASPPageCon.NETWebService_CB38/image_thumb_1.png" width=279 border=0 mce_src="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/IdentityFlowWhenASPPageCon.NETWebService_CB38/image_thumb_1.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;Said that, in order to let ASP page authenticate to ASP.NET web service based on windows authentication one needs to define domain account in above property page for virtual directory where ASP resides. This is the account that will hit the ASP.NET web service.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=4765827" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/alikl/archive/tags/Security/default.aspx">Security</category><category domain="http://blogs.msdn.com/alikl/archive/tags/Deployment+Phase/default.aspx">Deployment Phase</category><category domain="http://blogs.msdn.com/alikl/archive/tags/Authentication/default.aspx">Authentication</category><category domain="http://blogs.msdn.com/alikl/archive/tags/Planning+Phase/default.aspx">Planning Phase</category></item><item><title>Client Certificates Authentication - Dirty Trick To Disable CRL Check. For Demos Only!</title><link>http://blogs.msdn.com/alikl/archive/2007/08/14/client-certificates-authentication-dirty-trick-to-disable-crl-check-for-demos-only.aspx</link><pubDate>Tue, 14 Aug 2007 18:12:55 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4384599</guid><dc:creator>alikl</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/alikl/comments/4384599.aspx</comments><wfw:commentRss>http://blogs.msdn.com/alikl/commentrss.aspx?PostID=4384599</wfw:commentRss><wfw:comment>http://blogs.msdn.com/alikl/rsscomments.aspx?PostID=4384599</wfw:comment><description>&lt;p&gt;My &lt;a href="http://blogs.msdn.com/alikl/archive/2007/05/29/how-i-setup-lab-domain-using-vpc-2007.aspx"&gt;lab domain&lt;/a&gt;&amp;nbsp;has MS CA installed in it so I am able to issue certificates to the left and to the right. Recently I spent some time to understand why client certificates authentication does not work. More precisely the certificates dialog box was offering no client certificate to chose,&amp;nbsp;as depicted below:&lt;/p&gt; &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/ClientCertificatesAuthenticationDirtyTri_C6B3/image.png" atomicselection="true"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; margin: 20px; border-right-width: 0px" height="262" alt="image" src="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/ClientCertificatesAuthenticationDirtyTri_C6B3/image_thumb.png" width="303" align="left" border="0"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;I first thought it is something on the client machine but after some investigation it&amp;nbsp;turned out that it is IIS' part. IIS was unable to verify CRL. I was not in the mood of deploying CRL's so I decided to look into how to disable this feature. Here it is:&lt;/p&gt; &lt;p&gt;&lt;a href="http://forums.iis.net/t/1100044.aspx" target="_blank"&gt;http://forums.iis.net/t/1100044.aspx&lt;/a&gt;  &lt;p&gt;&amp;nbsp;&amp;nbsp; Set oWeb = GetObject("IIS://localhost/W3SVC")&lt;br&gt;&amp;nbsp;&amp;nbsp; oWeb.CertCheckMode = 1&lt;br&gt;&amp;nbsp;&amp;nbsp; oWeb.SetInfo&lt;br&gt;&amp;nbsp;&amp;nbsp; Set oWeb = Nothing  &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;Open notepad paste the code above and save with vbs extension. Run it by double clicking it. Your IIS now do not give a damn about CRL.  &lt;p&gt;&lt;font color="#ff0000"&gt;&lt;strong&gt;NOT&lt;/strong&gt; THE BEST OPTION FOR PRODUCTION ENVIRONMENT.&lt;/font&gt;  &lt;p&gt;Good enough for demos.  &lt;p&gt;Enjoy.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=4384599" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/alikl/archive/tags/Security/default.aspx">Security</category><category domain="http://blogs.msdn.com/alikl/archive/tags/Deployment+Phase/default.aspx">Deployment Phase</category><category domain="http://blogs.msdn.com/alikl/archive/tags/Authentication/default.aspx">Authentication</category></item><item><title>Web Services Over SSL - Is It Really That Slow Like They Say?</title><link>http://blogs.msdn.com/alikl/archive/2007/08/01/web-services-over-ssl-is-it-really-that-slow-like-they-say.aspx</link><pubDate>Wed, 01 Aug 2007 17:35:18 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4169341</guid><dc:creator>alikl</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/alikl/comments/4169341.aspx</comments><wfw:commentRss>http://blogs.msdn.com/alikl/commentrss.aspx?PostID=4169341</wfw:commentRss><wfw:comment>http://blogs.msdn.com/alikl/rsscomments.aspx?PostID=4169341</wfw:comment><description>&lt;p&gt;My answer is &lt;strong&gt;"no"&lt;/strong&gt;.  &lt;p&gt;I am working on&amp;nbsp;solution where there is no Windows Active Directory Domain so we cannot utilize our &lt;a href="http://blogs.msdn.com/alikl/archive/2007/07/04/t-shooting-kerberos.aspx" target="_blank"&gt;beloved Kerberos&lt;/a&gt; and &lt;a href="http://blogs.msdn.com/alikl/archive/2007/04/11/authentication-hub.aspx" target="_blank"&gt;Windows Integrated Authentication&lt;/a&gt; saving big on configuration and management while taking advantage of increased security it offers.  &lt;p&gt;Other technique that we thought that could give us a lots of benefits in terms of strong authentication, transport level protection, and interoperability was using Client Certificates.  &lt;p&gt;Here is the scenario.  &lt;p&gt;ASP.NET web page calls on ASP.NET Web Service on separate machine. Think of scenario where Internet facing ASP.NET web site calls on Web Service deployed in internal zone:  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/SSLSessionCachingThinkOfOLEDBConnectionP_15058/image.png" atomicselection="true"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="311" alt="image" src="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/SSLSessionCachingThinkOfOLEDBConnectionP_15058/image_thumb.png" width="524" border="0"&gt;&lt;/a&gt;  &lt;p&gt;The other scenario would be so called B2B scenario where intranet facing ASP.NET web site calls on Web Service over the Internet:  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/SSLSessionCachingThinkOfOLEDBConnectionP_15058/image_1.png" atomicselection="true"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="307" alt="image" src="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/SSLSessionCachingThinkOfOLEDBConnectionP_15058/image_thumb_1.png" width="522" border="0"&gt;&lt;/a&gt;  &lt;p&gt;&amp;nbsp;  &lt;p&gt;Another scenario would be calling Java Web Service.  &lt;p&gt;Not that friendly for Windows Integrated Authentication.  &lt;p&gt;The question we asked ourselves was - will it be fast enough? The following post&amp;nbsp;by my colleague Eddie -&amp;nbsp;&lt;a href="http://blogs.msdn.com/ace_team/archive/2006/07/03/655536.aspx" target="_blank"&gt;Fast and Secured: Performance Impact of SSL&lt;/a&gt;&amp;nbsp;gave us a lots of hope. But it discussed SSL between Web Browser and the Web Server. Web Browser (IE) has nice feature of caching SSL state so&amp;nbsp;what depicted below&amp;nbsp;happens less thus improving performance (think of OLEDB Connection pooling and you got the idea):  &lt;p&gt;&lt;a href="http://technet2.microsoft.com/WindowsServer/en/library/2a9816ef-70bf-4bd7-a043-9ba721595e271033.mspx?mfr=true " target="_blank" atomicselection="true"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="320" alt="image" src="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/SSLSessionCachingThinkOfOLEDBConnectionP_15058/image_4.png" width="340" border="0"&gt;&lt;/a&gt;  &lt;p&gt;Well,&amp;nbsp;our beloved Internet Explorer does a great job, what about .Net?  &lt;p&gt;After some research we happily discovered the following:  &lt;p&gt;&lt;a href="http://msdn2.microsoft.com/en-us/library/system.net.httpwebrequest.aspx"&gt;http://msdn2.microsoft.com/en-us/library/system.net.httpwebrequest.aspx&lt;/a&gt;  &lt;p&gt;&lt;b&gt;&lt;a href="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/SSLSessionCachingThinkOfOLEDBConnectionP_15058/clip_image001_2.gif" atomicselection="true"&gt;&lt;img height="10" alt="clip_image001" src="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/SSLSessionCachingThinkOfOLEDBConnectionP_15058/clip_image001_thumb.gif" width="10" border="0"&gt;&lt;/a&gt;Note: &lt;/b&gt; &lt;blockquote&gt; &lt;p&gt;The Framework caches SSL sessions as they are created and attempts to reuse a cached session for a new request, if possible. When attempting to reuse an SSL session, the Framework uses the first element of &lt;a href="http://msdn2.microsoft.com/en-us/library/system.net.httpwebrequest.clientcertificates.aspx"&gt;ClientCertificates&lt;/a&gt; (if there is one), or tries to reuse an anonymous sessions if &lt;b&gt;ClientCertificates&lt;/b&gt; is empty.&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;That was encouraging and&amp;nbsp;I decided&amp;nbsp;I need to see it my eyes, so I set sample code and deployed to my &lt;a href="http://blogs.msdn.com/alikl/archive/2007/05/29/how-i-setup-lab-domain-using-vpc-2007.aspx" target="_blank"&gt;lab domain&lt;/a&gt;. I also have used diagnostics technique described in &lt;a href="http://blogs.msdn.com/alikl/archive/2007/07/16/use-sysinternals-debugview-to-diagnose-the-application.aspx"&gt;Use Sysinternals DebugView To Diagnose The Application&lt;/a&gt;. When I fired up DebugView this is what&amp;nbsp;I saw:&lt;/p&gt; &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/SSLSessionCachingThinkOfOLEDBConnectionP_15058/image_5.png" atomicselection="true"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="206" alt="image" src="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/SSLSessionCachingThinkOfOLEDBConnectionP_15058/image_thumb_4.png" width="485" border="0"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;Each pair of records reflects on single Web page access telling me how many milliseconds was spent on each action to complete during the page processing.&lt;/p&gt; &lt;p&gt;Notice first two records - one for Web Service proxy creating and adding certificate to it:&lt;/p&gt; &lt;p&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: green"&gt;//&lt;a href="http://blogs.msdn.com/jmeier/archive/2006/12/05/timing-managed-code-in-net-2-0.aspx"&gt;START STOPWATCH&lt;/a&gt;&lt;?xml:namespace prefix = o /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: #2b91af"&gt;Stopwatch&lt;/span&gt; stopwatch = &lt;span style="color: blue"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af"&gt;Stopwatch&lt;/span&gt;();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;stopwatch.Start();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: green"&gt;//GET HOLD ON CERT&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: #2b91af"&gt;X509Store&lt;/span&gt; store = &lt;span style="color: blue"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af"&gt;X509Store&lt;/span&gt;(&lt;span style="color: #2b91af"&gt;StoreName&lt;/span&gt;.My, &lt;span style="color: #2b91af"&gt;StoreLocation&lt;/span&gt;.CurrentUser);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;store.Open(&lt;span style="color: #2b91af"&gt;OpenFlags&lt;/span&gt;.ReadOnly);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: #2b91af"&gt;X509Certificate2Collection&lt;/span&gt; certs = store.Certificates.Find(&lt;span style="color: #2b91af"&gt;X509FindType&lt;/span&gt;.FindBySubjectName, &lt;span style="color: #a31515"&gt;"w3w1"&lt;/span&gt;, &lt;span style="color: blue"&gt;true&lt;/span&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: #2b91af"&gt;X509Certificate2&lt;/span&gt; cert = certs[0];&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: green"&gt;//CREATE WEB SERVICE PROXY&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: #2b91af"&gt;Service1&lt;/span&gt; proxy = &lt;span style="color: blue"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af"&gt;Service1&lt;/span&gt;();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;proxy.ClientCertificates.Add(cert);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: #2b91af"&gt;Debug&lt;/span&gt;.WriteLine(&lt;span style="color: #a31515"&gt;"Web Service Proxy Created: "&lt;/span&gt; + stopwatch.ElapsedMilliseconds.ToString());&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New'; mso-no-proof: yes"&gt;&lt;/span&gt;&amp;nbsp;&lt;/p&gt; &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New'; mso-no-proof: yes"&gt;&lt;font face="Trebuchet MS"&gt;and the second one is actual Web Service call:&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: green"&gt;// CALL ON WEB SERVICE&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue"&gt;string&lt;/span&gt; result = proxy.HelloWorld(cert.Subject);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: #2b91af"&gt;Debug&lt;/span&gt;.WriteLine(&lt;span style="color: #a31515"&gt;"Web Service Call Completed: "&lt;/span&gt; + stopwatch.ElapsedMilliseconds.ToString());&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal"&gt;&lt;span style="font-size: 7pt; line-height: 115%"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal"&gt;&lt;span style="font-size: 10pt; line-height: 115%"&gt;&lt;o:p&gt;Notice that all subsequent calls are pretty fast. It should prove that SSL session caching is in place also with .Net as promised. Cool.&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal"&gt;&lt;span style="font-size: 10pt; line-height: 115%"&gt;&lt;o:p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/o:p&gt;&lt;/span&gt;&amp;nbsp;&lt;/p&gt; &lt;p class="MsoNormal"&gt;&lt;span style="font-size: 10pt; line-height: 115%"&gt;&lt;o:p&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal"&gt;&lt;span style="font-size: 10pt; line-height: 115%"&gt;&lt;o:p&gt;While these numbers have been taken on lab environment for super simple scenario it can serve as talking point when considering &lt;a href="http://blogs.msdn.com/alikl/archive/2007/07/30/man-in-the-middle-attack-protecting-http-traffic-with-ssl-might-be-not-enough-consider-protecting-sql-traffic-too.aspx"&gt;applying SSL to protect your sensitive data&lt;/a&gt; to its way to downstream servers. Also client certificate authentication should be considered as a strongest authentication available today when Kerberos is not available.&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=4169341" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/alikl/archive/tags/Security/default.aspx">Security</category><category domain="http://blogs.msdn.com/alikl/archive/tags/Development+Phase/default.aspx">Development Phase</category><category domain="http://blogs.msdn.com/alikl/archive/tags/Implementation/default.aspx">Implementation</category><category domain="http://blogs.msdn.com/alikl/archive/tags/Deployment+Phase/default.aspx">Deployment Phase</category><category domain="http://blogs.msdn.com/alikl/archive/tags/Performance/default.aspx">Performance</category><category domain="http://blogs.msdn.com/alikl/archive/tags/Authentication/default.aspx">Authentication</category><category domain="http://blogs.msdn.com/alikl/archive/tags/Planning+Phase/default.aspx">Planning Phase</category></item><item><title>T-Shooting Kerberos</title><link>http://blogs.msdn.com/alikl/archive/2007/07/04/t-shooting-kerberos.aspx</link><pubDate>Thu, 05 Jul 2007 00:16:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3693997</guid><dc:creator>alikl</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/alikl/comments/3693997.aspx</comments><wfw:commentRss>http://blogs.msdn.com/alikl/commentrss.aspx?PostID=3693997</wfw:commentRss><wfw:comment>http://blogs.msdn.com/alikl/rsscomments.aspx?PostID=3693997</wfw:comment><description>&lt;P&gt;I was delivering&amp;nbsp; "Authentication Explained" session for Security User Group.&lt;/P&gt;
&lt;P&gt;First off&amp;nbsp; - thanks for attending the session!&lt;/P&gt;
&lt;P&gt;The session was based on &lt;A href="http://blogs.msdn.com/alikl/archive/2007/05/31/security-educational-workshop-authentication-explained.aspx" target=_blank mce_href="http://blogs.msdn.com/alikl/archive/2007/05/31/security-educational-workshop-authentication-explained.aspx"&gt;"Authentication Explained" workshop&lt;/A&gt;. During the session I&amp;nbsp;was demoing the following topics:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;A href="http://blogs.msdn.com/alikl/archive/2007/04/06/identity-flow-through-physical-tiers-impersonation.aspx" mce_href="http://blogs.msdn.com/alikl/archive/2007/04/06/identity-flow-through-physical-tiers-impersonation.aspx"&gt;Identity Flow Through Physical Tiers - Impersonation&lt;/A&gt; 
&lt;LI&gt;&lt;A href="http://blogs.msdn.com/alikl/archive/2007/04/08/identity-flow-through-physical-tiers-delegation.aspx" mce_href="http://blogs.msdn.com/alikl/archive/2007/04/08/identity-flow-through-physical-tiers-delegation.aspx"&gt;Identity Flow Through Physical Tiers - Delegation&lt;/A&gt; 
&lt;LI&gt;&lt;A href="http://blogs.msdn.com/alikl/archive/2007/04/10/identity-flow-through-physical-tiers-protocol-transition.aspx" mce_href="http://blogs.msdn.com/alikl/archive/2007/04/10/identity-flow-through-physical-tiers-protocol-transition.aspx"&gt;Identity Flow Through Physical Tiers - Protocol Transition&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://blogs.msdn.com/alikl/archive/2007/05/30/soa-strong-authentication-standard-authorization-cool-solution.aspx" mce_href="http://blogs.msdn.com/alikl/archive/2007/05/30/soa-strong-authentication-standard-authorization-cool-solution.aspx"&gt;SOA, Strong Authentication, Standard Authorization - Cool Solution&lt;/A&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;During the preparation for the session I struggled a bit with our friend Kerberos and I stumbled on very nice resource on technet:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;A href="http://www.microsoft.com/technet/prodtechnol/windowsserver2003/technologies/security/tkerbdel.mspx" target=_blank mce_href="http://www.microsoft.com/technet/prodtechnol/windowsserver2003/technologies/security/tkerbdel.mspx"&gt;Troubleshooting Kerberos Delegation&lt;/A&gt;&amp;nbsp;(&lt;A href="http://download.microsoft.com/download/1/e/e/1ee86ce4-8234-4aa1-94f4-a37039837729/Troubleshooting_Kerberos_Delegation.DOC" mce_href="http://download.microsoft.com/download/1/e/e/1ee86ce4-8234-4aa1-94f4-a37039837729/Troubleshooting_Kerberos_Delegation.DOC"&gt;&lt;IMG height=10 alt=Download src="http://www.microsoft.com/library/gallery/templates/MNP2.Common/images/icon_Word.gif" width=10 vspace=2 border=0 mce_src="http://www.microsoft.com/library/gallery/templates/MNP2.Common/images/icon_Word.gif"&gt;&lt;/A&gt;&amp;nbsp;&lt;A href="http://download.microsoft.com/download/1/e/e/1ee86ce4-8234-4aa1-94f4-a37039837729/Troubleshooting_Kerberos_Delegation.DOC" mce_href="http://download.microsoft.com/download/1/e/e/1ee86ce4-8234-4aa1-94f4-a37039837729/Troubleshooting_Kerberos_Delegation.DOC"&gt;Kerberos_Delegation.doc&lt;/A&gt;)&lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://www.microsoft.com/technet/prodtechnol/windowsserver2003/technologies/security/tkerberr.mspx" target=_blank mce_href="http://www.microsoft.com/technet/prodtechnol/windowsserver2003/technologies/security/tkerberr.mspx"&gt;Troubleshooting Kerberos Errors&lt;/A&gt;&amp;nbsp;(&lt;A href="http://download.microsoft.com/download/5/9/c/59c349f5-f0c8-4b9e-9f70-dbc5f2a8c330/Troubleshooting_Kerberos_Errors.DOC" mce_href="http://download.microsoft.com/download/5/9/c/59c349f5-f0c8-4b9e-9f70-dbc5f2a8c330/Troubleshooting_Kerberos_Errors.DOC"&gt;&lt;IMG height=10 alt=Download src="http://www.microsoft.com/library/gallery/templates/MNP2.Common/images/icon_Word.gif" width=10 vspace=2 border=0 mce_src="http://www.microsoft.com/library/gallery/templates/MNP2.Common/images/icon_Word.gif"&gt;&lt;/A&gt;&amp;nbsp;&lt;A href="http://download.microsoft.com/download/5/9/c/59c349f5-f0c8-4b9e-9f70-dbc5f2a8c330/Troubleshooting_Kerberos_Errors.DOC" mce_href="http://download.microsoft.com/download/5/9/c/59c349f5-f0c8-4b9e-9f70-dbc5f2a8c330/Troubleshooting_Kerberos_Errors.DOC"&gt;Kerberos_Errors.doc&lt;/A&gt;)&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;The articles are very comprehensive and detailed - very handy.&lt;/P&gt;
&lt;P&gt;Happy Kerberos t-shooting (troubleshooting)&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Enjoy&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=3693997" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/alikl/archive/tags/Test+Phase/default.aspx">Test Phase</category><category domain="http://blogs.msdn.com/alikl/archive/tags/Security/default.aspx">Security</category><category domain="http://blogs.msdn.com/alikl/archive/tags/Implementation/default.aspx">Implementation</category><category domain="http://blogs.msdn.com/alikl/archive/tags/Deployment+Phase/default.aspx">Deployment Phase</category><category domain="http://blogs.msdn.com/alikl/archive/tags/Practices/default.aspx">Practices</category><category domain="http://blogs.msdn.com/alikl/archive/tags/Authentication/default.aspx">Authentication</category></item><item><title>SOA, Strong Authentication, Standard Authorization - Cool Solution</title><link>http://blogs.msdn.com/alikl/archive/2007/05/30/soa-strong-authentication-standard-authorization-cool-solution.aspx</link><pubDate>Wed, 30 May 2007 15:45:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:2987960</guid><dc:creator>alikl</dc:creator><slash:comments>7</slash:comments><comments>http://blogs.msdn.com/alikl/comments/2987960.aspx</comments><wfw:commentRss>http://blogs.msdn.com/alikl/commentrss.aspx?PostID=2987960</wfw:commentRss><wfw:comment>http://blogs.msdn.com/alikl/rsscomments.aspx?PostID=2987960</wfw:comment><description>&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;reposted from &lt;A href="http://blogs.microsoft.co.il/blogs/alikl/archive/2007/01/29/SOA_2C00_-Strong-Authentication_2C00_-Standard-Authorization-_2D00_-Cool-Solution.aspx" target=_blank mce_href="http://blogs.microsoft.co.il/blogs/alikl/archive/2007/01/29/SOA_2C00_-Strong-Authentication_2C00_-Standard-Authorization-_2D00_-Cool-Solution.aspx"&gt;here&lt;/A&gt; 
&lt;P&gt;I've previously blogged about &lt;A class="" href="http://blogs.microsoft.co.il/blogs/alikl/archive/2006/12/05/SOA_2C00_-Kerberos_2C00_-IIS_2C00_-and-Security-Best-Practices.aspx" target=_blank mce_href="http://blogs.microsoft.co.il/blogs/alikl/archive/2006/12/05/SOA_2C00_-Kerberos_2C00_-IIS_2C00_-and-Security-Best-Practices.aspx"&gt;SOA Security Inside Enterprise walls&lt;/A&gt; 
&lt;P&gt;This time I had couple of pretty interesting requirements from one customer that targeted B2B/Partners scenario. They had a web site that communicates to partner's web services. His concerns were sincere and pretty fair: 
&lt;UL&gt;
&lt;LI&gt;I want to manage my creds that I use to authenticate with the partner's web service in secure way 
&lt;LI&gt;I want to pass it it over the wire in secure standard way 
&lt;LI&gt;The partner won't do any major changes to his authorization schema inside the web service 
&lt;LI&gt;Authorization schema must be easy to managed and standard&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;Without any hesitation I've gone to the following topic - 
&lt;P&gt;&lt;A class="" href="http://msdn2.microsoft.com/en-us/library/aa302408.aspx" target=_blank mce_href="http://msdn2.microsoft.com/en-us/library/aa302408.aspx"&gt;How To: Call a Web Service Using Client Certificates from ASP.NET 1.1&lt;/A&gt; 
&lt;P&gt;and implemented step by step what was described. In the code you see that one needs to&amp;nbsp; export client certs. Customer's concern was about how safe the cert is, no worries - it is getting exported without private keys: 
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/23288b2c09d1_DCCE/image%7B0%7D%5B4%5D.png" atomicselection="true" mce_href="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/23288b2c09d1_DCCE/image%7B0%7D%5B4%5D.png"&gt;&lt;IMG height=320 src="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/23288b2c09d1_DCCE/image%7B0%7D_thumb%5B2%5D.png" width=411 mce_src="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/23288b2c09d1_DCCE/image%7B0%7D_thumb%5B2%5D.png"&gt;&lt;/A&gt; 
&lt;P&gt;Last thing what I needed to do is Web Service authorization, so what I've done is I mapped the client cert to windows account on the web service machine like this: 
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/23288b2c09d1_DCCE/image%7B0%7D%5B9%5D.png" atomicselection="true" mce_href="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/23288b2c09d1_DCCE/image%7B0%7D%5B9%5D.png"&gt;&lt;IMG height=322 src="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/23288b2c09d1_DCCE/image%7B0%7D_thumb%5B5%5D.png" width=353 mce_src="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/23288b2c09d1_DCCE/image%7B0%7D_thumb%5B5%5D.png"&gt;&lt;/A&gt; 
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/23288b2c09d1_DCCE/image%7B0%7D%5B14%5D.png" atomicselection="true" mce_href="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/23288b2c09d1_DCCE/image%7B0%7D%5B14%5D.png"&gt;&lt;IMG height=305 src="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/23288b2c09d1_DCCE/image%7B0%7D_thumb%5B8%5D.png" width=418 mce_src="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/23288b2c09d1_DCCE/image%7B0%7D_thumb%5B8%5D.png"&gt;&lt;/A&gt; 
&lt;P&gt;Then in the web service code I've applied standard Role demands (well specifically here I demand specific user, but it could be group too like "...Demand, Role =@"myServer\Group8"")&amp;nbsp; 
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/23288b2c09d1_DCCE/image%7B0%7D%5B32%5D.png" atomicselection="true" mce_href="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/23288b2c09d1_DCCE/image%7B0%7D%5B32%5D.png"&gt;&lt;IMG height=185 src="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/23288b2c09d1_DCCE/image%7B0%7D_thumb%5B20%5D.png" width=639 mce_src="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/23288b2c09d1_DCCE/image%7B0%7D_thumb%5B20%5D.png"&gt;&lt;/A&gt; 
&lt;P&gt;And when the app was calling the web service method it was picking the client cert and sending it over to the web service which in turn was&amp;nbsp;mapping it to windows account and the principal permission was applied to this account. When I was calling&amp;nbsp;HelloWorld1() everything was fine since it was protected by user demand to which the cert is&amp;nbsp;mapped to, on other hand HelloWorld2() was rejected since the cert I was sending is NOT mapped to that user. Man, these are those rare moments that I am happy to see exceptions :)&amp;nbsp; 
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/23288b2c09d1_DCCE/image%7B0%7D%5B30%5D.png" atomicselection="true" mce_href="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/23288b2c09d1_DCCE/image%7B0%7D%5B30%5D.png"&gt;&lt;IMG height=281 src="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/23288b2c09d1_DCCE/image%7B0%7D_thumb%5B18%5D.png" width=642 mce_src="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/23288b2c09d1_DCCE/image%7B0%7D_thumb%5B18%5D.png"&gt;&lt;/A&gt; 
&lt;P&gt;&lt;STRONG&gt;Conclusion:&lt;/STRONG&gt; 
&lt;P&gt;Using minimal of coding (client side - couple of lines, server side - one line for each method) and standard configurations of the infrastructure I've achieved: 
&lt;UL&gt;
&lt;LI&gt;On caller's side the creds are managed in standard secure way - the client cert sits in User Store 
&lt;LI&gt;Client certs authentication is considered one of the strongest authentication mechanisms 
&lt;LI&gt;All the data goes over secure communications - SSL3 
&lt;LI&gt;Web Service utilizes standard .Net authorization mechanisms which required no coding (almost)&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;Now tell me why it is not COOL :) 
&lt;P&gt;Cheers&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=2987960" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/alikl/archive/tags/Security/default.aspx">Security</category><category domain="http://blogs.msdn.com/alikl/archive/tags/Development+Phase/default.aspx">Development Phase</category><category domain="http://blogs.msdn.com/alikl/archive/tags/Implementation/default.aspx">Implementation</category><category domain="http://blogs.msdn.com/alikl/archive/tags/Authentication/default.aspx">Authentication</category></item><item><title>Adding Shared SNK File In Visual Studio 2005</title><link>http://blogs.msdn.com/alikl/archive/2007/04/16/adding-shared-snk-file-in-visual-studio-2005.aspx</link><pubDate>Mon, 16 Apr 2007 17:24:15 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:2154164</guid><dc:creator>alikl</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/alikl/comments/2154164.aspx</comments><wfw:commentRss>http://blogs.msdn.com/alikl/commentrss.aspx?PostID=2154164</wfw:commentRss><wfw:comment>http://blogs.msdn.com/alikl/rsscomments.aspx?PostID=2154164</wfw:comment><description>&lt;p&gt;&lt;/p&gt; &lt;p&gt;“Prior to Microsoft Visual C# 2005, you specified the key file using CLR attributes in source code. &lt;strong&gt;&lt;em&gt;&lt;font color="#ff0000"&gt;These attributes are now deprecated&lt;/font&gt;&lt;/em&gt;&lt;/strong&gt;.  &lt;p&gt;Beginning in Microsoft Visual C# 2005, you should use the &lt;b&gt;Signing Page&lt;/b&gt; of the &lt;b&gt;Project Designer&lt;/b&gt; or the Assembly Linker to specify the key file.”, more &lt;a href="http://msdn2.microsoft.com/en-us/library/xh3fc3x0(vs.80).aspx" target="_blank"&gt;here&lt;/a&gt;  &lt;p&gt;Creating SNK file in VS2005 is handy using nice UI:  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/AddingSharedSNKFileInVisualStudio2005_7296/image05.png" atomicselection="true"&gt;&lt;img height="143" src="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/AddingSharedSNKFileInVisualStudio2005_7296/image0_thumb3.png" width="443"&gt;&lt;/a&gt;  &lt;p&gt;&amp;nbsp;  &lt;p&gt;Most of times the solution is built of multiple projects and I'd like to share the same SNK file with all my projects.  &lt;p&gt;If I create SNK file and then add it to my projects it copies local copy to each project - having multiple copies is a mess.  &lt;p&gt;Here is the solution.  &lt;ul&gt; &lt;li&gt;Create one SNK file, either using SN utility or using VS2005.  &lt;li&gt;Right click on project you want to sign it with and choose to add existing item.  &lt;li&gt;Browse&amp;nbsp;to the SNK file and add it as link:&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/AddingSharedSNKFileInVisualStudio2005_7296/image010.png" atomicselection="true"&gt;&lt;img height="98" src="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/AddingSharedSNKFileInVisualStudio2005_7296/image0_thumb6.png" width="152"&gt;&lt;/a&gt; &lt;/p&gt; &lt;ul&gt; &lt;li&gt;Go to the project's prop's page -&amp;nbsp;SNK file&amp;nbsp;should be listed in the drop list:&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/AddingSharedSNKFileInVisualStudio2005_7296/image015.png" atomicselection="true"&gt;&lt;img height="129" src="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/AddingSharedSNKFileInVisualStudio2005_7296/image0_thumb9.png" width="654"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;&amp;nbsp;  &lt;p&gt;If you are not afraid of directly messing with SLN files then notepad or some scripting magic (&lt;a href="http://blogs.msdn.com/alikl/archive/2007/03/23/scriptomania-scripting-tools-and-utilities.aspx" target="_blank"&gt;Scriptomania - Scripting Tools and Utilities&lt;/a&gt;) are your friends (NOTE - there are multiple places SNK is referenced in it):  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/AddingSharedSNKFileInVisualStudio2005_7296/image022.png" atomicselection="true"&gt;&lt;img height="87" src="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/AddingSharedSNKFileInVisualStudio2005_7296/image0_thumb12.png" width="759"&gt;&lt;/a&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/AddingSharedSNKFileInVisualStudio2005_7296/image025.png" atomicselection="true"&gt;&lt;img height="48" src="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/AddingSharedSNKFileInVisualStudio2005_7296/image0_thumb15.png" width="455"&gt;&lt;/a&gt;  &lt;p&gt;there may be more places...  &lt;p&gt;One master SNK - no mess :) - so far.  &lt;p&gt;&amp;nbsp;  &lt;p&gt;Enjoy&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=2154164" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/alikl/archive/tags/Security/default.aspx">Security</category><category domain="http://blogs.msdn.com/alikl/archive/tags/Development+Phase/default.aspx">Development Phase</category><category domain="http://blogs.msdn.com/alikl/archive/tags/CAS/default.aspx">CAS</category><category domain="http://blogs.msdn.com/alikl/archive/tags/Implementation/default.aspx">Implementation</category><category domain="http://blogs.msdn.com/alikl/archive/tags/Authentication/default.aspx">Authentication</category></item><item><title>Authentication Hub</title><link>http://blogs.msdn.com/alikl/archive/2007/04/11/authentication-hub.aspx</link><pubDate>Wed, 11 Apr 2007 23:04:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:2090802</guid><dc:creator>alikl</dc:creator><slash:comments>8</slash:comments><comments>http://blogs.msdn.com/alikl/comments/2090802.aspx</comments><wfw:commentRss>http://blogs.msdn.com/alikl/commentrss.aspx?PostID=2090802</wfw:commentRss><wfw:comment>http://blogs.msdn.com/alikl/rsscomments.aspx?PostID=2090802</wfw:comment><description>&lt;P&gt;Windows Authentication&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;A class="" href="http://blogs.msdn.com/alikl/archive/2007/04/05/identity-flow-through-physical-tiers.aspx" target=_blank mce_href="http://blogs.msdn.com/alikl/archive/2007/04/05/identity-flow-through-physical-tiers.aspx"&gt;Identity Flow Through Physical Tiers&lt;/A&gt; 
&lt;LI&gt;&lt;A class="" href="http://blogs.msdn.com/alikl/archive/2007/04/06/identity-flow-through-physical-tiers-impersonation.aspx" target=_blank mce_href="http://blogs.msdn.com/alikl/archive/2007/04/06/identity-flow-through-physical-tiers-impersonation.aspx"&gt;Identity Flow Through Physical Tiers - Impersonation&lt;/A&gt; 
&lt;LI&gt;&lt;A class="" href="http://blogs.msdn.com/alikl/archive/2007/04/08/identity-flow-through-physical-tiers-delegation.aspx" target=_blank mce_href="http://blogs.msdn.com/alikl/archive/2007/04/08/identity-flow-through-physical-tiers-delegation.aspx"&gt;Identity Flow Through Physical Tiers - Delegation&lt;/A&gt; 
&lt;LI&gt;&lt;A class="" href="http://blogs.msdn.com/alikl/archive/2007/04/10/identity-flow-through-physical-tiers-protocol-transition.aspx" target=_blank mce_href="http://blogs.msdn.com/alikl/archive/2007/04/10/identity-flow-through-physical-tiers-protocol-transition.aspx"&gt;Identity Flow Through Physical Tiers - Protocol Transition&lt;/A&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;Certificates&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;A class="" href="http://blogs.msdn.com/alikl/archive/2007/03/30/different-ways-to-get-hold-on-certificates-net-fx-1-1-2-0.aspx" target=_blank mce_href="http://blogs.msdn.com/alikl/archive/2007/03/30/different-ways-to-get-hold-on-certificates-net-fx-1-1-2-0.aspx"&gt;Different Ways To Get Hold On Certificates - Net FX 1.1, 2.0&lt;/A&gt; 
&lt;LI&gt;&lt;A class="" href="http://blogs.msdn.com/alikl/archive/2007/05/30/soa-strong-authentication-standard-authorization-cool-solution.aspx" target=_blank mce_href="http://blogs.msdn.com/alikl/archive/2007/05/30/soa-strong-authentication-standard-authorization-cool-solution.aspx"&gt;SOA, Strong Authentication, Standard Authorization - Cool Solution&lt;/A&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;CardSpace&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;A class="" href="http://blogs.msdn.com/alikl/archive/2007/04/09/basic-steps-to-make-asp-net-web-site-cardspace-aware.aspx" target=_blank mce_href="http://blogs.msdn.com/alikl/archive/2007/04/09/basic-steps-to-make-asp-net-web-site-cardspace-aware.aspx"&gt;Basic Steps To Make ASP.NET Web Site CardSpace Aware&lt;/A&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;WCF&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;A class=headermaintitle id=ctl00___ctl00___ctl00_ctl00_bcr_bth___BlogTitle href="http://blogs.msdn.com/suwatch/default.aspx" target=_blank mce_href="http://blogs.msdn.com/suwatch/default.aspx" minmax_bound="true"&gt;Identity and Access Developer&lt;/A&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=2090802" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/alikl/archive/tags/Security/default.aspx">Security</category><category domain="http://blogs.msdn.com/alikl/archive/tags/Implementation/default.aspx">Implementation</category><category domain="http://blogs.msdn.com/alikl/archive/tags/Authentication/default.aspx">Authentication</category></item><item><title>Identity Flow Through Physical Tiers - Protocol Transition</title><link>http://blogs.msdn.com/alikl/archive/2007/04/10/identity-flow-through-physical-tiers-protocol-transition.aspx</link><pubDate>Tue, 10 Apr 2007 15:27:35 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:2071867</guid><dc:creator>alikl</dc:creator><slash:comments>3</slash:comments><comments>http://blogs.msdn.com/alikl/comments/2071867.aspx</comments><wfw:commentRss>http://blogs.msdn.com/alikl/commentrss.aspx?PostID=2071867</wfw:commentRss><wfw:comment>http://blogs.msdn.com/alikl/rsscomments.aspx?PostID=2071867</wfw:comment><description>&lt;p&gt;&lt;/p&gt; &lt;p&gt;If&amp;nbsp;these articles:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;&lt;a href="http://msdn2.microsoft.com/en-us/library/ms998355.aspx" target="_blank"&gt;How To: Use Protocol Transition and Constrained Delegation in ASP.NET 2.0&lt;/a&gt;  &lt;li&gt;&lt;a href="http://msdn.microsoft.com/msdnmag/issues/07/01/SecurityBriefs/default.aspx" target="_blank"&gt;Using Protocol Transition—Tips from the Trenches&lt;/a&gt;&amp;nbsp;&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;are&amp;nbsp;your friends then do not waste your time on this post, please.&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;The scenario is the same&amp;nbsp;where user sits behind her machine A and access&amp;nbsp;simple ASPX page on box B that access file on share on box C, like this:&lt;/p&gt; &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/IdentityFlowThroughPhysicalTiersProtocol_B9E4/image03.png" atomicselection="true"&gt;&lt;img height="76" src="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/IdentityFlowThroughPhysicalTiersProtocol_B9E4/image0_thumb1.png" width="454"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;What I have so far is:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;&lt;a href="http://blogs.msdn.com/alikl/archive/2007/04/05/identity-flow-through-physical-tiers.aspx"&gt;Identity Flow Through Physical Tiers&lt;/a&gt;&amp;nbsp;- works fine, network resource (the file on network share) accessed by app pool account  &lt;li&gt;&lt;a href="http://blogs.msdn.com/alikl/archive/2007/04/06/identity-flow-through-physical-tiers-impersonation.aspx"&gt;Identity Flow Through Physical Tiers - Impersonation&lt;/a&gt;&amp;nbsp;- does not work  &lt;li&gt;&lt;font color="#ff0000"&gt;&lt;a href="http://blogs.msdn.com/alikl/archive/2007/04/08/identity-flow-through-physical-tiers-delegation.aspx"&gt;Identity Flow Through Physical Tiers - Delegation&lt;/a&gt;&lt;/font&gt;&lt;font color="#000000"&gt;- works great and the network resource is accessed by end sure's account&lt;/font&gt;&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;Now I have scenario where employee that tries to access corporate web site she used to use while inside corp walls but this time over Internet. &lt;/p&gt; &lt;p&gt;Another scenario would be where my customers access my web site from Internet and&amp;nbsp;I manage customers identity store using Active Directory (not as just LDAP store rather full blown AD Domain, for LDAP store use &lt;a href="http://www.microsoft.com/downloads/details.aspx?familyid=9688F8B9-1034-4EF6-A3E5-2A2A57B5C8E4&amp;amp;displaylang=en" target="_blank"&gt;ADAM - free download&lt;/a&gt;).&lt;/p&gt; &lt;p&gt;I presume in these scenarios the web site would be accessible only over port 443 (default SSL port) - no chance for Windows integrated authentication (which only supported by limited number of browsers... I mean authentication, not SSL).&lt;/p&gt; &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/IdentityFlowThroughPhysicalTiersProtocol_B9E4/image09.png" atomicselection="true"&gt;&lt;img height="151" src="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/IdentityFlowThroughPhysicalTiersProtocol_B9E4/image0_thumb5.png" width="522"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;Here comes in Protocol Transition (PT). Windows 2003 has cool feature - creating windows security context out of thin air - no password and LogonUser WIN API call required.... &lt;/p&gt; &lt;p&gt;&lt;a href="http://pluralsight.com/blogs/keith/" target="_blank"&gt;Keith Brown&lt;/a&gt; goes&amp;nbsp;really deep while&amp;nbsp;&lt;a href="http://msdn.microsoft.com/msdnmag/issues/03/04/SecurityBriefs/" target="_blank"&gt;Exploring S4U Kerberos Extensions in Windows Server 2003&lt;/a&gt;&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;I go for it, here some additions to what was already done in &lt;font color="#ff0000"&gt;&lt;a href="http://blogs.msdn.com/alikl/archive/2007/04/08/identity-flow-through-physical-tiers-delegation.aspx"&gt;Identity Flow Through Physical Tiers - Delegation&lt;/a&gt;&lt;/font&gt;:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;Get rid of all or nothing impersonation in web.config:&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/IdentityFlowThroughPhysicalTiersProtocol_B9E4/image014.png" atomicselection="true"&gt;&lt;img height="54" src="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/IdentityFlowThroughPhysicalTiersProtocol_B9E4/image0_thumb8.png" width="383"&gt;&lt;/a&gt; &lt;/p&gt; &lt;ul&gt; &lt;li&gt;Configure both app pool account and the server to support constrained delegation for non-Kerberos authentication using Active Directory users and Computers MMC (CIFS stands for the Common Internet File System, the name of the Microsoft&lt;sup&gt;®&lt;/sup&gt; file server - from &lt;a href="http://msdn.microsoft.com/msdnmag/issues/07/01/SecurityBriefs/default.aspx" target="_blank"&gt;Using Protocol Transition—Tips from the Trenches&lt;/a&gt;)&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/IdentityFlowThroughPhysicalTiersProtocol_B9E4/image025.png" atomicselection="true"&gt;&lt;img height="229" src="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/IdentityFlowThroughPhysicalTiersProtocol_B9E4/image0_thumb15.png" width="366"&gt;&lt;/a&gt; &lt;a href="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/IdentityFlowThroughPhysicalTiersProtocol_B9E4/image027.png" atomicselection="true"&gt;&lt;img height="228" src="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/IdentityFlowThroughPhysicalTiersProtocol_B9E4/image0_thumb17.png" width="350"&gt;&lt;/a&gt; &lt;/p&gt; &lt;ul&gt; &lt;li&gt;That's scary a bit one -&amp;nbsp;define app pool account to "Act as part of OS" using Local Security Policy MMC on web server (why it is scare and how to handle it - see &lt;a href="http://msdn.microsoft.com/msdnmag/issues/07/01/SecurityBriefs/default.aspx" target="_blank"&gt;Using Protocol Transition—Tips from the Trenches&lt;/a&gt;)&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/IdentityFlowThroughPhysicalTiersProtocol_B9E4/image032.png" atomicselection="true"&gt;&lt;img height="183" src="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/IdentityFlowThroughPhysicalTiersProtocol_B9E4/image0_thumb20.png" width="573"&gt;&lt;/a&gt; &lt;/p&gt; &lt;ul&gt; &lt;li&gt;Add code that actually utilize Protocol Transition creating WindowsIdentity based on UPN (user principal name) that came in after custom authentication and explicitly impersonate the thread before accessing network resource - our file on share:&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;string upn = txtCustomUPN.Text;//CAN COME FROM ANY PLACE&lt;br&gt;//DO INPUT VALIDATION HERE!!!!! &lt;/p&gt; &lt;p&gt;WindowsIdentity wi = new WindowsIdentity(upn);  &lt;p&gt;WindowsPrincipal wp = new WindowsPrincipal(wi);  &lt;p&gt;HttpContext.Current.User = wp;  &lt;p&gt;WindowsImpersonationContext wic = wi.Impersonate();  &lt;p&gt;// ACCESS NETWORK RESOURCE  &lt;p&gt;wic.Undo();  &lt;p&gt;&amp;nbsp;  &lt;p&gt;No when I ran my app here is what I get (no impersonation):  &lt;p&gt;&amp;nbsp;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/IdentityFlowThroughPhysicalTiersProtocol_B9E4/image037.png" atomicselection="true"&gt;&lt;img height="161" src="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/IdentityFlowThroughPhysicalTiersProtocol_B9E4/image0_thumb23.png" width="524"&gt;&lt;/a&gt;  &lt;p&gt;Now I simulate passing UPN that came from custom authentication (xacker@demo.lab is valid AD account):  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/IdentityFlowThroughPhysicalTiersProtocol_B9E4/image042.png" atomicselection="true"&gt;&lt;img height="90" src="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/IdentityFlowThroughPhysicalTiersProtocol_B9E4/image0_thumb26.png" width="214"&gt;&lt;/a&gt;  &lt;p&gt;the code above is ran after pressing&amp;nbsp;"Protocol Transition" button  &lt;p&gt;and here is the result of access audit:  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/IdentityFlowThroughPhysicalTiersProtocol_B9E4/image047.png" atomicselection="true"&gt;&lt;img height="421" src="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/IdentityFlowThroughPhysicalTiersProtocol_B9E4/image0_thumb29.png" width="392"&gt;&lt;/a&gt;  &lt;p&gt;Techniques for file access audit are here:  &lt;ul&gt; &lt;li&gt;&lt;a href="http://blogs.msdn.com/alikl/archive/2007/04/03/who-access-my-file.aspx"&gt;Who Access My File?&lt;/a&gt;  &lt;li&gt;&lt;a href="http://blogs.msdn.com/alikl/archive/2007/04/01/file-access-auditing-i-am-not-afraid-of-gpo.aspx"&gt;File Access Auditing - I Am Not Afraid Of GPO&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;&amp;nbsp;  &lt;p&gt;Enjoy  &lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=2071867" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/alikl/archive/tags/Security/default.aspx">Security</category><category domain="http://blogs.msdn.com/alikl/archive/tags/Development+Phase/default.aspx">Development Phase</category><category domain="http://blogs.msdn.com/alikl/archive/tags/Implementation/default.aspx">Implementation</category><category domain="http://blogs.msdn.com/alikl/archive/tags/Authentication/default.aspx">Authentication</category></item><item><title>Basic Steps To Make ASP.NET Web Site CardSpace Aware</title><link>http://blogs.msdn.com/alikl/archive/2007/04/09/basic-steps-to-make-asp-net-web-site-cardspace-aware.aspx</link><pubDate>Mon, 09 Apr 2007 15:26:35 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:2060412</guid><dc:creator>alikl</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/alikl/comments/2060412.aspx</comments><wfw:commentRss>http://blogs.msdn.com/alikl/commentrss.aspx?PostID=2060412</wfw:commentRss><wfw:comment>http://blogs.msdn.com/alikl/rsscomments.aspx?PostID=2060412</wfw:comment><description>&lt;p&gt;From short investigation and a lot of information from &lt;a href="http://blogs.msdn.com/richardt/" target="_blank"&gt;Richard Turner's&lt;/a&gt; screencasts&lt;/p&gt; &lt;p&gt;Here is what I get. To make my ASP.NET app I need:&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;ol&gt; &lt;li&gt;Write ASP.NET server side code to validate the token that holds end user's data, further processing might include checking against membership provider - &lt;a href="http://blogs.msdn.com/richardt/archive/2007/03/18/cardspace-simple-demo-screencast-on-channel9.aspx" target="_blank"&gt;CardSpace Simple Demo screencast on Channel9&lt;/a&gt;&lt;/li&gt; &lt;li&gt;Add client script code to specify CardSpace object and its properties, like required claims. This will trigger CardSpace UI to show up for the end user - &lt;a href="http://blogs.msdn.com/richardt/archive/2007/03/18/cardspace-simple-demo-screencast-on-channel9.aspx" target="_blank"&gt;CardSpace Simple Demo screencast on Channel9&lt;/a&gt;&lt;/li&gt; &lt;li&gt;Configure IIS to require SSL connection - &lt;a href="http://blogs.msdn.com/richardt/archive/2007/03/28/new-screencast-how-to-configure-iis7-for-windows-cardspace-sites.aspx" target="_blank"&gt;New Screencast: How to configure IIS7 for Windows CardSpace sites&lt;/a&gt;&lt;/li&gt; &lt;li&gt;Give application pool account read access to private key for the server cert that actually gives SSL support. This is needed for decrypting the XML token in the server code for its further deserialization - &lt;a href="http://blogs.msdn.com/richardt/archive/2007/04/02/secure-your-private-keys-more-easily-with-vista.aspx"&gt;Secure your private keys more easily with Vista&lt;/a&gt;&lt;/li&gt;&lt;/ol&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;I got it right? Forgetting something?&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=2060412" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/alikl/archive/tags/Security/default.aspx">Security</category><category domain="http://blogs.msdn.com/alikl/archive/tags/Implementation/default.aspx">Implementation</category><category domain="http://blogs.msdn.com/alikl/archive/tags/Authentication/default.aspx">Authentication</category><category domain="http://blogs.msdn.com/alikl/archive/tags/Vista/default.aspx">Vista</category><category domain="http://blogs.msdn.com/alikl/archive/tags/IIS+7/default.aspx">IIS 7</category><category domain="http://blogs.msdn.com/alikl/archive/tags/CardSpace/default.aspx">CardSpace</category></item><item><title>Identity Flow Through Physical Tiers - Delegation</title><link>http://blogs.msdn.com/alikl/archive/2007/04/08/identity-flow-through-physical-tiers-delegation.aspx</link><pubDate>Sun, 08 Apr 2007 19:53:17 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:2054180</guid><dc:creator>alikl</dc:creator><slash:comments>3</slash:comments><comments>http://blogs.msdn.com/alikl/comments/2054180.aspx</comments><wfw:commentRss>http://blogs.msdn.com/alikl/commentrss.aspx?PostID=2054180</wfw:commentRss><wfw:comment>http://blogs.msdn.com/alikl/rsscomments.aspx?PostID=2054180</wfw:comment><description>&lt;p&gt;If&amp;nbsp;these articles:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;&lt;a href="http://msdn2.microsoft.com/aa302400.aspx"&gt;How To: Implement Kerberos Delegation for Windows 2000&lt;/a&gt;  &lt;li&gt;&lt;a href="http://msdn2.microsoft.com/ms998351.aspx"&gt;How To: Use Impersonation and Delegation in ASP.NET 2.0&lt;/a&gt;  &lt;li&gt;&lt;a href="http://msdn.microsoft.com/msdnmag/issues/05/09/SecurityBriefs/default.aspx" target="_blank"&gt;Credentials and Delegation&lt;/a&gt;&amp;nbsp;&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;are&amp;nbsp;your friends then do not waste your time on this post, please.&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;I have still the same scenario - user sits behind her machine A and access&amp;nbsp;simple ASPX page on box B that access file on share on box C&lt;/p&gt; &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/IdentityFlowThroughPhysicalTiersDelegati_D3B2/image03.png" atomicselection="true"&gt;&lt;img height="76" src="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/IdentityFlowThroughPhysicalTiersDelegati_D3B2/image0_thumb1.png" width="454"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;In previous posts:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;&lt;a href="http://blogs.msdn.com/alikl/archive/2007/04/06/identity-flow-through-physical-tiers-impersonation.aspx"&gt;Identity Flow Through Physical Tiers - Impersonation&lt;/a&gt;&amp;nbsp;-&amp;nbsp;access failed.  &lt;li&gt;&lt;a href="http://blogs.msdn.com/alikl/archive/2007/04/05/identity-flow-through-physical-tiers.aspx"&gt;Identity Flow Through Physical Tiers&lt;/a&gt;&amp;nbsp;- the network resource was accessed under App process account.&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;This time I really want to access the file on share (box C) under end user's account, e.g. flow end user's identity 2 hops - from end user's machine A to web server B and then to the file share - box C. &lt;/p&gt; &lt;p&gt;That is Delegation.&lt;/p&gt; &lt;p&gt;To enable delegation there is a need to accomplish the following:&lt;/p&gt; &lt;p&gt;1. Everything that was&amp;nbsp;needed for impersonation (configure IIS and web.config for windows authentication).&lt;/p&gt; &lt;p&gt;2. Mess a bit with Active directory using Active Directory Users and Computers MMC:&lt;/p&gt; &lt;ul&gt; &lt;ul&gt; &lt;li&gt;Configure both App pool account and the Web Server to support delegation:&lt;/li&gt;&lt;/ul&gt;&lt;/ul&gt; &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/IdentityFlowThroughPhysicalTiersDelegati_D3B2/image09.png" atomicselection="true"&gt;&lt;img height="145" src="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/IdentityFlowThroughPhysicalTiersDelegati_D3B2/image0_thumb5.png" width="306"&gt;&lt;/a&gt; &lt;a href="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/IdentityFlowThroughPhysicalTiersDelegati_D3B2/image015.png" atomicselection="true"&gt;&lt;img height="145" src="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/IdentityFlowThroughPhysicalTiersDelegati_D3B2/image0_thumb9.png" width="300"&gt;&lt;/a&gt; &lt;/p&gt; &lt;ul&gt; &lt;ul&gt; &lt;li&gt;Since I run my App pool under custom domain account I need to create SPN for it. Keith Brown explains it perfectly in his &lt;a href="http://msdn.microsoft.com/msdnmag/issues/05/09/SecurityBriefs/default.aspx" target="_blank"&gt;Credentials and Delegation&lt;/a&gt;&amp;nbsp;&lt;/li&gt;&lt;/ul&gt;&lt;/ul&gt; &lt;p&gt;iisreset can help sometimes :)&lt;/p&gt; &lt;p&gt;kerbtray (&lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=4E3A58BE-29F6-49F6-85BE-E866AF8E7A88&amp;amp;displaylang=en" target="_blank"&gt;Win2k&lt;/a&gt;, &lt;a href="http://www.microsoft.com/downloads/details.aspx?familyid=9D467A69-57FF-4AE7-96EE-B18C4790CFFD&amp;amp;displaylang=en" target="_blank"&gt;Win2k3&lt;/a&gt;) can help too to purge Kerberos tickets instead logging off and on.&lt;/p&gt; &lt;p&gt;Also &lt;a href="http://www.microsoft.com/downloads/details.aspx?familyid=E90FE777-4A21-4066-BD22-B931F7572E9A&amp;amp;displaylang=en" target="_blank"&gt;AuthDiag&lt;/a&gt; tool is handy too to diagnose Kerberos issues, for example to make sure that my app pool account has SPN defined in AD.&lt;/p&gt; &lt;p&gt;After accessing the page again here is what I have (meaning impersonation works fine):&lt;/p&gt; &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/IdentityFlowThroughPhysicalTiersDelegati_D3B2/image030.png" atomicselection="true"&gt;&lt;img height="159" src="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/IdentityFlowThroughPhysicalTiersDelegati_D3B2/image0_thumb18.png" width="539"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;And the file on the share (box C) is accessed by end user's identity - DEMO\Administrator:&lt;/p&gt; &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/IdentityFlowThroughPhysicalTiersDelegati_D3B2/image025.png" atomicselection="true"&gt;&lt;img height="450" src="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/IdentityFlowThroughPhysicalTiersDelegati_D3B2/image0_thumb15.png" width="398"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;I think it is cool.&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;How to&amp;nbsp; analyze who access my files - see:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;&lt;a href="http://blogs.msdn.com/alikl/archive/2007/04/03/who-access-my-file.aspx"&gt;Who Access My File?&lt;/a&gt;  &lt;li&gt;&lt;a href="http://blogs.msdn.com/alikl/archive/2007/04/01/file-access-auditing-i-am-not-afraid-of-gpo.aspx"&gt;File Access Auditing - I Am Not Afraid Of GPO&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;Next post is even cooler - I will walk through Protocol Transition - very similar to Delegation but the end user's security context is created out of thin air without authentication against Active Directory&lt;/p&gt; &lt;p&gt;Huh? Sounds absurd? It did to me when I first discovered it...&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;Enjoy&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=2054180" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/alikl/archive/tags/Security/default.aspx">Security</category><category domain="http://blogs.msdn.com/alikl/archive/tags/Development+Phase/default.aspx">Development Phase</category><category domain="http://blogs.msdn.com/alikl/archive/tags/Implementation/default.aspx">Implementation</category><category domain="http://blogs.msdn.com/alikl/archive/tags/Authentication/default.aspx">Authentication</category></item><item><title>Identity Flow Through Physical Tiers - Impersonation</title><link>http://blogs.msdn.com/alikl/archive/2007/04/06/identity-flow-through-physical-tiers-impersonation.aspx</link><pubDate>Fri, 06 Apr 2007 21:54:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:2041415</guid><dc:creator>alikl</dc:creator><slash:comments>7</slash:comments><comments>http://blogs.msdn.com/alikl/comments/2041415.aspx</comments><wfw:commentRss>http://blogs.msdn.com/alikl/commentrss.aspx?PostID=2041415</wfw:commentRss><wfw:comment>http://blogs.msdn.com/alikl/rsscomments.aspx?PostID=2041415</wfw:comment><description>&lt;P&gt;There are scenarios where actual windows identity&amp;nbsp; of end user needs to be flowed to the server so that server can perform action on end user's behalf - that is in nutshell Impersonation. In previous post &lt;A href="http://blogs.msdn.com/alikl/archive/2007/04/05/identity-flow-through-physical-tiers.aspx" mce_href="http://blogs.msdn.com/alikl/archive/2007/04/05/identity-flow-through-physical-tiers.aspx"&gt;Identity Flow Through Physical Tiers&lt;/A&gt;&amp;nbsp;- one might think that the end user identity flowed but in fact it was not. Although HttpContext held end user's account - DEMO\Administrator - and even identity's type was WindowsIdentity, the actual windows thread was ran under Application Pool's account - DEMO\W3WRUNNER1. That means that the resources were accessed under App Pool account - DEMO\W3WRUNNER1 - just as depicted in the post.&lt;/P&gt;
&lt;P&gt;While scenario is the same where user sits behind her machine A and access&amp;nbsp;simple ASPX page on box B that access file on share on box C, like this:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/IdentityFlowThroughPhysicalTiersImperson_CAEE/image08.png" atomicselection="true" mce_href="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/IdentityFlowThroughPhysicalTiersImperson_CAEE/image08.png"&gt;&lt;IMG height=76 src="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/IdentityFlowThroughPhysicalTiersImperson_CAEE/image0_thumb4.png" width=454 mce_src="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/IdentityFlowThroughPhysicalTiersImperson_CAEE/image0_thumb4.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;lets do some small changes, and define impersonation in web.config file:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/IdentityFlowThroughPhysicalTiersImperson_CAEE/image04.png" atomicselection="true" mce_href="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/IdentityFlowThroughPhysicalTiersImperson_CAEE/image04.png"&gt;&lt;IMG height=61 src="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/IdentityFlowThroughPhysicalTiersImperson_CAEE/image0_thumb2.png" width=392 mce_src="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/IdentityFlowThroughPhysicalTiersImperson_CAEE/image0_thumb2.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;Now lets access the aspx page:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/IdentityFlowThroughPhysicalTiersImperson_CAEE/image017.png" atomicselection="true" mce_href="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/IdentityFlowThroughPhysicalTiersImperson_CAEE/image017.png"&gt;&lt;IMG height=169 src="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/IdentityFlowThroughPhysicalTiersImperson_CAEE/image0_thumb9.png" width=542 mce_src="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/IdentityFlowThroughPhysicalTiersImperson_CAEE/image0_thumb9.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;Seems like impersonation works - both HttpContext and windows thread has the same, end user's identity - cool, good job.&lt;/P&gt;
&lt;P&gt;But when the code reaches the line where the file on share (Box C)&amp;nbsp;is accessed, something goes wrong:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/IdentityFlowThroughPhysicalTiersImperson_CAEE/image022.png" atomicselection="true" mce_href="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/IdentityFlowThroughPhysicalTiersImperson_CAEE/image022.png"&gt;&lt;IMG style="WIDTH: 540px; HEIGHT: 89px" height=108 src="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/IdentityFlowThroughPhysicalTiersImperson_CAEE/image0_thumb12.png" width=718 mce_src="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/IdentityFlowThroughPhysicalTiersImperson_CAEE/image0_thumb12.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Why? It worked in previous post...&lt;/P&gt;
&lt;P&gt;The reason for such behavior is that&amp;nbsp;I&amp;nbsp;got&amp;nbsp;my architecture confused...&lt;/P&gt;
&lt;P&gt;On one hand&amp;nbsp;I asked app process, sorry, specific request's thread to run under end user's account - Impersonation - by setting impersonate="true" in web.config. On other hand I ask this thread to go out to network resource - my file on file share. That is another Impersonation... In scenario where the resource sits on the same box, Web Server B, impersonation would work, but in our case - the resource sits on other machine C.&lt;/P&gt;
&lt;P&gt;In other words&amp;nbsp; I am trying to flow identity over two hops - from end user machine A to web server B and then to File share C - that is more than Impersonation, but Delegation which will be discussed in the next post.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=2041415" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/alikl/archive/tags/Security/default.aspx">Security</category><category domain="http://blogs.msdn.com/alikl/archive/tags/Development+Phase/default.aspx">Development Phase</category><category domain="http://blogs.msdn.com/alikl/archive/tags/Implementation/default.aspx">Implementation</category><category domain="http://blogs.msdn.com/alikl/archive/tags/Authentication/default.aspx">Authentication</category></item><item><title>Identity Flow Through Physical Tiers</title><link>http://blogs.msdn.com/alikl/archive/2007/04/05/identity-flow-through-physical-tiers.aspx</link><pubDate>Fri, 06 Apr 2007 00:23:01 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:2035342</guid><dc:creator>alikl</dc:creator><slash:comments>4</slash:comments><comments>http://blogs.msdn.com/alikl/comments/2035342.aspx</comments><wfw:commentRss>http://blogs.msdn.com/alikl/commentrss.aspx?PostID=2035342</wfw:commentRss><wfw:comment>http://blogs.msdn.com/alikl/rsscomments.aspx?PostID=2035342</wfw:comment><description>&lt;p&gt;Identity story with .Net&amp;nbsp; really rocks,&amp;nbsp;but along with great extensibility it also brings a lots of confusion (&lt;a href="http://blogs.msdn.com/alikl/archive/2007/04/02/one-identity-many-faces-iidentity.aspx"&gt;One Identity - Many Faces :IIdentity&lt;/a&gt;).&lt;/p&gt; &lt;p&gt;I am building now workshop for developers that concentrates on authentication only. It talks about concepts, implementation, scenarios, and of course a bit of hacking exposed - entertaining part never hurts :)&lt;/p&gt; &lt;p&gt;I plan to allocate some time for .Net identity implementation, based on IIdentity, in conjunction with what Windows System provides.&lt;/p&gt; &lt;p&gt;My first scenario is simple one where&amp;nbsp;user sits behind her machine A access&amp;nbsp;simple ASPX page on box B that access file on share on box C, like this:&lt;/p&gt; &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/IdentityFlowThroughPhysicalTiers_7515/image%7B0%7D%5B25%5D.png" atomicselection="true"&gt;&lt;img height="76" src="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/IdentityFlowThroughPhysicalTiers_7515/image%7B0%7D_thumb%5B23%5D.png" width="454"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;Everything is managed by Windows 2003 Active Directory Domain - Demo.lab&lt;/p&gt; &lt;p&gt;User name is DEMO\Administrator.&lt;/p&gt; &lt;p&gt;Web application runs under DEMO\W3WRUNNER1 service account, specified in application pool configuration.&lt;/p&gt; &lt;p&gt;Web site is set to use Window authentication in web.config and IIS is configured for Windows authentication.&lt;/p&gt; &lt;p&gt;What user runs the app's security context?&lt;/p&gt; &lt;p&gt;Under what account the file on box C is accessed?&lt;/p&gt; &lt;p&gt;To answer the first question I echo back the following data (meaning there is no single answer for it)&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;lblHttpCoontextUser.Text = User.Identity.Name;&amp;nbsp;  &lt;p&gt;lblWindowsThreadUser.Text = WindowsIdentity.GetCurrent().Name;  &lt;p&gt;lblAuthType.Text = User.Identity.AuthenticationType; &lt;p&gt;&amp;nbsp; &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/IdentityFlowThroughPhysicalTiers_7515/image%7B0%7D%5B44%5D.png" atomicselection="true"&gt;&lt;img height="142" src="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/IdentityFlowThroughPhysicalTiers_7515/image%7B0%7D_thumb%5B34%5D.png" width="474"&gt;&lt;/a&gt;  &lt;p&gt;And to answer the second question I use techniques described in &lt;a href="http://blogs.msdn.com/alikl/archive/2007/04/01/file-access-auditing-i-am-not-afraid-of-gpo.aspx" target="_blank"&gt;File Access Auditing - I Am Not Afraid Of GPO&lt;/a&gt;&amp;nbsp;and &lt;a href="http://blogs.msdn.com/alikl/archive/2007/04/03/who-access-my-file.aspx"&gt;Who Access My File?&lt;/a&gt;&lt;/p&gt; &lt;p&gt;&lt;a href="http://blogs.msdn.com/alikl/archive/2007/04/03/who-access-my-file.aspx" target="_new" atomicselection="true"&gt;&lt;img height="178" src="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/IdentityFlowThroughPhysicalTiers_7515/image%7B0%7D%5B38%5D.png" width="372"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;and/or &lt;/p&gt; &lt;p&gt;&lt;a href="http://blogs.msdn.com/alikl/archive/2007/04/01/file-access-auditing-i-am-not-afraid-of-gpo.aspx" target="_new" atomicselection="true"&gt;&lt;img height="390" src="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/IdentityFlowThroughPhysicalTiers_7515/image%7B0%7D%5B37%5D.png" width="345"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;Enjoy&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=2035342" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/alikl/archive/tags/Security/default.aspx">Security</category><category domain="http://blogs.msdn.com/alikl/archive/tags/Development+Phase/default.aspx">Development Phase</category><category domain="http://blogs.msdn.com/alikl/archive/tags/Implementation/default.aspx">Implementation</category><category domain="http://blogs.msdn.com/alikl/archive/tags/Authentication/default.aspx">Authentication</category></item><item><title>Who Access My File?</title><link>http://blogs.msdn.com/alikl/archive/2007/04/03/who-access-my-file.aspx</link><pubDate>Tue, 03 Apr 2007 21:02:32 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:2019935</guid><dc:creator>alikl</dc:creator><slash:comments>7</slash:comments><comments>http://blogs.msdn.com/alikl/comments/2019935.aspx</comments><wfw:commentRss>http://blogs.msdn.com/alikl/commentrss.aspx?PostID=2019935</wfw:commentRss><wfw:comment>http://blogs.msdn.com/alikl/rsscomments.aspx?PostID=2019935</wfw:comment><description>&lt;p&gt;In my post &lt;a href="http://blogs.msdn.com/alikl/archive/2007/04/01/file-access-auditing-i-am-not-afraid-of-gpo.aspx" target="_blank"&gt;File Access Auditing - I Am Not Afraid Of GPO&lt;/a&gt;&amp;nbsp;I've digested technet documentation on how to set Active Directory Group Policy Object (AD GP) to enable file access auditing as security measure to prevent repudiation. It is heavy weight techniques for scenarios where developer just needs to understand why she gets "Access denied" during development or while deploying in test environment -&amp;nbsp;"Strange, it all worked on my machine...." :)&lt;/p&gt; &lt;p&gt;For that purpose I use two light weight tools from Sysinternals, the whole portal of Sysinternal's tools is here &lt;a href="http://www.microsoft.com/technet/sysinternals/default.mspx" target="_blank"&gt;Windows Sysinternals&lt;/a&gt;&amp;nbsp;loaded with free goodies.&amp;nbsp;&lt;/p&gt; &lt;p&gt;First tool is &lt;a href="http://www.microsoft.com/technet/sysinternals/FileAndDisk/Filemon.mspx" target="_blank"&gt;file monitor (filemon)&lt;/a&gt; - it monitors file access activity and when double clicking on some line it shows the user&amp;nbsp;accessed that file:&lt;/p&gt; &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/HowToDetermineWhatWindowsAccountIsAccess_6871/clip_image002314.jpg" atomicselection="true"&gt;&lt;img height="273" src="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/HowToDetermineWhatWindowsAccountIsAccess_6871/clip_image00231_thumb1.jpg" width="344"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;But when the file is accessed from other machine, filemon does not have this information:&lt;/p&gt; &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/HowToDetermineWhatWindowsAccountIsAccess_6871/clip_image002414.jpg" atomicselection="true"&gt;&lt;img height="273" src="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/HowToDetermineWhatWindowsAccountIsAccess_6871/clip_image00241_thumb1.jpg" width="344"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;&lt;a href="http://blogs.technet.com/markrussinovich/" target="_blank"&gt;Mark Russinovich&lt;/a&gt; kindly explained me why it is not there and suggested using another great tool - &lt;a href="http://www.microsoft.com/technet/sysinternals/FileAndDisk/processmonitor.mspx" target="_blank"&gt;process monitor&lt;/a&gt;. The tool has details column which includes the data what I was looking for - Impersonating:&amp;lt;&amp;lt;account name&amp;gt;&amp;gt;:&lt;/p&gt; &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/HowToDetermineWhatWindowsAccountIsAccess_6871/image04.png" atomicselection="true"&gt;&lt;img height="174" src="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/HowToDetermineWhatWindowsAccountIsAccess_6871/image0_thumb2.png" width="513"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;Very cool, very usable, very light weight&lt;/p&gt; &lt;p&gt;Enjoy&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=2019935" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/alikl/archive/tags/Test+Phase/default.aspx">Test Phase</category><category domain="http://blogs.msdn.com/alikl/archive/tags/Security/default.aspx">Security</category><category domain="http://blogs.msdn.com/alikl/archive/tags/Tools/default.aspx">Tools</category><category domain="http://blogs.msdn.com/alikl/archive/tags/Development+Phase/default.aspx">Development Phase</category><category domain="http://blogs.msdn.com/alikl/archive/tags/Deployment+Phase/default.aspx">Deployment Phase</category><category domain="http://blogs.msdn.com/alikl/archive/tags/Authentication/default.aspx">Authentication</category></item></channel></rss>