<?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>Mike Poulson's Thoughts on lots of stuff : Smart Cards</title><link>http://blogs.msdn.com/mpoulson/archive/tags/Smart+Cards/default.aspx</link><description>Tags: Smart Cards</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Restricting which Certificate is allowed to authenticate a VPN connection</title><link>http://blogs.msdn.com/mpoulson/archive/2005/01/19/356229.aspx</link><pubDate>Wed, 19 Jan 2005 21:35:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:356229</guid><dc:creator>mpoulson</dc:creator><slash:comments>3</slash:comments><comments>http://blogs.msdn.com/mpoulson/comments/356229.aspx</comments><wfw:commentRss>http://blogs.msdn.com/mpoulson/commentrss.aspx?PostID=356229</wfw:commentRss><description>&lt;P&gt;So I had a requirement on a VPN server I was setting up not long ago.&amp;nbsp; This requirement was that only a "smartcard logon" cert would be permitted for EAP access into my VPN server.&amp;nbsp; The normal setup information &lt;/P&gt;
&lt;P&gt;(&lt;A href="http://www.microsoft.com/resources/documentation/WindowsServ/2003/standard/proddocs/en-us/Default.asp?url=/resources/documentation/WindowsServ/2003/standard/proddocs/en-us/sag_RRAS-Ch1_70.asp"&gt;http://www.microsoft.com/resources/documentation/WindowsServ/2003/standard/proddocs/en-us/Default.asp?url=/resources/documentation/WindowsServ/2003/standard/proddocs/en-us/sag_RRAS-Ch1_70.asp&lt;/A&gt;) tells you how to setup RRAS to allow authentication via CERT but it does not tell you how to limit which certs are allowed to be used to make that connection.&lt;/P&gt;
&lt;P&gt;What is the issue?&lt;/P&gt;
&lt;P&gt;Well for example lets say you work for a company that uses 802.1x and a "Client authentication" cert for wireless access. A valid employee would have a client auth cert on their workstation.&lt;/P&gt;
&lt;P&gt;Now for security reasons you don't want that user to be able to use that same cert (the client Auth cert for wireless) to connect to the VPN servers.&amp;nbsp; So how do you do it? By default when RRAS is setup to do smart card or certificate authentication it will allow any valid (issued by the correct CA) to connect.&lt;/P&gt;
&lt;P&gt;What we want to do is limit it so only a Smart card Logon Cert will work.&amp;nbsp; The key here is the OID for the smart card logon Cert (which is 1.3.6.1.4.1.311.20.2.2)&lt;/P&gt;
&lt;P&gt;So follow the directions on setting up your VPN server for "Smart card or Certificate Authentication" &lt;/P&gt;
&lt;P&gt;(&lt;A href="http://www.microsoft.com/resources/documentation/WindowsServ/2003/standard/proddocs/en-us/Default.asp?url=/resources/documentation/WindowsServ/2003/standard/proddocs/en-us/ras_sc_logon.asp"&gt;http://www.microsoft.com/resources/documentation/WindowsServ/2003/standard/proddocs/en-us/Default.asp?url=/resources/documentation/WindowsServ/2003/standard/proddocs/en-us/ras_sc_logon.asp&lt;/A&gt;).&amp;nbsp; &lt;/P&gt;
&lt;P&gt;For a little better control of who I let into my VPN servers I also created a Security Group Called "Smart Card VPN Users".&amp;nbsp; The users that I have issued a smart card to are members of this Group. &lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;So after the users are created, the group is created and the smart cards are issued do the following:&lt;BR&gt;Open your RAS manager and goto Remote Access Policies 
&lt;LI&gt;Create a new Policy called "Smart Card VPN Access" (I did not run the wizard but instead did a custom policy) 
&lt;LI&gt;Add a condition where windows-group = "Smart Card VPN Users" 
&lt;LI&gt;Add a condition where Authentication Type = "EAP" 
&lt;LI&gt;Nas-Port-Type should also be "Virtual (VPN)"&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;IMG src="http://www.mikepoulson.com/blog/images/smartcard-vpn/policy1.jpg"&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Now Click "Edit Profile" 
&lt;LI&gt;Select the Authentication Tab 
&lt;LI&gt;Unselect MS-CHAP v2 and MS-CHAP (at this point we only want EAP authentication)&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;IMG src="http://www.mikepoulson.com/blog/images/smartcard-vpn/policy2.jpg"&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Follow the steps in the &lt;A href="http://www.microsoft.com/resources/documentation/WindowsServ/2003/standard/proddocs/en-us/Default.asp?url=/resources/documentation/WindowsServ/2003/standard/proddocs/en-us/ras_sc_logon.asp"&gt;http://www.microsoft.com/resources/documentation/WindowsServ/2003/standard/proddocs/en-us/Default.asp?url=/resources/documentation/WindowsServ/2003/standard/proddocs/en-us/ras_sc_logon.asp&lt;/A&gt; doc to set up EAP in general 
&lt;LI&gt;Now Click the Advanced Tab &lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;IMG src="http://www.mikepoulson.com/blog/images/smartcard-vpn/policy3.jpg"&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Click Add to add a New attribute 
&lt;LI&gt;Select "Allowed-Certificate-OID" 
&lt;LI&gt;Enter the value of the OID that you want to permit into the value; In this case we want to only permit Smart Card Logon Certs which has an OID of 1.3.6.1.4.1.311.20.2.2.&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;IMG src="http://www.mikepoulson.com/blog/images/smartcard-vpn/policy4.jpg"&gt;&lt;/P&gt;
&lt;P&gt;Now test your connection. With the smart card cert it should allow you to connect. But if you use a Client Auth Cert it should fail.&lt;/P&gt;
&lt;P&gt;Please let me know if this works for does not work out for you! :) And enjoy&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=356229" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/mpoulson/archive/tags/Networking/default.aspx">Networking</category><category domain="http://blogs.msdn.com/mpoulson/archive/tags/Smart+Cards/default.aspx">Smart Cards</category><category domain="http://blogs.msdn.com/mpoulson/archive/tags/Security/default.aspx">Security</category></item><item><title>Securing a TS connection with Smart Cards</title><link>http://blogs.msdn.com/mpoulson/archive/2004/12/11/279863.aspx</link><pubDate>Sun, 12 Dec 2004 00:23:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:279863</guid><dc:creator>mpoulson</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/mpoulson/comments/279863.aspx</comments><wfw:commentRss>http://blogs.msdn.com/mpoulson/commentrss.aspx?PostID=279863</wfw:commentRss><description>&lt;p&gt;Well today is going to be a busy day here at the Microsoft Enterprise Engineering Center.&amp;nbsp; At about 11:30 I am going to have lunch some of the RedvsBlue people (&lt;a href="http://www.redvsblue.com/"&gt;http://www.redvsblue.com&lt;/a&gt;).&amp;nbsp; Then I have the job of setting up and testing a remote access solution for a customer.&amp;nbsp; &lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;Note that the steps below are technical and you should know a little something about Active Directory and PKI before you start.&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt; &lt;p&gt;The problem:&amp;nbsp; How do you provide a customer secure remote access into a scenario?&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt; &lt;p&gt;Solution:&amp;nbsp; Smart cards and Terminal Services on Windows Server 2003! Smart cards keep the Private PKI key stored on the card, and cannot be removed from the card. It requires two-factor authentication.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;Something you have (the smart card) and something you know (the PIN).&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt; &lt;p&gt;How:&amp;nbsp; First we set up a DC (or 2).&amp;nbsp; Then install cert services on box (domain member).&amp;nbsp; Then install Terminal Services on to another box (aka the Jump box).&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt; &lt;p&gt;We are using the Microsoft Base CSP (&lt;a href="http://www.microsoft.com/resources/documentation/WindowsServ/2003/all/techref/en-us/Default.asp?url=/Resources/Documentation/windowsserv/2003/all/techref/en-us/w2k3tr_certs_how.asp"&gt;http://www.microsoft.com/resources/documentation/WindowsServ/2003/all/techref/en-us/Default.asp?url=/Resources/Documentation/windowsserv/2003/all/techref/en-us/w2k3tr_certs_how.asp&lt;/a&gt;)&amp;nbsp;on some Amtel Smart cards.&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt; &lt;p&gt;I create user accounts in the Domain for each person that will need remote access.&amp;nbsp; Each Account has a Very LONG and Very RANDOM password.&amp;nbsp; This is because the user will never use a password.&amp;nbsp; They will not be able to use their smart card.&amp;nbsp; Once the users are created make sure that you go in the properties of each user and under the Account tab select the following options: User Cannot change password, Password never expires and Smart Card is required for interactive logon.&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt; &lt;p&gt;Now create a separate Admin account.&amp;nbsp; This will be the account that I use to manage the TS (terminal Services) jump box and&amp;nbsp;issue the smart cards. Make sure it has a secure password.&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt; &lt;p&gt;To issue a smart card the issuing user account must have an Enrollment Agent Cert.&amp;nbsp; To get this cert you must first enable it on the CA.&amp;nbsp; (Open the CA MMC snapin&amp;nbsp;-&amp;gt;&amp;nbsp;select Certificate Templates -&amp;gt;&amp;nbsp;Right-click on Certificate Templates -&amp;gt; Select New -&amp;gt; Select Certificate Template to issue.&amp;nbsp; In the list select Enrollment Agent.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt; &lt;p&gt;Repeat the steps above to also add the Smart Card Logon Cert.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;This is the cert that we will put on each Smart Card.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt; &lt;p&gt;After you have enabled that cert (Enrollment Agent) you must now request it with the user account that will be issuing the Smart Cards.&amp;nbsp; So for my solution that is the separate admin account.&amp;nbsp; I will use runas.exe /u:&amp;lt;domainName&amp;gt;\&amp;lt;adminUser&amp;gt; "mmc certmgr.msc".&amp;nbsp; This will allow me to open the MMC without logging in as that user.&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt; &lt;p&gt;To request the new cert select personal -&amp;gt; right-click on personal -&amp;gt; select all tasks -&amp;gt; select Request new Cert... Once the Wizard opens select Next to start it -&amp;gt; Select Enrollment Agent -&amp;gt; Select Next -&amp;gt; Enter a Name (like SC enrollment Cert) -&amp;gt; Select Next -&amp;gt; then Select Finish to issue the cert.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt; &lt;p&gt;Now we will need to make sure we have our smart card reader installed on the machine that has our enrollment Cert and http access to the CA.&amp;nbsp; With all of the above done you can now open a web browser to http://&amp;lt;CA Machine Name&amp;gt;/certsrv/certsces.asp (note: that you might have to add this site to your trusted sites to get the Active X control to load).&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt; &lt;p&gt;From this browser window we can select the type of Cert we want to put on the Smart Card.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;We are going to use Smart Card Logon Cert.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;You will need to select the Microsoft Base Smart Card Crypto Provider as your CSP.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;The Administrator Signing Certificate is the Enrollment Cert that we requested earlier.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;At this point you can select any user in the domain to issue a smart card for.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;&lt;/p&gt; &lt;p&gt;One thing to note is that when you have a smart card for user account it does not matter if the user changes their password.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;The smart card will allow the user to be authenticated without a password.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;So make sure that you keep accounts that have the Enrollment Agent Cert secure.&lt;/p&gt; &lt;p&gt;In the future I will also write about how to use the AD to further secure the Solution.&lt;/p&gt; &lt;p&gt;Thanks for reading my first Full Blog Entry &lt;span style="FONT-FAMILY: Wingdings; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-char-type: symbol; mso-symbol-font-family: Wingdings"&gt;&lt;span style="mso-char-type: symbol; mso-symbol-font-family: Wingdings"&gt;J&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;Mike Poulson&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=279863" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/mpoulson/archive/tags/ISP/default.aspx">ISP</category><category domain="http://blogs.msdn.com/mpoulson/archive/tags/Networking/default.aspx">Networking</category><category domain="http://blogs.msdn.com/mpoulson/archive/tags/Smart+Cards/default.aspx">Smart Cards</category><category domain="http://blogs.msdn.com/mpoulson/archive/tags/Security/default.aspx">Security</category></item></channel></rss>