﻿{"id":445,"date":"2013-07-14T17:18:59","date_gmt":"2013-07-14T20:18:59","guid":{"rendered":"http:\/\/binsfeld.com.br\/wp\/?p=445"},"modified":"2013-07-14T17:19:42","modified_gmt":"2013-07-14T20:19:42","slug":"remote-desktop-over-ssl","status":"publish","type":"post","link":"http:\/\/binsfeld.com.br\/wp\/?p=445","title":{"rendered":"Remote Desktop over SSL"},"content":{"rendered":"<h2>Installing a RDP SSL Certificate<\/h2>\n<p>1. On your Microsoft certificate authority server open the Certificate Templates console.<\/p>\n<p>2. Duplicate the Computer template and use the Windows Server 2003 Enterprise format (Server 2008 v3 templates will NOT work).<\/p>\n<p>3. Change the template display name to RemoteDesktopComputer (no spaces). Verify the Template Name is exactly the same (no spaces). You can use a different name if you want, but both fields must match exactly.<\/p>\n<div><a href=\"http:\/\/binsfeld.com.br\/wp\/wp-content\/uploads\/2013\/07\/1-26-2013+4-47-37+PM.jpg\"><img loading=\"lazy\" decoding=\"async\" style=\"border: 0px;\" alt=\"\" src=\"http:\/\/www.derekseaman.com\/wp-content\/uploads\/1-26-2013+4-47-37+PM.jpg\" width=\"400\" height=\"285\" border=\"0\" \/><\/a><\/div>\n<p>4. Now we need to create an application policy to limit the usage to RDS authentication, then remove the other application uses for the certificate. On the extensions tab click on\u00a0<strong>Application Policies<\/strong>\u00a0then click on\u00a0<strong>Edit<\/strong>.<\/p>\n<p>5. Click on\u00a0<strong>Add<\/strong>, then click on\u00a0<strong>New<\/strong>.\u00a0\u00a0Set the value of Name to\u00a0<strong>Remote Desktop Authentication<\/strong>. Change the object identifier to 1.3.6.1.4.1.311.54.1.2.<\/p>\n<div><a href=\"http:\/\/binsfeld.com.br\/wp\/wp-content\/uploads\/2013\/07\/1-26-2013+4-55-20+PM.jpg\"><img loading=\"lazy\" decoding=\"async\" style=\"border: 0px;\" alt=\"\" src=\"http:\/\/www.derekseaman.com\/wp-content\/uploads\/1-26-2013+4-55-20+PM.jpg\" width=\"380\" height=\"160\" border=\"0\" \/><\/a><\/div>\n<div><\/div>\n<div>6. From the Application Policies list, select\u00a0<strong>Remote Desktop Authentication<\/strong>.<\/div>\n<div><\/div>\n<div>7. Back on the certificate template properties, remove all other entries. Only\u00a0<strong>Remote Desktop Authentication<\/strong>\u00a0should be present.<\/div>\n<div><\/div>\n<div><a href=\"http:\/\/binsfeld.com.br\/wp\/wp-content\/uploads\/2013\/07\/1-26-2013+4-56-47+PM.jpg\"><img loading=\"lazy\" decoding=\"async\" style=\"border: 0px;\" alt=\"\" src=\"http:\/\/www.derekseaman.com\/wp-content\/uploads\/1-26-2013+4-56-47+PM.jpg\" width=\"294\" height=\"145\" border=\"0\" \/><\/a><\/div>\n<div><\/div>\n<div>8. If you wish, you can modify the validity period of the certificate, making it say two years instead of the default of one.<\/div>\n<div><\/div>\n<div>9. You probably want to secure your domain controllers as well, so for that we need to modify the security setting on the template. Open the Security tab and add the group\u00a0<strong>Domain Controllers<\/strong>and give the group\u00a0<strong>Read<\/strong>\u00a0and\u00a0<strong>Enroll<\/strong>\u00a0(not Autoenroll).<\/div>\n<div><\/div>\n<div><a href=\"http:\/\/binsfeld.com.br\/wp\/wp-content\/uploads\/2013\/07\/1-26-2013+5-06-57+PM.jpg\"><img loading=\"lazy\" decoding=\"async\" style=\"border: 0px;\" alt=\"\" src=\"http:\/\/www.derekseaman.com\/wp-content\/uploads\/1-26-2013+5-06-57+PM.jpg\" width=\"398\" height=\"378\" border=\"0\" \/><\/a><\/div>\n<div><\/div>\n<div><\/div>\n<div>10. Open the MMC snap-in for managing your Certificate Authority and locate the\u00a0<strong>Certificate Templates<\/strong>\u00a0node. Right click, select\u00a0<strong>New<\/strong>, then\u00a0<strong>Certificate Template to Issue<\/strong>. Choose the<strong>RemoteDesktopComputer<\/strong>\u00a0template.<\/div>\n<div><\/div>\n<div><a href=\"http:\/\/binsfeld.com.br\/wp\/wp-content\/uploads\/2013\/07\/1-26-2013+5-01-11+PM.jpg\"><img loading=\"lazy\" decoding=\"async\" style=\"border: 0px;\" alt=\"\" src=\"http:\/\/www.derekseaman.com\/wp-content\/uploads\/1-26-2013+5-01-11+PM.jpg\" width=\"433\" height=\"270\" border=\"0\" \/><\/a><\/div>\n<div><\/div>\n<div>11. Next up is configuring the GPO to utilize the new template. You can modify any GPO you wish, or create a new one. Obviously the scope of the GPO should cover any servers that you want to secure with TLS. This could be a server baseline GPO, domain GPO, or whatever you want.<\/div>\n<div><\/div>\n<div><\/div>\n<div>12. In the GPO editor locate the node\u00a0<strong>Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Session HostSecurity<\/strong>. Modify the\u00a0<strong>Server Authentication Certificate Template<\/strong>\u00a0setting. Enable the policy and enter the certificate template name that exactly matches what you created in your CA.<\/div>\n<div><\/div>\n<div><a href=\"http:\/\/binsfeld.com.br\/wp\/wp-content\/uploads\/2013\/07\/1-26-2013+5-10-07+PM.jpg\"><img loading=\"lazy\" decoding=\"async\" style=\"border: 0px;\" alt=\"\" src=\"http:\/\/www.derekseaman.com\/wp-content\/uploads\/1-26-2013+5-10-07+PM.jpg\" width=\"640\" height=\"295\" border=\"0\" \/><\/a><\/div>\n<div><\/div>\n<div><\/div>\n<p>13. In the same GPO node, configure the\u00a0<strong>Require use of specific security layer for remote (RDP) connections\u00a0<\/strong>to use SSL (TLS 1.0).<\/p>\n<div><a href=\"http:\/\/binsfeld.com.br\/wp\/wp-content\/uploads\/2013\/07\/1-26-2013+5-17-51+PM.jpg\"><img loading=\"lazy\" decoding=\"async\" style=\"border: 0px;\" alt=\"\" src=\"http:\/\/www.derekseaman.com\/wp-content\/uploads\/1-26-2013+5-17-51+PM.jpg\" width=\"640\" height=\"286\" border=\"0\" \/><\/a><\/div>\n<p>14. Wait for the GPO to replicate, then refresh the GPO on a test server. Wait a minute, then open the Certificates MMC snap-in for the computer account. Look in the\u00a0<strong>PersonalCertificates<\/strong>\u00a0store for a certificate that has the\u00a0<strong>Intended Purposes<\/strong>\u00a0of\u00a0<strong>Remote Desktop Authentication<\/strong>. If it\u2019s not there, wait a minute, and refresh. If it never appears, something is wrong. Look at the gpresult to make sure your GPO is being applied to the server.<\/p>\n<div><a href=\"http:\/\/binsfeld.com.br\/wp\/wp-content\/uploads\/2013\/07\/1-26-2013+5-15-40+PM.jpg\"><img loading=\"lazy\" decoding=\"async\" style=\"border: 0px;\" alt=\"\" src=\"http:\/\/www.derekseaman.com\/wp-content\/uploads\/1-26-2013+5-15-40+PM.jpg\" width=\"640\" height=\"58\" border=\"0\" \/><\/a><\/div>\n<p>15. Once the certificate appears, double click on the certificate to open it. On the\u00a0<strong>Details<\/strong>\u00a0tab look at the first few characters of the thumbprint value and remember them.<\/p>\n<p>16. To make sure the RDP service is aware of the new certificate, I restart the\u00a0<strong>Remote Desktop Services<\/strong>\u00a0service.<\/p>\n<p>17. Open an elevated PowerShell prompt and run this command:<\/p>\n<p>Get-WmiObject -class \u201cWin32_TSGeneralSetting\u201d -Namespace root\\cimv2\\terminalservices -Filter \u201cTerminalName=\u2019RDP-tcp\u2019\u201d<\/p>\n<p>Validate that the\u00a0<strong>Security Layer<\/strong>\u00a0value is\u00a0<strong>2<\/strong>\u00a0and that the thumbprint matches the certificate. If both of those settings are correct, then you are good to go!<\/p>\n<div><a href=\"http:\/\/binsfeld.com.br\/wp\/wp-content\/uploads\/2013\/07\/1-26-2013+5-20-03+PM.jpg\"><img loading=\"lazy\" decoding=\"async\" style=\"border: 0px;\" alt=\"\" src=\"http:\/\/www.derekseaman.com\/wp-content\/uploads\/1-26-2013+5-20-03+PM.jpg\" width=\"640\" height=\"350\" border=\"0\" \/><\/a><\/div>\n<p>As a quick test I attempted to connect to this server from a non-domain joined computer that did not have the root certificate for my CA. I configured the RDP client to warn on any security issues. As expected, the client threw errors about the CRL not being available, and that it didn\u2019t trust the chain. I also viewed the certificate and verified it was the correct one.<\/p>\n<p>It seems Windows 8 has much more stringent certificate checking than Windows 7. The screenshots below are from Windows 7, in case you didn\u2019t recognize the chrome. When using a Windows 7 non-domain joined computer to access the same TLS protected server, I got NO certificate warnings. That was even with the RDP 8 add-on hotfix. I\u2019m glad to see Win8 does thorough certificate validation.<\/p>\n<div><a href=\"http:\/\/binsfeld.com.br\/wp\/wp-content\/uploads\/2013\/07\/1-26-2013+5-51-59+PM.jpg\"><img loading=\"lazy\" decoding=\"async\" style=\"border: 0px;\" alt=\"\" src=\"http:\/\/www.derekseaman.com\/wp-content\/uploads\/1-26-2013+5-51-59+PM.jpg\" width=\"406\" height=\"408\" border=\"0\" \/><\/a><\/div>\n<div><a href=\"http:\/\/binsfeld.com.br\/wp\/wp-content\/uploads\/2013\/07\/1-26-2013+5-53-20+PM.jpg\"><img loading=\"lazy\" decoding=\"async\" style=\"border: 0px;\" alt=\"\" src=\"http:\/\/www.derekseaman.com\/wp-content\/uploads\/1-26-2013+5-53-20+PM.jpg\" width=\"419\" height=\"522\" border=\"0\" \/><\/a><\/div>\n<p>Connecting to the same server from a domain-joined computer that trusted the root CA resulted in no security warnings and a successful connection. If you look at a Wireshark capture you can also validate that CRL information is being exchanged between the computers, which means TLS is being used.<\/p>\n<div><a href=\"http:\/\/binsfeld.com.br\/wp\/wp-content\/uploads\/2013\/07\/1-26-2013+5-55-24+PM.jpg\"><img loading=\"lazy\" decoding=\"async\" style=\"border: 0px;\" alt=\"\" src=\"http:\/\/www.derekseaman.com\/wp-content\/uploads\/1-26-2013+5-55-24+PM.jpg\" width=\"640\" height=\"106\" border=\"0\" \/><br \/>\n<\/a><\/div>\n<p>Cr\u00e9ditos:\u00a0<a href=\"http:\/\/www.derekseaman.com\/2013\/01\/creating-custom-remote-desktop-services.html\">http:\/\/www.derekseaman.com\/2013\/01\/creating-custom-remote-desktop-services.html<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Installing a RDP SSL Certificate 1. On your Microsoft certificate authority server open the Certificate Templates console. 2. Duplicate the Computer template and use the Windows Server 2003 Enterprise format<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-445","post","type-post","status-publish","format-standard","hentry","category-windows-server"],"_links":{"self":[{"href":"http:\/\/binsfeld.com.br\/wp\/index.php?rest_route=\/wp\/v2\/posts\/445"}],"collection":[{"href":"http:\/\/binsfeld.com.br\/wp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/binsfeld.com.br\/wp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/binsfeld.com.br\/wp\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/binsfeld.com.br\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=445"}],"version-history":[{"count":2,"href":"http:\/\/binsfeld.com.br\/wp\/index.php?rest_route=\/wp\/v2\/posts\/445\/revisions"}],"predecessor-version":[{"id":459,"href":"http:\/\/binsfeld.com.br\/wp\/index.php?rest_route=\/wp\/v2\/posts\/445\/revisions\/459"}],"wp:attachment":[{"href":"http:\/\/binsfeld.com.br\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=445"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/binsfeld.com.br\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=445"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/binsfeld.com.br\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=445"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}