<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>Paranoid Humanoid</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/paranoidhumanoid/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/paranoidhumanoid/feed.xml</link>
    <description>I&amp;#039;m a Premier Field Engineer with Microsoft and these are my mutterings about security and identity management on the intertubes</description>
    <lastBuildDate>Wed, 17 Apr 2019 03:44:41 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>A Snippet of Security</title>
      <link>https://docs.microsoft.com/archive/blogs/paranoidhumanoid/a-snippet-of-security</link>
      <pubDate>Fri, 16 Oct 2015 04:57:00 GMT</pubDate>
      <dc:creator><![CDATA[Chris W Ayres [MSFT]]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/paranoidhumanoid/2015/10/16/a-snippet-of-security/</guid>
      <description><![CDATA[Hey Everyone, further to my post on Group Policy and AD last week I want to follow up with a post on...]]></description>
      <content:encoded><![CDATA[<p>Hey Everyone, further to my post on Group Policy and AD <a href="https://axis.microsoft.com/OOF/OOFView.aspxhttp:/blogs.technet.com/b/paranoidhumanoid/archive/2015/10/08/a-smattering-of-group-policy-and-modicum-of-ad.aspx"><span style="color:#0000ff;">last week</span></a> I want to follow up with a post on Security.</p>
<p></p>
<p>When I&rsquo;m out on site with customers doing risk assessments we always see the same risks being raised, mainly about the following topics:</p>
<ul>
<li>
<p>Servers, especially DCs not being patched. For example we see <a href="https://technet.microsoft.com/en-us/library/security/ms14-068.aspx"><span style="color:#0000ff;">MS14-068</span></a> missing on domain controllers in many customer environments. This patch (among others) is critical and was released in late 2014 &ndash; nearly 1 year ago. Please check your environment for missing patches.</p>
</li>
<li>
<p>Too many members in the highly privileged admins groups &ndash; this one always flags and is down to there being too many people in Enterprise Admins and Domain Admins groups permanently or service accounts being a member of these groups</p>
</li>
<li>
<p>High privilege users have password never expires set</p>
</li>
<li>
<p>Stale user and computer accounts &ndash; very easy for attackers to compromise these accounts and stay unnoticed in an environment</p>
</li>
<li>
<p>No configuration baseline or standard build for servers, especially DCs, therefore allowing unneeded, unwanted and potentially malicious software to run</p>
</li>
<li>
<p>Allowing internet access from servers, particularly DCs</p>
</li>
<li>
<p>Security baselines and basic security configuration not being done, such as restricting logon types to service accounts, restricting RDP access, other User Rights Assignment not being configured and the advanced firewall not being configured</p>
</li>
</ul>
<p>It may seem too hard to solve some of these issues, however locking down these areas will significantly improve your overall security. It&rsquo;s still a cat and mouse game but you should be trying to make this as hard as possible for the attackers and you really do need to make the investments financially and in the resource to implement and maintain these things.</p>
<p>&nbsp;</p>
<p>This post will have links to Microsoft&rsquo;s current recommended practice when it comes to security, mainly focussed on the identity space. Again, this post may evolve over time so please use as a reference point and check back.</p>
<p>&nbsp;</p>
<p>A Snippet of Security as it relates to identity:</p>
<p>&nbsp;</p>
<p><b>Immutable laws of Security</b></p>
<p>The following two links provide the 10 immutable laws of security V1 and V2, some great reference material for your CIO:</p>
<p><a href="https://technet.microsoft.com/library/cc722487.aspx"><span style="color:#0000ff;">https://technet.microsoft.com/library/cc722487.aspx</span></a></p>
<p><a href="https://technet.microsoft.com/en-us/library/hh278941.aspx"><span style="color:#0000ff;">https://technet.microsoft.com/en-us/library/hh278941.aspx</span></a></p>
<p>&nbsp;</p>
<p>Also, see this link for some general links around Windows Security:</p>
<p><a href="https://technet.microsoft.com/en-us/library/windows-server-security.aspx"><span style="color:#0000ff;">https://technet.microsoft.com/en-us/library/windows-server-security.aspx</span></a></p>
<p><b>&nbsp;</b></p>
<p><b>Active Directory</b></p>
<p>The bible when it comes to AD security is the &ldquo;Best Practices for AD Security&rdquo; whitepaper written by MSIT and Microsoft consultants. This document includes all of the best practices for proactively managing and securing your directory based on experience from several security CritSits, AD Security Assessments and breaches of Microsoft customers. You should be looking to align your environment as best you can with these recommendations:</p>
<p><a href="http://www.microsoft.com/en-gb/download/details.aspx?id=38785"><span style="color:#0000ff;">http://www.microsoft.com/en-gb/download/details.aspx?id=38785</span></a></p>
<p>Another great document to reference is the Threats and Countermeasures guide:</p>
<p><a href="https://technet.microsoft.com/en-us/library/hh125921(WS.10).aspx"><span style="color:#0000ff;">https://technet.microsoft.com/en-us/library/hh125921(WS.10).aspx</span></a></p>
<p><span style="text-decoration:underline;"><span style="color:#0000ff;">&nbsp;</span></span></p>
<p><b>Credential Theft</b></p>
<p>Credential theft became a big problem a few years ago when Pass the hash attacks became prevalent. Although PtH has been around for many years it is only in recent years that tooling has been feely available that makes these attacks trivial to undertake. Although the PtH &ldquo;vulnerability&rdquo; cannot be fixed with an update there are plenty of mitigations to put in place and these are documented in the excellent PtH whitepapers which are a must read for any security admin:</p>
<p><a href="https://www.microsoft.com/en-gb/download/details.aspx?id=36036"><span style="color:#0000ff;">https://www.microsoft.com/en-gb/download/details.aspx?id=36036</span></a></p>
<p>It should be noted that by mitigating these risks isn&rsquo;t a panacea for security as the credential thieves will just use other techniques, but it does help address the <b>low hanging fruit</b>. There I said it, low hanging fruit J. Let&rsquo;s see what other buzz terms I can drop in&hellip;</p>
<p>It&rsquo;s also worth checking out the new Windows 10 feature call Credential Guard which also helps mitigate credential theft, again not a panacea but certainly <b>raises the bar</b>. There&rsquo;s another one J</p>
<p><a href="https://technet.microsoft.com/en-us/library/mt483740(v=vs.85).aspx"><span style="color:#0000ff;">https://technet.microsoft.com/en-us/library/mt483740(v=vs.85).aspx</span></a></p>
<p>&nbsp;</p>
<p><b>Accounts Security</b></p>
<p>Managing the security of accounts such as service accounts and accounts is paramount to the environments security as these accounts are usually high value targets for attackers. When using these accounts, the principle of least privilege should be used. Some guidance does exist on this and can be found here for service accounts:</p>
<p><a href="https://technet.microsoft.com/en-us/library/cc170953.aspx"><span style="color:#0000ff;">https://technet.microsoft.com/en-us/library/cc170953.aspx</span></a></p>
<p>And here for admin accounts:</p>
<p><a href="https://technet.microsoft.com/en-us/library/cc162797.aspx"><span style="color:#0000ff;">https://technet.microsoft.com/en-us/library/cc162797.aspx</span></a></p>
<p>When looking at service accounts it is also worth seeing if you can invest into Group Managed Service Accounts, introduced with Server 2012:</p>
<p><a href="https://technet.microsoft.com/en-GB/library/hh831782.aspx"><span style="color:#0000ff;">https://technet.microsoft.com/en-GB/library/hh831782.aspx</span></a></p>
<p>Lastly, check out the Best Practices for Delegating Active Directory Administration guide:</p>
<p><a href="http://www.microsoft.com/en-gb/download/details.aspx?id=21678"><span style="color:#0000ff;">http://www.microsoft.com/en-gb/download/details.aspx?id=21678</span></a></p>
<p>&nbsp;</p>
<p><b>PAM/JIT</b></p>
<p>Privileged Account Management and Just in Time elevation is quite big at the minute and managing accounts with high levels of access in the environment (either admin or VIP accounts) is crucial to maintaining good security posture. Therefore, Microsoft have implemented a PAM feature into Windows Server vNext and JIT feature into MIM 2016. Check this post for info on this:</p>
<p><a href="https://technet.microsoft.com/en-us/library/dn903243.aspx"><span style="color:#0000ff;">https://technet.microsoft.com/en-us/library/dn903243.aspx</span></a></p>
<p>Also, our very own PoSH Chap Ian Farr has a good post on JIT using PowerShell and some of the built in features on Windows Server 2012:</p>
<p><a href="/b/poshchap/archive/2015/05/29/latest-hsgb-outings-just-in-time-jit-administration.aspx"><span style="color:#0000ff;">http://blogs.technet.com/b/poshchap/archive/2015/05/29/latest-hsgb-outings-just-in-time-jit-administration.aspx</span></a></p>
<p>&nbsp;</p>
<p><b>Proactive Monitoring and Detection</b></p>
<p>One of the key aspects of security is to perform monitoring, but also have the correct alerts in place tuned for your environment so you can use them to detect any attack or compromise. This guide will help you create this:</p>
<p><a href="https://technet.microsoft.com/en-us/library/cc163158.aspx"><span style="color:#0000ff;">https://technet.microsoft.com/en-us/library/cc163158.aspx</span></a></p>
<p>&nbsp;</p>
<p><b>Defining a Security Baseline:</b></p>
<p>You should have a security baseline in your environment for DCs, member servers and workstations such that you are blocking some legacy security protocols, blocking certain logon types for certain users, configuring the Windows firewall and services such as AppLocker. The Security Compliance Manager tool can help you with this:</p>
<p><a href="https://technet.microsoft.com/en-gb/solutionaccelerators/cc835245.aspx"><span style="color:#0000ff;">https://technet.microsoft.com/en-gb/solutionaccelerators/cc835245.aspx</span></a></p>
<p><b>&nbsp;</b></p>
<p><b>PKI</b></p>
<p>As you know from reading my blog PKI is my passion and the security around PKI including designing key signing ceremonies and secure implementations is what I specialised in before joining Microsoft. I&rsquo;ve touched on some of the security aspects of PKI in my non-repudiation and offline CA virtualisation posts here:</p>
<p><a href="/b/paranoidhumanoid/archive/2015/10/04/non-repudiation.aspx"><span style="color:#0000ff;">http://blogs.technet.com/b/paranoidhumanoid/archive/2015/10/04/non-repudiation.aspx</span></a></p>
<p><a href="/b/paranoidhumanoid/archive/2015/09/25/should-i-virtualise-my-root-ca.aspx"><span style="color:#0000ff;">http://blogs.technet.com/b/paranoidhumanoid/archive/2015/09/25/should-i-virtualise-my-root-ca.aspx</span></a></p>
<p>Further to my postings there is also the Securing PKI whitepaper which is very good:</p>
<p><a href="https://technet.microsoft.com/en-us/library/dn786443.aspx"><span style="color:#0000ff;">https://technet.microsoft.com/en-us/library/dn786443.aspx</span></a></p>
<p>&nbsp;</p>
<p><span style="font-family:Times New Roman;font-size:medium;"> </span>There are plenty of other reference guides and links that you can use, however the above will give you a starter for ten and plenty of bed time reading!</p>]]></content:encoded>
    </item>
    <item>
      <title>A Smattering of Group Policy and Modicum of AD</title>
      <link>https://docs.microsoft.com/archive/blogs/paranoidhumanoid/a-smattering-of-group-policy-and-modicum-of-ad</link>
      <pubDate>Thu, 08 Oct 2015 15:17:00 GMT</pubDate>
      <dc:creator><![CDATA[Chris W Ayres [MSFT]]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/paranoidhumanoid/2015/10/08/a-smattering-of-group-policy-and-modicum-of-ad/</guid>
      <description><![CDATA[Hey Everyone, I&rsquo;ve been doing a lot of risk assessments and knowledge transfer sessions...]]></description>
      <content:encoded><![CDATA[<p>Hey Everyone, I&rsquo;ve been doing a lot of risk assessments and knowledge transfer sessions recently for Group Policy and AD for UK Premier customers. I&rsquo;ve been finding that a lot of customers have the same issues or want more information on the same concepts. I normally follow up individually with each customer to send them further reading or extra info, so I&rsquo;ve decided to put&nbsp;all of&nbsp;these handy links into one blog post so I have one reference point to then send on to customers. I will carry on updating this list over time if and when I want to share more reference material, so check back! If you have any other suggestions, then feel free to pop them into the comments.</p>
<p>So here it is, loads of Group Policy and AD goodness here for your reference:</p>
<p><b>&nbsp;</b></p>
<p><b>Stale Groups and Group Memberships</b></p>
<p>Use these scripts to identify groups with common members and also where these groups are assigned permissions on file shares.</p>
<p><a href="/b/ashleymcglone/archive/2014/03/14/using-powershell-to-find-stale-and-duplicate-active-directory-groups.aspx"><span style="color:#0000ff;">http://blogs.technet.com/b/ashleymcglone/archive/2014/03/14/using-powershell-to-find-stale-and-duplicate-active-directory-groups.aspx</span></a></p>
<p><a href="/b/ashleymcglone/archive/2014/03/17/powershell-to-find-where-your-active-directory-groups-are-used-on-file-shares.aspx"><span style="color:#0000ff;">http://blogs.technet.com/b/ashleymcglone/archive/2014/03/17/powershell-to-find-where-your-active-directory-groups-are-used-on-file-shares.aspx</span></a></p>
<p>&nbsp;</p>
<p><b>AD ACL Scanner</b></p>
<p>This PowerShell script is written by Robin Granberg, a Swedish PFE, who is the king when it comes to all things AD permission related and custom AD delegation. He is also one of the architects of the Premier POP&ndash;AD Delegation offering where we can help you implement a role based access control model in your environment, if you&rsquo;re interested and are a Premier customer speak to you TAM!</p>
<p><a href="https://adaclscan.codeplex.com/"><span style="color:#0000ff;">https://adaclscan.codeplex.com/</span></a></p>
<p>&nbsp;</p>
<p><b>GPO Debug Logging</b></p>
<p>Enabling GPO Debug Logging:</p>
<p><a href="/b/mempson/archive/2010/01/10/userenvlog-for-windows-vista-2008-win7.aspx"><span style="color:#0000ff;">http://blogs.technet.com/b/mempson/archive/2010/01/10/userenvlog-for-windows-vista-2008-win7.aspx</span></a></p>
<p>Parsing the GPSvc log:</p>
<p><a href="/b/askds/archive/2015/04/17/a-treatise-on-group-policy-troubleshooting-now-with-gpsvc-log-analysis.aspx"><span style="color:#0000ff;">http://blogs.technet.com/b/askds/archive/2015/04/17/a-treatise-on-group-policy-troubleshooting-now-with-gpsvc-log-analysis.aspx</span></a></p>
<p>Enabling CSE Debug Logging</p>
<p><a href="https://technet.microsoft.com/en-us/library/cc759167(v=ws.10).aspx"><span style="color:#0000ff;">https://technet.microsoft.com/en-us/library/cc759167(v=ws.10).aspx</span></a></p>
<p><a href="/b/askds/archive/2008/07/18/enabling-group-policy-preferences-debug-logging-using-the-rsat.aspx"><span style="color:#0000ff;">http://blogs.technet.com/b/askds/archive/2008/07/18/enabling-group-policy-preferences-debug-logging-using-the-rsat.aspx</span></a></p>
<p>Use this tool to parse the event viewer for Group Policy related events:</p>
<p><a href="/b/grouppolicy/archive/2007/02/08/gplogview.aspx"><span style="color:#0000ff;">http://blogs.technet.com/b/grouppolicy/archive/2007/02/08/gplogview.aspx</span></a></p>
<p>&nbsp;</p>
<p><b>List of Client Side Extensions</b></p>
<p>Group Policy Client Side Extensions can be a bit of a mystery because they are not very well documented. There isn&rsquo;t one list in Microsoft where we can refer to each GPO setting and the CSE that is responsible for configuring it at the client side. The reason for this is because each product group is responsible for providing the Group Policy team with the settings and the client code to implement them in the form of a CSE. Group Policy is just the vessel for distributing these settings, it is not necessarily responsible for each of the settings, hence we don&rsquo;t have a definitive list. However, never fear as Mark Empson, also known as Captain GPO, has documented some of the CSEs for us and what their GUIDs are:</p>
<p><a href="/b/mempson/archive/2010/12/01/group-policy-client-side-extension-list.aspx"><span style="color:#0000ff;">http://blogs.technet.com/b/mempson/archive/2010/12/01/group-policy-client-side-extension-list.aspx</span></a></p>
<p>&nbsp;</p>
<p><b>Slow Boot Slow Logon &ndash; are GPOs to Blame?</b></p>
<p>This isn&rsquo;t technically related to AD and GPOs, however a lot of the time Group Policy gets blamed for slow booting and login times for user&rsquo;s machines which is why I&rsquo;ve included it here. If you read the Ask PFE Platforms blog, you are probably familiar with the series they did on SBSL, if not then you should be reading it! They talk through using Xperf and then Windows Performance Analyser for assessing boot times in Windows, this is mandatory reading for any client admins out there:</p>
<p><a href="/b/askpfeplat/archive/tags/sbsl/"><span style="color:#0000ff;">http://blogs.technet.com/b/askpfeplat/archive/tags/sbsl/</span></a></p>
<p>Folder redirection and roaming user profiles can eat up the seconds during logon for users, especially if you have slow storage or latency on the network. Can you replace folder redirection and RUP in your environment? Maybe. If you are licensed for MDOP then check out UE-V, it may fit your requirements:</p>
<p><a href="https://technet.microsoft.com/en-us/windows/hh943107.aspx"><span style="color:#0000ff;">https://technet.microsoft.com/en-us/windows/hh943107.aspx</span></a></p>
<p>Start-up scripts are also another culprit of slow boot times, check out this post to see if you can replace your scripts:</p>
<p><a href="/b/askpfeplat/archive/2015/04/27/the-startup-script-is-dead.aspx"><span style="color:#0000ff;">http://blogs.technet.com/b/askpfeplat/archive/2015/04/27/the-startup-script-is-dead.aspx</span></a></p>
<p>If you can replace the old login script which performs drive maps using Group Policy Preferences, then check out this post which will help you configure it:</p>
<p><a href="/b/askds/archive/2009/01/07/using-group-policy-preferences-to-map-drives-based-on-group-membership.aspx"><span style="color:#0000ff;">http://blogs.technet.com/b/askds/archive/2009/01/07/using-group-policy-preferences-to-map-drives-based-on-group-membership.aspx</span></a></p>
<p>Further to above posts see some general guidance on group policy and logon times:</p>
<p><a href="/b/grouppolicy/archive/2013/05/23/group-policy-and-logon-impact.aspx"><span style="color:#0000ff;">http://blogs.technet.com/b/grouppolicy/archive/2013/05/23/group-policy-and-logon-impact.aspx</span></a></p>
<p>&nbsp;</p>
<p><b>Consolidate Policies</b></p>
<p>The following PowerShell script can be used to merge policies where you are trying to consolidate:</p>
<p><a href="/b/ashleymcglone/archive/2011/01/19/finally-copy-and-merge-gpos-powershell-saves-the-day.aspx"><span style="color:#0000ff;">http://blogs.technet.com/b/ashleymcglone/archive/2011/01/19/finally-copy-and-merge-gpos-powershell-saves-the-day.aspx</span></a></p>
<p>&nbsp;</p>
<p><b>Central Store</b></p>
<p>Have you implemented the Group Policy Central Store? If not check out this article:</p>
<p><a href="/b/askpfeplat/archive/2011/12/12/how-to-implement-the-central-store-for-group-policy-admin-templates-completely-hint-remove-those-adm-files.aspx"><span style="color:#0000ff;">http://blogs.technet.com/b/askpfeplat/archive/2011/12/12/how-to-implement-the-central-store-for-group-policy-admin-templates-completely-hint-remove-those-adm-files.aspx</span></a></p>
<p>If you have implemented it, are you having issues due to inconsistencies with ADMX versions and deprecated settings? If so, check out this hotfix which allows you to override the Central Store on a particular machine:</p>
<p><a href="https://support.microsoft.com/en-us/kb/2917033"><span style="color:#0000ff;">https://support.microsoft.com/en-us/kb/2917033</span></a></p>
<p>Execute those legacy ADM files from your SYSVOL using this article and script:</p>
<p><a href="/b/askpfeplat/archive/2012/03/14/central-store-and-adm-removal-q-amp-a-with-an-updated-script.aspx"><span style="color:#0000ff;">http://blogs.technet.com/b/askpfeplat/archive/2012/03/14/central-store-and-adm-removal-q-amp-a-with-an-updated-script.aspx</span></a></p>
<p>&nbsp;</p>
<p><b>Backup, Backup, Backup!!!</b></p>
<p>Do you backup your AD, probably yes. Do you have a full forest recovery and disaster recovery plan, probably not. So many customers neglect the need to have a fully tested and robust disaster recovery plan in place for AD and GPOs. AD usually underpins your whole environment; you MUST create a DR plan for it! Go through the Forest Recovery whitepaper on TechNet and create one if you haven&rsquo;t got one already:</p>
<p><a href="https://technet.microsoft.com/en-us/library/planning-active-directory-forest-recovery(v=ws.10).aspx"><span style="color:#0000ff;">https://technet.microsoft.com/en-us/library/planning-active-directory-forest-recovery(v=ws.10).aspx</span></a></p>
<p>With regards to GPOs, these will be included in your DR plan when you have it but most customers don&rsquo;t take backups of their GPOs properly. Our very own PoSH Chap Ian Farr can help us out here: <a href="/b/poshchap/archive/2014/04/25/comprehensive-gpo-backup-script.aspx"><span style="color:#0000ff;">http://blogs.technet.com/b/poshchap/archive/2014/04/25/comprehensive-gpo-backup-script.aspx</span></a></p>
<p>Again, if you are Premier customer we have an engagement which can help you create your DR plan, ask your TAM about an AD Recovery Execution Service (ADRES).</p>
<p>&nbsp;</p>
<p><b>DNS</b></p>
<p>So many customer do not enable scavenging on their DNS zones, or have it miss-configured, please see this article for information on how to configure DNS scavenging: <a href="/b/networking/archive/2008/03/19/don-t-be-afraid-of-dns-scavenging-just-be-patient.aspx"><span style="color:#0000ff;">http://blogs.technet.com/b/networking/archive/2008/03/19/don-t-be-afraid-of-dns-scavenging-just-be-patient.aspx</span></a></p>
<p>Have you upgraded your environment from Windows 2000 to 2003 to 2008 onwards? If so, did you migrate your _msdcs zone into the application partition? If you didn&rsquo;t then you should, this still gets picked up in some customer environments today. Please see this article for information on how to configure the _msdcs zone to be in the forestdnszones app partition: <a href="https://support.microsoft.com/en-us/kb/817470"><span style="color:#0000ff;">https://support.microsoft.com/en-us/kb/817470</span></a></p>
<p>Have you configured secure dynamic updates on your DNS zone? This is another one which comes up on the risk assessments quite a lot, see the following article for info on secure updates:</p>
<p><a href="https://technet.microsoft.com/en-us/library/cc961412.aspx"><span style="color:#0000ff;">https://technet.microsoft.com/en-us/library/cc961412.aspx</span></a><span style="text-decoration:underline;"><span style="color:#0000ff;"> </span></span></p>
<p>&nbsp;</p>
<p><b>AD Replication</b></p>
<p>Lingering objects are an issue in many environments, you need to remove these and fix your replication for a healthy directory:</p>
<p><a href="/b/askds/archive/2014/09/15/remove-lingering-objects-that-cause-ad-replication-error-8606-and-friends.aspx"><span style="color:#0000ff;">http://blogs.technet.com/b/askds/archive/2014/09/15/remove-lingering-objects-that-cause-ad-replication-error-8606-and-friends.aspx</span></a></p>
<p>A nice tool to monitor AD replication:</p>
<p><a href="/b/askds/archive/2012/08/23/ad-replication-status-tool-is-live.aspx"><span style="color:#0000ff;">http://blogs.technet.com/b/askds/archive/2012/08/23/ad-replication-status-tool-is-live.aspx</span></a></p>
<p>If you&rsquo;re feeling conflicted, then check out another post from PoSH Chap:</p>
<p><a href="/b/poshchap/archive/2015/03/27/one-liner-use-powershell-to-find-forest-conflict-objects.aspx"><span style="color:#0000ff;">http://blogs.technet.com/b/poshchap/archive/2015/03/27/one-liner-use-powershell-to-find-forest-conflict-objects.aspx</span></a></p>
<p>&nbsp;</p>
<p><b>Time Configuration</b></p>
<p>Many customers do not consistently configure their Root PDCe to point to an external time source. Follow this article to do this automatically with Group Policy:</p>
<p><a href="/b/nepapfe/archive/2013/03/01/it-s-simple-time-configuration-in-active-directory.aspx"><span style="color:#0000ff;">http://blogs.technet.com/b/nepapfe/archive/2013/03/01/it-s-simple-time-configuration-in-active-directory.aspx</span></a></p>
<p>Stop devastating time drifts in your directory by configuring the max negative and positive phase correction values, again this is missed by many customers:</p>
<p><a href="/b/askpfeplat/archive/2012/11/23/fixing-when-your-domain-traveled-back-in-time-the-great-system-time-rollback-to-the-year-2000.aspx"><span style="color:#0000ff;">http://blogs.technet.com/b/askpfeplat/archive/2012/11/23/fixing-when-your-domain-traveled-back-in-time-the-great-system-time-rollback-to-the-year-2000.aspx</span></a></p>
<p>&nbsp;</p>
<p><b>Post 2003 Eradication</b></p>
<p>Have you finally got rid of that last 2003 domain controller in your environment? If so, then make sure you perform the post upgrade tasks and don&rsquo;t just close the project down:</p>
<p>Raise the DFL and FFL:</p>
<p><a href="/b/askds/archive/2011/06/14/what-is-the-impact-of-upgrading-the-domain-or-forest-functional-level.aspx"><span style="color:#0000ff;">http://blogs.technet.com/b/askds/archive/2011/06/14/what-is-the-impact-of-upgrading-the-domain-or-forest-functional-level.aspx</span></a></p>
<p>Migrate SYSVOL to DFSr</p>
<p><a href="/b/filecab/archive/2014/06/25/streamlined-migration-of-frs-to-dfsr-sysvol.aspx"><span style="color:#0000ff;">http://blogs.technet.com/b/filecab/archive/2014/06/25/streamlined-migration-of-frs-to-dfsr-sysvol.aspx</span></a></p>
<p>Make use of the AD Recycle Bin:</p>
<p><a href="/b/canitpro/archive/2014/05/01/step-by-step-enabling-active-directory-recycle-bin-in-windows-server-2012.aspx"><span style="color:#0000ff;">http://blogs.technet.com/b/canitpro/archive/2014/05/01/step-by-step-enabling-active-directory-recycle-bin-in-windows-server-2012.aspx</span></a></p>
<p>Enable the GPO Central Store as discussed above.</p>
<p>&nbsp;</p>
<p><b>Sites and Subnets:</b></p>
<p>Pretty much every single risk assessment I run the issue of missing subnets gets flagged, use this script to collect missing subnets in AD:</p>
<p><a href="https://gallery.technet.microsoft.com/scriptcenter/Collect-Active-Directory-fa4dff2e"><span style="color:#0000ff;">https://gallery.technet.microsoft.com/scriptcenter/Collect-Active-Directory-fa4dff2e</span></a></p>
<p>&nbsp;</p>
<p><b>Authentication</b></p>
<p>Having problems with Kerberos? It could be down to duplicate SPNs and UPNs, check this script to find those duplicates:</p>
<p><a href="https://gallery.technet.microsoft.com/scriptcenter/Find-Specific-or-Duplicate-b9c04d01"><span style="color:#0000ff;">https://gallery.technet.microsoft.com/scriptcenter/Find-Specific-or-Duplicate-b9c04d01</span></a></p>
<p>Are you suffering from token bloat? If so removing sIDHistory data may help, use this script:</p>
<p><a href="/b/ashleymcglone/archive/2011/11/23/how-to-remove-sid-history-with-powershell.aspx"><span style="color:#0000ff;">http://blogs.technet.com/b/ashleymcglone/archive/2011/11/23/how-to-remove-sid-history-with-powershell.aspx</span></a></p>
<p><span style="text-decoration:underline;"><span style="color:#0000ff;">&nbsp;</span></span></p>
<p>&nbsp;</p>
<p></p>]]></content:encoded>
    </item>
    <item>
      <title>Non-Repudiation</title>
      <link>https://docs.microsoft.com/archive/blogs/paranoidhumanoid/non-repudiation</link>
      <pubDate>Sun, 04 Oct 2015 06:49:00 GMT</pubDate>
      <dc:creator><![CDATA[Chris W Ayres [MSFT]]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/paranoidhumanoid/2015/10/04/non-repudiation/</guid>
      <description><![CDATA[Hi Everyone, today I wanted to follow up on my last post about virtualising offline Certificate...]]></description>
      <content:encoded><![CDATA[<p><span style="font-family:Calibri;font-size:medium;">Hi Everyone, today I wanted to follow up on my last post about virtualising offline Certificate Authorities. I briefly mentioned non-repudiation and stated it&rsquo;s a bit more involved than putting a tick in a box on a certificate template. I want to explain my reasoning for this and give you an insight into what might be involved to do this.</span></p>
<p><span style="font-family:Calibri;font-size:medium;">For reference, the non-repudiation check box I&rsquo;m referring to is this one, which you can get to from the extensions tab on a certificate template:</span></p>
<p style="text-align:center;"><span style="font-family:Calibri;font-size:medium;"><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/03/08/non-repudiation.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-03-08/non_2D00_repudiation.png"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/03/08/non-repudiation.png" original-url="http://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-03-08/non_2D00_repudiation.png" border="0" /></a><br /></span></p>
<p align="center" style="text-align:left;"><span style="font-family:Calibri;font-size:medium;">It seems easy enough to provide non-repudiation by simply ticking this box on a certificate template right? Well, no it isn&rsquo;t, even though it appears on the surface that you have non-repudiation, it&rsquo;s a little more complicated than that.</span></p>
<h1><span style="color:#2e74b5;font-family:Calibri Light;">What does it all mean?</span></h1>
<p><span style="font-family:Calibri;font-size:medium;">So what is non-repudiation? The pure definition is as follows:</span></p>
<p><i><span style="font-family:Calibri;font-size:medium;">Nonrepudiation is the assurance that someone cannot deny something. Typically, nonrepudiation refers to the ability to ensure that a party to a contract or a communication cannot deny the authenticity of their signature on a document or the sending of a message that they originated.</span></i></p>
<p><span style="font-family:Calibri;font-size:medium;">What does this mean in terms of PKI then? Essentially what we are saying when we check that box on the certificate template is that the owner of that certificate, when they sign some data, cannot refute the fact that they were the original signer. This is actually quite a big deal and puts a lot of onus on the user and certificate supplier to ensure that these terms can be met.</span></p>
<h1><span style="color:#2e74b5;font-family:Calibri Light;">Why do we need it?</span></h1>
<p><span style="font-family:Calibri;font-size:medium;">Non-repudiation is more of a legal concept than one which applies to PKI. Therefore, if we want our digital signatures to be able to be held up in a court of law non-repudiation plays a big part in this. Such as within law enforcement if an officer was going to digitally sign a statement. It&rsquo;s also used for attribution; this can be very important in some circles where the owner of a system needs to be absolutely sure of the authenticity of a message or that we can attribute the origin of the message undoubtedly to the original signer. Ultimately it builds a level of trust with the certificate.</span></p>
<h1><span style="color:#2e74b5;font-family:Calibri Light;">So how do we achieve it then?</span></h1>
<p><span style="font-family:Calibri;font-size:medium;">Non-repudiation is all about process and procedures, there are some technical controls that need to be in place but mainly it&rsquo;s down to policy. What we need to ensure is that there is no way that any other entity other than the intended subject of the certificate is able to get a certificate in the subject&rsquo;s name. For example, if Joe Blogs has a certificate which asserts non-repudiation there should be no way that Jane Blogs should be able to enrol for a certificate that has the subject name of Joe (and is within the same trust hierarchy). If she can then she would be able to sign some data as Joe and therefore non-repudiation is broken. We must also make sure that no one other than Joe can use the private key associated with Joes certificate. For example, if James can somehow gain access to Joe&rsquo;s key he can sign some data as Joe, again breaking non-repudiation.</span></p>
<p><span style="font-family:Calibri;font-size:medium;">The way we do this is all down to the controls we put around our certificate authority and the enrolment processes that we use for the subject. This needs to be absolutely air tight from the Root CA down, such that we can be sure beyond any reasonable doubt that the PKI hasn&rsquo;t been compromised in any place. If the root is compromised then anything underneath it can be deemed to be compromised and therefore untrustworthy, same from the subordinate CA down. Once that chain of trust is broken so is non-repudiation and the value of the end entity certificates almost becomes worthless. </span></p>
<p><span style="font-family:Calibri;font-size:medium;">How do we implement a PKI whereby we can be assured beyond any reasonable doubt that there hasn&rsquo;t been a compromise, including for the enrolment process of the end entities? The answer is &ldquo;with great difficulty&rdquo;, or least with a lot of investment in the security and procedural controls around a PKI which, unfortunately, most organisations don&rsquo;t want to invest in unless they are a commercial CA or government agency. I won&rsquo;t go in to excruciating detail on all of the required elements for this but I do want to lay out a framework which needs to be in place.</span></p>
<p><strong><span style="font-size:medium;">Certificate Policy and Certificate Practice Statements</span></strong></p>
<p><span style="font-family:Calibri;font-size:medium;">First and foremost, and before we build any of the PKI we need to document the technical and procedural controls that we wish to implement in a CP and various CPS documents for our PKI. At a very high level the CP is the document which describes the policies we wish to define in our PKI and contains things such as the enrolment methods which must be used for particular certificate types and how the private keys of the CAs must be protected. For example, we may say that we are issuing high assurance certificates to end entities and their private key must be stored on a smartcard. There can be one or more CP documents in a PKI depending on what policies you wish to apply to your CAs.</span></p>
<p><span style="font-family:Calibri;font-size:medium;">The CPS document is associated directly with a CA and describes <i>how</i> a particular CA meets the policy requirements as outlined in the CP. For example, we may say that this CA uses a Hardware Security Module to satisfy the control within the CP which discusses CA private key storage. Generally speaking, each CA that is implemented should have its own CPS as each CA may be managed differently or conform to different policies or elements of a policy.</span></p>
<p><span style="font-family:Calibri;font-size:medium;">A policy management board should also exist to ensure internal oversight of the PKI and they should be informed at all stages of implementation and whenever operation of the offline CAs takes place as well as at some instances of operation at the online CAs.</span></p>
<p><span style="font-family:Calibri;font-size:medium;">CP&rsquo;s and CPS&rsquo;s are also commonly misunderstood within a PKI and how we can build a PKI and associate these policies. I have some thoughts on this I wish to post in the coming weeks as well.</span></p>
<p><strong><span style="font-size:medium;">Security Controls Around the CA&rsquo;s</span></strong></p>
<p><span style="font-family:Calibri;font-size:medium;">The security controls of the CA should be documented in the CPS and will include a lot of different elements, I want to touch very briefly on some of the controls you should think about. This is by no means an exhaustive list of all the controls but provides a minimum list of criteria:</span></p>
<p><span style="font-family:Calibri;font-size:medium;">Root CA:</span></p>
<ul>
<li>
<p><span style="font-size:small;">Should be offline and <i>never</i> connected to any network. This is to ensure that no network based attack can be undertaken or malicious actor can connect to the CA. With it being offline we can be assured that only people with physical access to the CA can log on and perform operations at it, therefore limiting its attack surface. This is why I think virtualised offline CAs are a bad idea.</span></p>
</li>
<li>
<p><span style="font-size:small;">The CA should be protected with sufficient physical security controls. Typically, this means in a restricted datacentre, with nominal controls such as a protected building, high fences, security guard, CCTV, authentication to the server room (biometric or access card) and finally a secured rack or room where only authorised people have access.</span></p>
</li>
<li>
<p><span style="font-size:small;">Only authorised people should have physical and logical access to the CA. These people should be nominated teams or individuals within the organisation who have some authority. For example, the head of IT <b>and </b>the information security manager. It is good practice to implement dual person control such that both these people or their representatives need to be present at the same time to access the CA both physically and logically. Think about this as they show in the movies when launching a nuclear missile, two people of authority need to be present with their keys and insert and turn them at the same time. This stops one person having ultimate control of the asset meaning more than one person needs to be coerced for a compromise. This obviously needs to be implemented such that there is redundancy in the access control, if only two people have access and one goes on holiday then you lose operational access to the CA. The organisation needs to define the roles and responsibilities for the CA access. In terms of logical access control, a good method is to have a long complex administrator password to the root CA and split this into two halves, say 12 characters each and then each representative has one half of this password. It would also be prudent to encrypt the local hard drive of the CA to stop offline attacks to the server.</span></p>
</li>
<li>
<p><span style="font-size:small;">The CA&rsquo;s private key should be protected and stored in a Hardware Security Module. There are some very important reasons for this. Firstly, the HSM device provides a very robust environment where the key is stored, in a tamper evident and in some instances tamper resistant piece of hardware. The key is only ever in plain text within the confines of the HSM and cannot be extracted and ex-filtrated from the box. All signing operations are done within the secure hardware. The HSM provides a hardware based random number generator that provides excellent entropy for key generation and also accelerates signing operations because this is all done using a dedicated crypto-processor. Lastly, the HSM provides excellent access control mechanisms for key operations, such as requiring <i>k of n</i> people to load and operate the private key. This means that out of a total of n people k people are required to perform the operation, so we can set this to say 3 of 5 people. Again this limits collusion between people and means many people will need to be coerced to compromise the integrity of the CA.</span></p>
</li>
<li>
<p><span style="font-size:small;">The CA should be implemented following scripted and robustly documented procedures in the format of a <i>key signing ceremony</i>. Unfortunately, this does not include party poppers and hats but is instead a very strictly controlled procedure which is usually audited by a third party. The third party audit gives oversight to the implementation and ensures the organisation follows the exact procedure they have defined in the documentation and this isn&rsquo;t deviated from. Some of the roles within a key signing ceremony are as follows:</span></p>
<ul>
<li>
<p><span style="font-size:small;">Auditor / Key Ceremony Observer &ndash; responsible for third party oversight</span></p>
</li>
<li>
<p><span style="font-size:small;">Key Ceremony Directory &ndash; responsible for the overall security of the ceremony</span></p>
</li>
<li>
<p><span style="font-size:small;">Policy Management Board Representative &ndash; this person is responsible to the policy management board and reports the progress and status of the PKI implementation or operation</span></p>
</li>
<li>
<p><span style="font-size:small;">Key Component Holder &ndash; there will be many key component holders and they are responsible for the secure retention and usage of the key component during the ceremony. For example, this may be a HSM card or passphrase that is used. The <i>k of n</i> principle is enforced by these people</span></p>
</li>
<li>
<p><span style="font-size:small;">Key Component Courier &ndash; these people are responsible for the secure transportation of the key components before and after the ceremony. The components should be stored in tamper evident containers, for example police evidence bags.</span></p>
</li>
<li>
<p><span style="font-size:small;">Key Component Custodian &ndash; these people are responsible for the secure storage of the various key components and the signing in and out of the component to the courier.</span></p>
</li>
<li>
<p><span style="font-size:small;">CA Operator &ndash; this person is the technical operator of the CA and performs the actual role installation and technical tasks according to the documentation.</span></p>
</li>
</ul>
</li>
</ul>
<p><span style="font-family:Calibri;font-size:medium;">If you&rsquo;re really interested in key singing ceremonies check out this video </span><a href="https://www.youtube.com/watch?v=b9j-sfP9GUU"><span style="color:#0563c1;font-family:Calibri;font-size:medium;">https://www.youtube.com/watch?v=b9j-sfP9GUU</span></a><span style="font-family:Calibri;font-size:medium;"> which was recorded to demonstrate the controls and procedures that were put in place for the signing of the Root DNS zones for DNSSEC. The concepts in the video are entirely applicable to a PKI key signing ceremony.</span></p>
<p><span style="font-family:Calibri;font-size:medium;">As you can see the process and procedures of the installation of the CA far outweigh the technical elements of performing the role installation in server manager. The above only touch on the main points of the CA security, it can be far more intricate than this and requires a lot of documentation and patience to do it right!</span></p>
<p><span style="font-family:Calibri;font-size:medium;">The online CAs will have similar controls, such as the HSM, physical access controls and implementation ceremony. However, as the CA is fully online, i.e. network connected, it will require extra security controls around its logical security posture. A hardened build should be used, with the firewall enabled and network security controls in place. Also, the administration of the CA should be limited to only the required administrators and a robust Privileged Identity Management practice should be in place (check out MIM 20126 and Windows Server 2016 for this). The CA is a tier 0 system and therefore good credential hygiene should be in place and security management practice for this and the underlying AD should be conforming to the current recommended practice. See the following whitepapers for help on this:</span></p>
<ul>
<li>
<p><span style="font-size:small;">Best Practices for Securing AD <span style="color:#0563c1;"><a href="https://technet.microsoft.com/en-us/library/cc773365(v=ws.10).aspx">https://technet.microsoft.com/en-us/library/cc773365(v=ws.10).aspx</a></span></span></p>
</li>
<li>
<p><span style="font-size:small;">Best Practices for Delegating AD Administration <a href="http://www.microsoft.com/en-us/download/details.aspx?id=21678"><span style="color:#0563c1;">http://www.microsoft.com/en-us/download/details.aspx?id=21678</span></a></span></p>
</li>
<li>
<p><span style="font-size:small;">Privileged Identity Management with MIM: <a href="https://technet.microsoft.com/en-us/library/mt150258.aspx"><span style="color:#0563c1;">https://technet.microsoft.com/en-us/library/mt150258.aspx</span></a></span></p>
</li>
<li>
<p><span style="font-size:small;">Mitigating Pass the Hash: <a href="https://www.microsoft.com/en-gb/download/details.aspx?id=36036"><span style="color:#0563c1;">https://www.microsoft.com/en-gb/download/details.aspx?id=36036</span></a></span></p>
</li>
</ul>
<p><span style="font-family:Calibri;font-size:medium;">By managing your PKI and other core infrastructure systems to these high standards we can be sure, beyond reasonable doubt, that a compromise of the infrastructure is very, very, unlikely. It isn&rsquo;t impossible but the bar is raised significantly.</span></p>
<p><strong><span style="font-size:medium;">Enrolment Strategy</span></strong></p>
<p><span style="font-size:medium;">Once you have a well-managed, securely implemented and operated PKI you need to be able to get some certificates from it for your end entities. This could be for things like encryption services, authentication and crucially digital signature with non-repudiation. What good is a PKI if it can&rsquo;t issue certs? The actual enrolment process for end entity certificates needs to be as robust as the PKI controls we have spoken about. Auto-enrolment does not cut it for non-repudiation, we need to have a verification process for our subjects that usually involves the four eyes principle, i.e. two people, one to create the request and one to approve it. How can we place any value in the end entity certificates if the only verification for the subject is a letter from their mum? Let&rsquo;s look at some of the controls we need to put in place:</span></p>
<ul>
<li>
<p><span style="font-size:small;">The subject&rsquo;s identity must be verified using some form of physical ID. In the UK we have a standard for identity checks to government systems called e-Gif Level 3. This normally requires the presentation of two forms of ID, nominally a driving license and passport. Therefore, when the subject enrols for their certificate the identity information in it is as good as the ID presented, in this case two forms of government issued ID.</span></p>
</li>
<li>
<p><span style="font-size:small;">Sponsorship is another must. We can&rsquo;t let anyone enrol for a certificate from the PKI. We need to ensure that the subject is authorised to enrol, we can do this by ensuring they have sponsorship from their manager, business owner or other person in authority.</span></p>
</li>
<li>
<p><span style="font-size:small;">I mentioned the four eyes approach. This provides split responsibility for the enrolment of the certificate, again ensuring collusion of two or more people is necessary to subvert the security controls of the CA. This can be done by having one person or role which is responsible for the ID verification of the user and the generation of the request and another role or user who is responsible for the actual issuance of the certificate. The enrolee should be present during the request creation and during the issuance to ensure that only the subject of the certificate receives the certificate from the CA.</span></p>
</li>
<li>
<p><span style="font-size:small;">Only the subject of the certificate should ever be in control of the private key associated with the certificate. This is ultimately achieved using a smartcard. A smartcard is absolutely necessary for non-repudiation and they keys must be generated on card. The principle of a smartcard is identical to the principle of a HSM. The smartcard has its own crypto-processor and storage area for the key material and is deemed to be secure as the key cannot be extracted from the card (yes there are some side channel attacks on smartcards but they are the most secure key storage we have for users). If the key is in software stored on a Windows machine, then any administrator of that machine can export that private key and then you break non-repudiation and the trust of that certificate. It is also essential that the private key is generated on the card and never backed up. We need to be certain that only the owner of the smartcard is ever in control of the private key and that it is never present anywhere else or observed by any other person or system.</span></p>
</li>
</ul>
<h1><strong><span style="color:#2e74b5;">Summary</span></strong></h1>
<p><span style="font-family:Calibri;font-size:medium;">Can we say we have non-repudiation by putting a check in a box on a certificate template? Absolutely not, we must first jump through many hoops to be sure that only the owner of a private key associated with the certificate ever has access to it. This involves many controls, policies, procedures and security practices, some of which are listed above. Is this article the definitive list for everything you must do to secure a PKI, absolutely not, but hopefully it gives you some insight into what you need to do to implement a robust PKI. If implemented correctly we get non-repudiation but also the trust and assurance we place in all certificates has a higher value and we can have very strong two-factor authentication to internal systems.</span></p>
<p><span style="font-family:Calibri;font-size:medium;">A good friend of mine Andy Lyon has a brilliant quote I&rsquo;m going to steal as I think it is apt for this post:</span></p>
<p><i><span style="font-family:Calibri;font-size:medium;">&ldquo;CAs are easy, PKI is hard&rdquo;</span></i></p>
<p></p>]]></content:encoded>
    </item>
    <item>
      <title>Should I Virtualise My Root CA?</title>
      <link>https://docs.microsoft.com/archive/blogs/paranoidhumanoid/should-i-virtualise-my-root-ca</link>
      <pubDate>Fri, 25 Sep 2015 08:06:00 GMT</pubDate>
      <dc:creator><![CDATA[Chris W Ayres [MSFT]]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/paranoidhumanoid/2015/09/25/should-i-virtualise-my-root-ca/</guid>
      <description><![CDATA[Hey Everyone, today I wanted to post a note about virtualising offline Certificate Authorities. This...]]></description>
      <content:encoded><![CDATA[<p><span style="font-family:Segoe UI Light;"><span style="font-size:medium;">Hey Everyone, today I wanted to post a note about virtualising offline Certificate Authorities. This is something I come across a lot with customers and there is much debate in the industry about whether it is a valid approach. I&rsquo;d like to share my thoughts on this, which I will caveat to state are just my personal opinions, but which are based on 6 years plus of PKI implementation experience including in many secure environments.</span></span></p>
<h1><span style="color:#2e74b5;font-family:Segoe UI Light;">TLDR</span></h1>
<p><span style="font-family:Segoe UI Light;font-size:medium;">Yes, we can set up a secured virtual environment and configure elaborate solutions for our CA to meet the required audit compliance or security requirements, but why bother? Just because you <i>can </i>do something does not mean you should. So my advice is DON&rsquo;T DO IT! </span></p>
<p><span style="font-family:Segoe UI Light;font-size:medium;">The rest of this post will explain my reasoning&rsquo;s for this.</span></p>
<h1><span style="color:#2e74b5;font-family:Segoe UI Light;">The Proposal</span></h1>
<p><span style="font-family:Segoe UI Light;"><span style="font-size:medium;">In many environments a PKI underpins the security of the network, the user identities and access to systems and data. It can be the most trusted system an organisation owns, and if deployed in the correct manner will provide extremely robust authentication for devices, systems and users. It can also provide digital signature capability for signing code and signing emails or other documents to provide assurance around the integrity of said code or documents. If implemented correctly a PKI can also provide <b>non-repudiation</b> for signatures. Non-repudiation is where the signer of a document or other piece of data cannot refute that they were the original signer, i.e. I couldn&rsquo;t send an email, sign it with my private key and then state that the email originated from someone else or that they had impersonated me. This is crucial for obtaining correct attribution for actions, but also signatures used in this way can, under some circumstances, be held up in a court of law. I&rsquo;ll have another post in the coming weeks about non-repudiation, it takes much more process and policy than just a check in a box on a certificate template and therefore I think it requires its own post. </span></span></p>
<p><span style="font-family:Segoe UI Light;"><span style="font-size:medium;">Don&rsquo;t get me wrong, PKI can be implemented in an enterprise environment to deploy certificates where we place a low assurance value in those certificates. This is absolutely fine where the organisation knows this and isn&rsquo;t relying on those certificates to provide authentication to High Value Assets, secure critical networks or provide robust signatures as stated above. You need to understand the purpose of your PKI and why you deployed it. For example, it&rsquo;s no good implementing an accessible fully online PKI with no process or policy and then issuing smartcards for authentication from this PKI and thinking they provide highly robust authentication for your users, this is absolutely not the case and if not done correctly can even provide a lower level of security than a random long password (I also have some thoughts pending on smartcards to write up soon as well). </span></span></p>
<p><span style="font-family:Segoe UI Light;font-size:medium;">For more information about securing a PKI please see the Microsoft whitepaper at </span><a href="https://aka.ms/securingpki"><span style="color:#0563c1;font-family:Segoe UI Light;font-size:medium;">https://aka.ms/securingpki</span></a><span style="font-family:Segoe UI Light;font-size:medium;">. </span></p>
<p><span style="font-family:Segoe UI Light;font-size:medium;">So, we have now set the scene for why PKI is important. Now down to design and implementation and the crux of why I put this post together. Many administrators when building a PKI design a simple two-tier deployment (my recommendation for 99% of customers) as per the following diagram:</span></p>
<p align="center"><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/03/08/6011.1.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-03-08/6011.1.png"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/03/08/6011.1.png" original-url="http://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-03-08/6011.1.png" border="0" /></a></p>
<p><span style="font-family:Segoe UI Light;font-size:medium;">The best practice is to have the Root CA offline and not connected to any networks to protect the sanctity of this server. This is a well understood practice and adhered to by many PKI administrators. It is also recommended to use a hardware device for protection of the private key material on the CA, i.e. to use a Hardware Security Module or HSM. In the typical scenario above the offline server would be disconnected from the network and usually stored on a physical server or other hardware such as a desktop PC or laptop. It would also have a HSM connected to it, either via a PCIe card or today we can use a USB connected HSM. The reasoning for this is all down to security and lowering the surface area for attack while also providing access control and robust auditing measures. The issuing servers are usually fully online and can be hosted on a virtual platform (where that platform is secured and managed to the same security tier as the CAs &ndash; usually tier 0) and are generally connected to a network based HSM.</span></p>
<p><span style="font-family:Segoe UI Light;"><span style="font-size:medium;">So at this point you may be asking yourself &ldquo;what is this guy&rsquo;s problem then?&rdquo;. Ok, so my problem is that we have this very well understood implementation methodology which is based loosely on the design principles above which have been around since the dawn of PKI implementation, yet traditional admins want to move away from this <i>tried and tested </i>methodology and come up with elaborate solutions for virtualising the Root CA. This is normally because the organisation does not want to buy a separate HSM for the Root CA, but rather use one network based HSM for both online and offline environments. This can be achieved as most network based HSMs have two interfaces where there is no network connectivity between the two. My main issue taken with this approach is twofold, firstly it&rsquo;s the complexity of the solution, secondly it&rsquo;s the fact that the CA needs to be connected to some network, private or not, to use its private key material which increases its surface area for attack. You can use a USB based HSM in some virtual environments which support direct USB pass-through (not over the RDP channel as far as I&rsquo;m aware) but I would ask the question to all PKI administrators, why? </span></span></p>
<p><span style="font-family:Segoe UI Light;font-size:medium;">The below diagram is a simple design of the above mentioned solution, there are many variations on this design but nearly all involve connecting the offline CA to its own &ldquo;private&rdquo; HSM interface:</span></p>
<p style="text-align:center;"><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/03/08/2.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-03-08/2.png"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/03/08/2.png" original-url="http://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-03-08/2.png" border="0" /></a></p>
<h1><span style="color:#2e74b5;font-family:Segoe UI Light;">Taking Issue</span></h1>
<p><span style="font-family:Segoe UI Light;"><span style="font-size:medium;">The fundamental question we need to ask ourselves is, what is the problem we are trying to solve in virtualising the offline CA? Is it cost, hardware independence or a love for all things virtual? I&rsquo;d like to do some debunking here on the virtualisation approach and put forward a case as to why I think the traditional method is still the best.</span></span></p>
<p><span style="font-family:Segoe UI Light;font-size:medium;">As mentioned, my main mine gripe is complexity, let&rsquo;s take a look at what we might need to do to secure our virtual CA such that we can state it has equivalent security to an offline CA.</span></p>
<p><span style="font-family:Segoe UI Light;font-size:medium;">Firstly, we need to ensure the virtual host has the same security as what our offline CA would give us, most notably the physical host server would need to be protected to the same impact level of a normal offline CA. This would involve housing the virtual host server in a secure rack with physical access controls and have the policies and processes to ensure only designated personnel have access to the CA. All media introduced to the CA would need to be controlled and malware checked. If the CA is hosted on another platform other than Hyper-V, you may also require an administrator workstation to connect in to the host server so you can manage the guest, this workstation would need to be built from a known good image and used exclusively for the CA management. This isn&rsquo;t completely unachievable but does become unworkable when you need elegant, easy to follow scripted procedures for Key Signing Ceremonies. </span></p>
<p><span style="font-family:Segoe UI Light;"><span style="font-size:medium;">Secondly, by the very nature of the CA being virtualised you will need to connect it to a network and a network based HSM. This will require infrastructure and means that the HSM to which the offline and online CAs are connected to would need to be protected to the highest impact level of the all the connected assets. So, in this instance the HSM would need to be stored in the secure rack with the same access control procedures as defined for the Root CA. In the scenario where the Root CA is completely offline we still need to protect the online CA HSM, but we can define a separate security zone as these assets are online and need to be network connectable which provides distinct separation and allows us to split up the management of the two platforms. Remember our Root CA private key is the crown jewels we are trying to protect and we don&rsquo;t want to unduly expose it by having network connectivity to the area where it is stored from a lower level security zone or to lower level administrators. </span></span></p>
<p><span style="font-family:Segoe UI Light;"><span style="font-size:medium;">All of this network setup and thinking of assets crossing security zones just screams too much complexity to me and seems like over-engineering for a solution which really doesn&rsquo;t need to be complex. With this being said, I have had customers propose a &ldquo;simpler&rdquo; approach to the above problem where the Root CA is stored on their production virtualisation platform where their online CAs are stored, the <i>offline </i>CA is then connected with private virtual switches, host NICs and cabling to the HSM. The root CA would then be taken offline by dismounting the virtual machine when not in use and encrypting the virtual hard disks such that the CA cannot be started. To bring it online a process would exist whereby the disks are decrypted and the virtual machine is mounted temporarily. Again, I would ask why? Why engineer the solution to be this complex? What is the problem you are trying to solve? Don&rsquo;t make the design of your PKI overly elaborate when it doesn&rsquo;t need to be.</span></span></p>
<p><span style="font-family:Segoe UI Light;"><span style="font-size:medium;">Now to debunk some of the reasons for the virtualisation design:</span></span></p>
<p><span style="color:#5a5a5a;font-size:medium;">Cost</span></p>
<p><span style="font-family:Segoe UI Light;"><span style="font-size:medium;">The cost of a USB or PCIe HSM card is very reasonable today, and although I can&rsquo;t give you exact figures it is somewhere in the region of &pound;2.5K - &pound;5K depending on supplier, vendor and model you go for. This may initially look like a lot of money but when you take into consideration the extra administration overhead you have with the virtual solution, the cost of the extra infrastructure and the pain you will go through to achieve the security you need it&rsquo;s actually a drop in the ocean. You can buy a cheapish laptop and USB HSM and then store these in a protected safe when it is not in use and achieve a high level of data separation and security for relatively low cost. This will give you a high level of security and confidence in the integrity of your Root CA without the over-engineering of the solution. So, no, I don&rsquo;t take cost as an argument for the virtualisation of the Root CA.</span></span></p>
<p><span style="color:#5a5a5a;font-size:medium;">Hardware Independence</span></p>
<p><span style="font-family:Segoe UI Light;"><span style="font-size:medium;">Another argument that people sometimes use is around hardware independence, such that if you had a system failure you could restore the VM to any other physical server with the same hyper-visor technology very easily. The argument is that you aren&rsquo;t reliant on the same physical hardware for system state restores and you get flexibility in your recovery approach and disentangle yourself from specific hardware components. I would however still have a retort to this in that if you have a robust backup and restore process following a componentised model, like the one I documented in this <a href="/b/paranoidhumanoid/archive/2015/09/15/certificate-services-disaster-recovery.aspx"><span style="color:#0563c1;">post</span></a>, this argument becomes irrelevant. In my opinion the component based restore is elegant and not only allows you to restore your service but also migrate it to a new hardware platform or even a new up level operating system, such as during a Windows Server upgrade. The component based restore on a dedicated physical platform is also cost effective.</span></span></p>
<h1><span style="color:#2e74b5;font-family:Segoe UI Light;">Summary</span></h1>
<p><span style="font-family:Segoe UI Light;"><span style="font-size:medium;">This post ended up being more of a rant than I wanted it to be, but we can sometimes get carried away with designing and implementing IT systems fixing problems that don&rsquo;t exist and I&rsquo;m a big believer in keeping things simple. The age old saying of &ldquo;complexity is the enemy of security&rdquo; rings true for this scenario. Virtualisation absolutely has a place at centre stage in our environments today, but in my opinion, it does not have a place when it comes to offline CAs. I can speak from experience of being in many Key Signing Ceremonies with third party auditors looking over your shoulder and will say that the last thing you want in this scenario is too much complexity as something is bound to go wrong and cause you lots of pain and questions from the auditor.</span></span></p>
<p><span style="font-size:medium;"><span style="font-family:Segoe UI Light;">Alas, I am a bit of a PKI purist though, some may say a curmudgeon, so my views are slightly skewed. So with all of this being said, assess the needs of your PKI, what assets you are protecting and what level of trust you are placing in the certificates it issues. It may be the case that you don&rsquo;t need extravagant security controls and protection mechanisms and therefore can ignore all of my advice :)</span></span></p>
<p><span><span style="font-family:Segoe UI Light;font-size:medium;">A good friend of mine, David Wozny, wrote an excellent whitepaper for Thales on Offline CA design principles which can be found </span></span><a href="https://www.thales-esecurity.com/knowledge-base/white-papers/offline-ca-best-practices"><span style="color:#0563c1;font-family:Segoe UI Light;font-size:medium;"><span style="font-family:Segoe UI Light;font-size:medium;">here</span></span></a><span style="font-family:Segoe UI Light;"><span style="font-size:medium;"><span>, and he covers off what I have spoken about in this post a lot more succinctly. I encourage you to read his whitepaper and this blog post together before you make any decisions on your offline Root CA implementation</span>.</span></span></p>]]></content:encoded>
    </item>
    <item>
      <title>Certificate Services Disaster Recovery</title>
      <link>https://docs.microsoft.com/archive/blogs/paranoidhumanoid/certificate-services-disaster-recovery</link>
      <pubDate>Tue, 15 Sep 2015 03:26:00 GMT</pubDate>
      <dc:creator><![CDATA[Chris W Ayres [MSFT]]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/paranoidhumanoid/2015/09/15/certificate-services-disaster-recovery/</guid>
      <description><![CDATA[Hey Everyone, welcome to my blog and my very first blog post :)
&nbsp;
Public Key Infrastructure...]]></description>
      <content:encoded><![CDATA[<p><span style="font-family:Segoe UI Light;font-size:medium;">Hey Everyone, welcome to my blog and my very first blog post :)</span></p>
<p><span style="font-family:Segoe UI Light;font-size:medium;">&nbsp;</span></p>
<p><span style="font-family:Segoe UI Light;font-size:medium;">Public Key Infrastructure is my speciality and today I&#39;d like to share some thoughts on disaster recovery. This blog post is an update to the disaster recovery article posted in 2010 linked here. When working with customers I like to look at disaster recovery by breaking it down into scenarios that could go wrong and how each scenario can be recovered from. Also, there are some mitigations that can be performed in an emergency situation if you absolutely cannot get a CA back online for a period of time, which I would like to touch on. I usually put these into a Backup Matrix so the different scenarios and their specific problems can be addressed easily, and because anything with matrix in the title sounds cool!</span></p>
<p><span style="font-family:Segoe UI Light;font-size:medium;">&nbsp;</span></p>
<p><span style="font-family:Segoe UI Light;font-size:medium;">This post will use many acronyms throughout and assumes at least an intermediate level of knowledge about PKI. So, without further ado, fasten your seat-belts as this post will be a whopper!</span></p>
<p><span style="font-family:Segoe UI Light;font-size:medium;">&nbsp;</span></p>
<h1><span style="color:#2e74b5;font-family:Segoe UI Light;">The Matrix</span></h1>
<p><span style="font-family:Segoe UI Light;font-size:medium;">The table below is the backup matrix I was referring to. This is not an absolute authoritative list of everything that can go wrong with a PKI but provides some high level common scenarios. The recovery steps listed are broken down further below with some detailed advice and guidance on what needs to be backed so these recovery processes can be followed.</span></p>
<table style="width:100%;" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td width="20%" valign="top"><span style="font-family:Times New Roman;font-size:medium;"> </span>
<p><b><span style="font-family:Segoe UI Light;font-size:medium;">Component</span></b></p>
<span style="font-family:Times New Roman;font-size:medium;"> </span></td>
<td width="25%" valign="top"><span style="font-family:Times New Roman;font-size:medium;"> </span>
<p><b><span style="font-family:Segoe UI Light;font-size:medium;">Disaster Scenario</span></b></p>
<span style="font-family:Times New Roman;font-size:medium;"> </span></td>
<td width="25%" valign="top"><span style="font-family:Times New Roman;font-size:medium;"> </span>
<p><b><span style="font-family:Segoe UI Light;font-size:medium;">Implications</span></b></p>
<span style="font-family:Times New Roman;font-size:medium;"> </span></td>
<td width="29%" valign="top"><span style="font-family:Times New Roman;font-size:medium;"> </span>
<p><b><span style="font-family:Segoe UI Light;font-size:medium;">Recovery Steps</span></b></p>
<span style="font-family:Times New Roman;font-size:medium;"> </span></td>
</tr>
<tr>
<td width="20%" valign="top"><span style="font-family:Times New Roman;font-size:medium;"> </span>
<p><b><span style="font-family:Segoe UI Light;font-size:medium;">&nbsp;CA</span></b></p>
<span style="font-family:Times New Roman;font-size:medium;"> </span></td>
<td width="25%" valign="top"><span style="font-family:Times New Roman;font-size:medium;"> </span>
<p><span style="font-family:Segoe UI Light;font-size:medium;">Complete failure on Root CA </span></p>
<span style="font-family:Times New Roman;font-size:medium;"> </span></td>
<td width="25%" valign="top"><span style="font-family:Times New Roman;font-size:medium;"> </span>
<p><span style="font-family:Segoe UI Light;font-size:medium;">CA can&#39;t issue any new certificates until it has been recovered</span></p>
<span style="font-family:Times New Roman;font-size:medium;"> </span></td>
<td width="29%" valign="top"><span style="font-family:Times New Roman;font-size:medium;"> </span>
<ul>
<li><span style="font-family:Segoe UI Light;font-size:medium;">Full recovery of CA from backup and replay missing certificate serial numbers into database.</span></li>
</ul>
<span style="font-family:Times New Roman;font-size:medium;"> </span></td>
</tr>
<tr>
<td width="20%" valign="top"><span style="font-family:Times New Roman;font-size:medium;"> </span>
<p><b><span style="font-family:Segoe UI Light;font-size:medium;">&nbsp;</span></b></p>
<span style="font-family:Times New Roman;font-size:medium;"> </span></td>
<td width="25%" valign="top"><span style="font-family:Times New Roman;font-size:medium;"> </span>
<p><span style="font-family:Segoe UI Light;font-size:medium;">&nbsp;</span></p>
<span style="font-family:Times New Roman;font-size:medium;"> </span></td>
<td width="25%" valign="top"><span style="font-family:Times New Roman;font-size:medium;"> </span>
<p><span style="font-family:Segoe UI Light;font-size:medium;">CA is unable to publish new CRL until it has been recovered which will lead to certificate validation problems</span></p>
<span style="font-family:Times New Roman;font-size:medium;"> </span></td>
<td width="29%" valign="top"><span style="font-family:Times New Roman;font-size:medium;"> </span>
<ul>
<li><span style="font-family:Segoe UI Light;font-size:medium;">Resign the CA CRL on another server.</span></li>
<li><span style="font-family:Segoe UI Light;font-size:medium;">Full recovery of CA from backup</span></li>
</ul>
<span style="font-family:Times New Roman;font-size:medium;"> </span><span style="font-family:Times New Roman;font-size:medium;"> </span></td>
</tr>
<tr>
<td width="20%" valign="top"><span style="font-family:Times New Roman;font-size:medium;"> </span>
<p><b><span style="font-family:Segoe UI Light;font-size:medium;">&nbsp;</span></b></p>
<span style="font-family:Times New Roman;font-size:medium;"> </span></td>
<td width="25%" valign="top"><span style="font-family:Times New Roman;font-size:medium;"> </span>
<p><span style="font-family:Segoe UI Light;font-size:medium;">Loss of access to private key</span></p>
<span style="font-family:Times New Roman;font-size:medium;"> </span></td>
<td width="25%" valign="top"><span style="font-family:Times New Roman;font-size:medium;"> </span>
<p><span style="font-family:Segoe UI Light;font-size:medium;">CA can&#39;t issue any new certificates until it has been recovered</span></p>
<span style="font-family:Times New Roman;font-size:medium;"> </span></td>
<td width="29%" valign="top"><span style="font-family:Times New Roman;font-size:medium;"> </span>
<ul>
<li><span style="font-family:Segoe UI Light;font-size:medium;">Recover CA private key</span></li>
</ul>
<span style="font-family:Times New Roman;font-size:medium;"> </span></td>
</tr>
<tr>
<td width="20%" valign="top"><span style="font-family:Times New Roman;font-size:medium;"> </span>
<p><b><span style="font-family:Segoe UI Light;font-size:medium;">&nbsp;</span></b></p>
<span style="font-family:Times New Roman;font-size:medium;"> </span></td>
<td width="25%" valign="top"><span style="font-family:Times New Roman;font-size:medium;"> </span>
<p><span style="font-family:Segoe UI Light;font-size:medium;">Database corruption or other database issue.</span></p>
<span style="font-family:Times New Roman;font-size:medium;"> </span></td>
<td width="25%" valign="top"><span style="font-family:Times New Roman;font-size:medium;"> </span>
<p><span style="font-family:Segoe UI Light;font-size:medium;">CA can&#39;t issue any new certificates until it has been recovered</span></p>
<span style="font-family:Times New Roman;font-size:medium;"> </span></td>
<td width="29%" valign="top"><span style="font-family:Times New Roman;font-size:medium;"> </span>
<ul>
<li><span style="font-family:Segoe UI Light;font-size:medium;">Database recovery from backup and replay missing certificate serial numbers into database.</span></li>
</ul>
<span style="font-family:Times New Roman;font-size:medium;"> </span></td>
</tr>
<tr>
<td width="20%" valign="top"><span style="font-family:Times New Roman;font-size:medium;"> </span>
<p><b><span style="font-family:Segoe UI Light;font-size:medium;">&nbsp;</span></b></p>
<span style="font-family:Times New Roman;font-size:medium;"> </span></td>
<td width="25%" valign="top"><span style="font-family:Times New Roman;font-size:medium;"> </span>
<p><span style="font-family:Segoe UI Light;font-size:medium;">&nbsp;</span></p>
<span style="font-family:Times New Roman;font-size:medium;"> </span></td>
<td width="25%" valign="top"><span style="font-family:Times New Roman;font-size:medium;"> </span>
<p><span style="font-family:Segoe UI Light;font-size:medium;">CA is unable to publish new CRL until it has been recovered which will lead to certificate validation problems</span></p>
<span style="font-family:Times New Roman;font-size:medium;"> </span></td>
<td width="29%" valign="top"><span style="font-family:Times New Roman;font-size:medium;"> </span>
<ul>
<li><span style="font-family:Segoe UI Light;font-size:medium;">Resign the CA CRL on another server.</span></li>
<li><span style="font-family:Segoe UI Light;font-size:medium;">Database recovery from backup and replay missing certificate serial numbers into database.</span></li>
</ul>
<span style="font-family:Times New Roman;font-size:medium;"> </span><span style="font-family:Times New Roman;font-size:medium;"> </span></td>
</tr>
<tr>
<td width="20%" valign="top"><span style="font-family:Times New Roman;font-size:medium;"> </span>
<p><b><span style="font-family:Segoe UI Light;font-size:medium;">CDP</span></b></p>
<span style="font-family:Times New Roman;font-size:medium;"> </span></td>
<td width="25%" valign="top"><span style="font-family:Times New Roman;font-size:medium;"> </span>
<p><span style="font-family:Segoe UI Light;font-size:medium;">CDP is unavailable</span></p>
<span style="font-family:Times New Roman;font-size:medium;"> </span></td>
<td width="25%" valign="top"><span style="font-family:Times New Roman;font-size:medium;"> </span>
<p><span style="font-family:Segoe UI Light;font-size:medium;">If clients cannot access the CDP then certificate validation errors will occur.</span></p>
<span style="font-family:Times New Roman;font-size:medium;"> </span></td>
<td width="29%" valign="top"><span style="font-family:Times New Roman;font-size:medium;"> </span>
<ul>
<li><span style="font-family:Segoe UI Light;font-size:medium;">Re-point CDP DNS to new server.</span></li>
</ul>
<span style="font-family:Times New Roman;font-size:medium;"> </span></td>
</tr>
<tr>
<td width="20%" valign="top"><span style="font-family:Times New Roman;font-size:medium;"> </span>
<p><b><span style="font-family:Segoe UI Light;font-size:medium;">Certificate Templates</span></b></p>
<span style="font-family:Times New Roman;font-size:medium;"> </span></td>
<td width="25%" valign="top"><span style="font-family:Times New Roman;font-size:medium;"> </span>
<p><span style="font-family:Segoe UI Light;font-size:medium;">Custom templates removed from directory or lost due to other AD related failure.</span></p>
<span style="font-family:Times New Roman;font-size:medium;"> </span></td>
<td width="25%" valign="top"><span style="font-family:Times New Roman;font-size:medium;"> </span>
<p><span style="font-family:Segoe UI Light;font-size:medium;">CA will not be able to issue certificates based on certificate templates. The custom templates would need to be re-created or recovered.</span></p>
<span style="font-family:Times New Roman;font-size:medium;"> </span></td>
<td width="29%" valign="top"><span style="font-family:Times New Roman;font-size:medium;"> </span>
<ul>
<li><span style="font-family:Segoe UI Light;font-size:medium;">Recover templates using PowerShell script and re-add to the CA.</span></li>
</ul>
<span style="font-family:Times New Roman;font-size:medium;"> </span></td>
</tr>
</tbody>
</table>
<p><span style="font-family:Segoe UI Light;font-size:medium;">&nbsp;</span></p>
<h2><span style="color:#2e74b5;font-family:Calibri Light;font-size:large;">Backing up a Certificate Authority</span></h2>
<p><span style="font-family:Segoe UI Light;font-size:medium;">So, to the fundamentals first. Before we can restore a certificate authority we need to have a good valid backup. The best way to backup a certificate authority is to use the certutil command line tool, the Swiss army knife of anything PKI! There are three parameters you can use to backup the CA depending on the information you want to capture, they are as follows:</span></p>
<ul>
<li>
<p><b>Certutil &ndash;backup </b>&egrave; This will backup both the database and private key of the CA</p>
</li>
<li>
<p><b>Certutil &ndash;backupDB </b><b>&egrave; </b>As the switch suggests this will backup the database <i>only</i></p>
</li>
<li>
<p><b>Certutil &ndash;backupKey </b><b>&egrave; </b>Again, as the name suggests this will backup the CA private key <i>only</i></p>
</li>
</ul>
<p><span style="font-family:Segoe UI Light;font-size:medium;">Which one do I use? I hear you ask, well that depends on a couple of things really. Firstly, are you using a Hardware Security Module (which is best practice for a CA)? If so, you will never use the full backup or backup key options as the private key backup and recovery will be specific to the type of HSM you are using. If you aren&rsquo;t using a HSM, then you can use the other backup options to backup the key, however, once installed the CA private key may only change at very lengthy intervals. This may be when the CA certificate is renewed or otherwise re-keyed due to other factors. Based on this we only need to have a valid backup of the <i>current</i> private key which may be valid on a CA for many years, such as for a root CA. In my opinion it is only needed to backup the private key at these intervals and documentation should exist to either do a &ldquo;certutil &ndash;backupkey&rdquo; or to export the CA certificate manually using MMC console at said intervals. When the backup of the private key is taken it should have a very secure password configured and safely recorded, such as in a fire safe with limited access. As the private key is the crown jewels of the CA the backup of the key should also be secured and not left lying round on the server or otherwise easily accessible location. This is where the value of HSM&rsquo;s come in as ordinarily anyone who has administrative access to the CA server can export or backup the private key to a PKCS#12 file and then import onto their own server and impersonate your CA, which is very bad! With a HSM the private key is protected in a hardware device which has special controls in place such that the keys cannot just be exported.</span></p>
<p><span style="font-family:Segoe UI Light;font-size:medium;">Now we have a good backup of the CA certificate and private key we can look to backup the CA database. As I mentioned already, the easiest and most elegant way to do this is to use the &ldquo;certutil &ndash;backupDB&rdquo; command line, indeed wrapping this into a batch file and running on a schedule makes the most sense. In addition to the backup of the CA database allowing for CA recovery, backing up also has the added benefit of truncating the CA log files. Some good information on huge CA databases, compaction and truncating log files is detailed in </span><a href="/b/askds/archive/2010/08.aspx?PageIndex=1"><span style="color:#0563c1;font-family:Segoe UI Light;font-size:medium;">this</span></a><span style="font-family:Segoe UI Light;font-size:medium;"> blog post. Here is a sample script for backing up the CA database that I use, it is very rudimentary but gets the job done:</span></p>
<div><span style="font-family:Times New Roman;font-size:medium;"> </span>
<p>REM Set variables</p>
<span style="font-family:Times New Roman;font-size:medium;"> </span>
<p>SET myCABackup=e:\CA-Backup</p>
<span style="font-family:Times New Roman;font-size:medium;"> </span>
<p>&nbsp;</p>
<span style="font-family:Times New Roman;font-size:medium;"> </span>
<p>echo %time% %date% &gt; %myCABackup%\Backuplog.log</p>
<span style="font-family:Times New Roman;font-size:medium;"> </span>
<p>&nbsp;</p>
<span style="font-family:Times New Roman;font-size:medium;"> </span>
<p>REM Create backup folders</p>
<span style="font-family:Times New Roman;font-size:medium;"> </span>
<p>if not exist %myCABackup% md %myCABackup%</p>
<span style="font-family:Times New Roman;font-size:medium;"> </span>
<p>if exist %myCABackup%\7 rd /s /q %myCABackup%\7</p>
<span style="font-family:Times New Roman;font-size:medium;"> </span>
<p>if exist %myCABackup%\6 rename %myCABackup%\6 7</p>
<span style="font-family:Times New Roman;font-size:medium;"> </span>
<p>if exist %myCABackup%\5 rename %myCABackup%\5 6</p>
<span style="font-family:Times New Roman;font-size:medium;"> </span>
<p>if exist %myCABackup%\4 rename %myCABackup%\4 5</p>
<span style="font-family:Times New Roman;font-size:medium;"> </span>
<p>if exist %myCABackup%\3 rename %myCABackup%\3 4</p>
<span style="font-family:Times New Roman;font-size:medium;"> </span>
<p>if exist %myCABackup%\2 rename %myCABackup%\2 3</p>
<span style="font-family:Times New Roman;font-size:medium;"> </span>
<p>if exist %myCABackup%\1 rename %myCABackup%\1 2</p>
<span style="font-family:Times New Roman;font-size:medium;"> </span>
<p>&nbsp;</p>
<span style="font-family:Times New Roman;font-size:medium;"> </span>
<p>md %myCABackup%\1</p>
<span style="font-family:Times New Roman;font-size:medium;"> </span>
<p>&nbsp;</p>
<span style="font-family:Times New Roman;font-size:medium;"> </span>
<p>REM Publish new CRL</p>
<span style="font-family:Times New Roman;font-size:medium;"> </span>
<p>certutil -CRL</p>
<span style="font-family:Times New Roman;font-size:medium;"> </span>
<p>&nbsp;</p>
<span style="font-family:Times New Roman;font-size:medium;"> </span>
<p>REM Backup CA database</p>
<span style="font-family:Times New Roman;font-size:medium;"> </span>
<p>certutil -BackupDB %myCABackup%\1 &gt;&gt; %myCABackup%\Backuplog.log</p>
<span style="font-family:Times New Roman;font-size:medium;"> </span>
<p>&nbsp;</p>
<span style="font-family:Times New Roman;font-size:medium;"> </span>
<p>REM Backup CA registry key</p>
<span style="font-family:Times New Roman;font-size:medium;"> </span>
<p>certutil -getreg ca &gt; %myCABackup%\1\ca-registry.txt</p>
<span style="font-family:Times New Roman;font-size:medium;"> </span>
<p>&nbsp;</p>
<span style="font-family:Times New Roman;font-size:medium;"> </span>
<p>REM Backup CSP registry key</p>
<span style="font-family:Times New Roman;font-size:medium;"> </span>
<p>certutil -getreg ca\CSP &gt; %myCABackup%\1\ca-registry-CSP.txt</p>
<span style="font-family:Times New Roman;font-size:medium;"> </span>
<p>&nbsp;</p>
<span style="font-family:Times New Roman;font-size:medium;"> </span>
<p>REM Backup all templates published at CA</p>
<span style="font-family:Times New Roman;font-size:medium;"> </span>
<p>Certutil &ndash;catemplates &gt; %myCABackup%\1\CATemplates.txt</p>
<span style="font-family:Times New Roman;font-size:medium;"> </span>
<p>&nbsp;</p>
<span style="font-family:Times New Roman;font-size:medium;"> </span>
<p>REM Backup events logs</p>
<span style="font-family:Times New Roman;font-size:medium;"> </span>
<p>Wevtutil.exe epl Application %myCABackup%\1\Application-%myBackupDate%.evtx &gt;&gt; %myCABackup%\Backuplog.log</p>
<span style="font-family:Times New Roman;font-size:medium;"> </span>
<p>Wevtutil.exe epl System %myCABackup%\1\System-%myBackupDate%.evtx &gt;&gt; %myCABackup%\Backuplog.log</p>
<span style="font-family:Times New Roman;font-size:medium;"> </span>
<p>Wevtutil.exe epl Security %myCABackup%\1\Security-%myBackupDate%.evtx &gt;&gt; %myCABackup%\Backuplog.log</p>
<span style="font-family:Times New Roman;font-size:medium;"> </span>
<p>&nbsp;</p>
<span style="font-family:Times New Roman;font-size:medium;"> </span>
<p>REM Backup CAPolicy File</p>
<span style="font-family:Times New Roman;font-size:medium;"> </span>
<p>IF exist %systemroot%\CAPolicy.inf goto CAPOL</p>
<span style="font-family:Times New Roman;font-size:medium;"> </span>
<p>exit</p>
<span style="font-family:Times New Roman;font-size:medium;"> </span>
<p>:CAPOL</p>
<span style="font-family:Times New Roman;font-size:medium;"> </span>
<p>copy %systemroot%\CAPolicy.inf %myCABackup%\1\</p>
<span style="font-family:Times New Roman;font-size:medium;"> </span></div>
<p><span style="font-family:Segoe UI Light;font-size:medium;">One thing you will notice about the script is that it creates folders for the last seven days so there are seven backups. Also, the script backs up the CA registry settings, CAPolicy file and the event logs for server. I think the event logs are useful, especially the security log, so that you have an audit trail of the CA that can be archived. I must mention that I always turn the auditing on the CA up to max as well, you never know when you&rsquo;ll need to have that audit information! Now, I usually configure the script to run every 24 hours so there is a fresh backup every day for the last seven days stored on the data drive of the server. From there other tools can be used to backup the file system of the server for full server recovery, longer term archive and data retention. There are also some new PowerShell cmdlets that can be leveraged to perform the CA backup, so if you&rsquo;re on a 2012 or later server you can leverage PowerShell instead of the old batch files.</span></p>
<p><span style="font-family:Segoe UI Light;font-size:medium;">In addition to the backup of the CA database it is a good idea to have copies of the original installation scripts and CAPolicy file. You do have detailed installation documents and configuration management, right? I think the best thing to do in this situation is to have all of the commissioning scripts in a folder on the data drive where the CA database backup is, that way when it comes to restoring the database using the long term file backup solution the original scripts can also be restored as well. I also think it&rsquo;s a good idea to publish a CRL every 24 hours regardless of the CRL validity period settings and to do this within the backup script. The main reason for this is because in my experience certain certificate policies require you to publish every 24 hours. This also ensures CRL information is up to date, see detail later about how the CDP can be kept up to date with this data as well.</span></p>
<p><span style="font-family:Segoe UI Light;font-size:medium;">The last thing on backing up the CA I want to mention is around having a record of all certificates that are issued. If you are only backing up the CA every 24 hours then the worst case scenario is that you will have nearly 24 hours&rsquo; worth of issued certificates that aren&rsquo;t included in the backup. For a high volume CA that is pumping out lots of certificates this can be an issue. The certificates themselves will continue to work and the users, devices or services which are using them will function as before, however the big risk is that you can&rsquo;t revoke those certificates. From a security point of view this is bad as potentially there are many certificates out in the wild that you have lost control of. There is a trick we&rsquo;ll talk about later that can be used to enable the CA to have knowledge of these <i>lost</i> certificates or if all else fails we can revoke the certificates if we have their serial number. The Microsoft CA has a built in feature we can use to help us record the serial number and base64 encoded value of <b>every</b> certificate that is issued, this is done using the SMTP exit module. The SMTP exit module is not configured by default so this will need configuring during the initial building of the CA.</span></p>
<p><span style="font-family:Segoe UI Light;font-size:medium;">Detailed information on the SMTP exit module and how to configure it are detailed in the following articles:</span></p>
<p><a href="/b/xdot509/archive/2013/06/17/operating-a-pki-smtp-exit-module.aspx"><span style="color:#0563c1;font-family:Segoe UI Light;font-size:medium;">http://blogs.technet.com/b/xdot509/archive/2013/06/17/operating-a-pki-smtp-exit-module.aspx</span></a></p>
<p><a href="http://social.technet.microsoft.com/wiki/contents/articles/2004.active-directory-certificate-services-smtp-exit-module-for-windows-server-2008-r2-example.aspx"><span style="color:#0563c1;font-family:Segoe UI Light;font-size:medium;">http://social.technet.microsoft.com/wiki/contents/articles/2004.active-directory-certificate-services-smtp-exit-module-for-windows-server-2008-r2-example.aspx</span></a></p>
<p><span style="font-family:Segoe UI Light;font-size:medium;">Note in the script that you will need to configure the correct parameters for your SMTP server and emails addresses you wish to use.</span></p>
<p><span style="font-family:Segoe UI Light;font-size:medium;">&nbsp;</span></p>
<h1><span style="color:#2e74b5;font-family:Segoe UI Light;">Recovery Scenarios</span></h1>
<p><span style="font-family:Segoe UI Light;font-size:medium;">&nbsp;</span></p>
<h2><span style="color:#2e74b5;font-family:Calibri Light;font-size:large;">Complete CA Failure</span></h2>
<p><span style="font-family:Segoe UI Light;font-size:medium;">Now we have a full backup of the CA we can look at the different scenarios and what methods we can use to restore the CA to service or at least ensure clients and certificate validations are working. So in our first scenario lets imagine the CA has had a complete failure, this could be anything from a physical server crashing and burning or if virtual a corruption of the virtual hard disk. In this scenario the CA will be unable to issue any new certificates or publish a new CRL. Now, it may appear that being unable to issue new certificates is the most important issue to fix so service can be restored but being unable to publish a CRL is a far more important issue to address. Not having a current valid CRL will have a huge impact on a business where certificates are used heavily. Let&rsquo;s take an example of an organisation that uses smartcards for Windows logon, if the CA CRL expires a situation will occur where <b>all</b> of their users are unable to logon, I have indeed seen this happen in my career. From a business continuity point of view users not being able to log on to their Windows desktops on a Monday morning is just about the worst thing that could happen. Now, the amount of time you have before this world ending event occurs depends on what your CRL publication interval and its <i>overlap </i>period are. This is essentially your SLA. By way of example, if you have a CRL which has a base validity period of 24 hours and an overlap period of 24 hours you have at a minimum 1 day and at a maximum 2 days to recover your CA. One point to make on this is that if you are using Delta CRLs with a shorter validity period, say 1 hour, then that will be become your minimum time for recovery as Delta CRLs are <i>critical </i>for a PKI authentication.</span></p>
<p><span style="font-family:Segoe UI Light;font-size:medium;">Ok, now that whole complicated explanation is out of the way how do we fix this and not allow this apocalyptic event to occur. Well there is only one way to fully restore the CA, which is to recover the CA from backup onto a new or rebuilt server. This may take some time depending on your own infrastructure, your level of monitoring and alerting for the CA (check back later for another post on this!) and ability to action the server rebuild. If you cannot fully restore the CA within the SLA period (the CRL validity period) then there is a process to <i>re-sign</i> the CRL on another server and extend its validity so that clients can validate the CRL and carry on with their business. Obviously new certificate issuance and revocations will still be on hold until the CA is recovered but at least the CEO will be able to logon and check his emails.</span></p>
<p><b><span style="font-family:Segoe UI Light;font-size:medium;">Full CA Recovery</span></b></p>
<p><span style="font-family:Segoe UI Light;font-size:medium;">The following steps can be used to fully recover a CA:</span></p>
<ol>
<li>
<p>Build a new server, either new hardware or virtual, as your CA. It is best practice to use the same server name here, this will save some headache later.</p>
</li>
<li>
<p>Configure server OS to your standard, set IP address and join to the domain.</p>
</li>
<li>
<p>Restore the directory previously backed up to the data drive on the CA, this should include 7 days&rsquo; worth of CA database backups, the various certutil outputs, event logs and commissioning scripts.</p>
</li>
<li>
<p>Copy the CAPolicy.inf file back into the %WINDIR% directory.</p>
</li>
<li>
<p>Obtain a copy of the private key form secure storage and make available on the CA, this may be restoring the PFX file if not using a HSM or by configuring the HSM and restoring the private key using the HSM manufacturer&rsquo;s instructions.</p>
<ol>
<li>
<p>When using a HSM it is usually necessary to re-associate the hardware protected private key with the CA certificate. To do this, the CA certificate will need to be installed into the machine store of the CA (it can be retrieved from the AIA location where it should be published) and the CA private key available in the HSM device.</p>
<p>Once the certificate and private key are available the following command can be run to <i>join</i> the key to the certificate:</p>
<p>&nbsp;</p>
</li>
</ol></li>
</ol>
<div><span style="font-family:Times New Roman;font-size:medium;"> </span>
<p>Certutil &ndash;csp &ldquo;&lt;hardware CSP/KSP&gt;&rdquo; &ndash;repairstore MY &ldquo;&lt;CA Certificate Serial Number&gt;&rdquo;</p>
<span style="font-family:Times New Roman;font-size:medium;"> </span></div>
<p>&nbsp;</p>
<p><span style="font-family:Segoe UI Light;font-size:medium;">You will receive feedback <i>similar</i> to the following:</span></p>
<div><span style="font-family:Times New Roman;font-size:medium;"> </span>
<p align="left">certutil -csp &quot;ncipher security world key storage provider&quot; -repairstore My &quot;12 36 2b a2 00 00 00 00 00 03&quot;</p>
<span style="font-family:Times New Roman;font-size:medium;"> </span>
<p align="left">My</p>
<span style="font-family:Times New Roman;font-size:medium;"> </span>
<p align="left">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ================ Certificate 0 ==</p>
<span style="font-family:Times New Roman;font-size:medium;"> </span>
<p align="left">Serial Number: 12362ba2000000000003</p>
<span style="font-family:Times New Roman;font-size:medium;"> </span>
<p align="left">Issuer: CN=Contoso Issuing CA,OU=Contoso,O=Lab,C=GB</p>
<span style="font-family:Times New Roman;font-size:medium;"> </span>
<p align="left">&nbsp;NotBefore: 01/06/2010 13:51</p>
<span style="font-family:Times New Roman;font-size:medium;"> </span>
<p align="left">&nbsp;NotAfter: 01/06/2030 13:59</p>
<span style="font-family:Times New Roman;font-size:medium;"> </span>
<p align="left">Subject: CN=Contoso Root CA,OU=Contoso,O=Lab,C=GB</p>
<span style="font-family:Times New Roman;font-size:medium;"> </span>
<p align="left">CA Version: V0.0</p>
<span style="font-family:Times New Roman;font-size:medium;"> </span>
<p align="left">Signature matches Public Key</p>
<span style="font-family:Times New Roman;font-size:medium;"> </span>
<p align="left">Template:</p>
<span style="font-family:Times New Roman;font-size:medium;"> </span>
<p align="left">Cert Hash(sha1): 45 f5 f9 e5 db 75 87 d2 ba e1 67 05 16 bb 00 d9 62 92 ed a2</p>
<span style="font-family:Times New Roman;font-size:medium;"> </span>
<p align="left">&nbsp; Key Container = Contoso Issuing CA</p>
<span style="font-family:Times New Roman;font-size:medium;"> </span>
<p align="left">&nbsp; Provider = ncipher security world key storage provider</p>
<span style="font-family:Times New Roman;font-size:medium;"> </span>
<p align="left">Private key is NOT exportable</p>
<span style="font-family:Times New Roman;font-size:medium;"> </span>
<p align="left">Signature test passed</p>
<span style="font-family:Times New Roman;font-size:medium;"> </span>
<p>CertUtil: -repairstore command completed successfully.</p>
<span style="font-family:Times New Roman;font-size:medium;"> </span></div>
<p><span style="font-family:Segoe UI Light;font-size:medium;">&nbsp;</span></p>
<p><span style="font-family:Segoe UI Light;font-size:medium;">Note you will need to replace the CSP section with the CSP of the HSM manufacturer and the CA certificate serial number with the serial number of the CA certificate you are restoring. </span></p>
<ol><ol>
<li>
<p>Once the certificate and private key have been restored by either importing the PFX file locally on the server or by using the HSM you should be able to see the certificate in the local machine store with the private key symbol as shown in the following screenshot:</p>
<p></p>
</li>
</ol>
<li>
<p>If you are running on a 2012 upwards CA you can now install the Active Directory Certificate Services role before we perform the configuration. If you are on a lower level operating system then just install the role as normal and configure the installation as per the instructions in the next step.</p>
</li>
<li>
<p>Now we can perform a recovery installation of the CA following these steps, note the screenshots are from a 2012 R2 server but the options are the same across any CA version:</p>
<ol>
<li>
<p>Select <b>Enterprise CA </b>or <b>Standalone CA </b>depending on which CA you are restoring.</p>
<p></p>
</li>
<li>
<p>Select <b>Root CA </b>&nbsp;or <b>Subordinate CA</b> depending on which CA you are restoring:</p>
<p></p>
</li>
<li>
<p>Select <b>Use existing private key</b> and then the <b>Select a certificate and use its associated private key </b>option:</p>
<p></p>
</li>
<li>
<p>The certificate you imported earlier should be listed in the <b>Certificates </b>dialog box, ensure this is selected and click <b>Next</b></p>
<p><i>Note: If you are using a HSM there may be a need to check the &ldquo;Allow administrator interaction&hellip;&rdquo; check box. Ensure this setting is configured if required by the HSM vendor.</i></p>
<p></p>
</li>
<li>
<p>Configure you database and log location, this can be the same as before:</p>
<p></p>
</li>
<li>
<p>Observe the confirmation of the settings and click <b>Configure</b> (or <b>Install</b> on a non-2012 server):</p>
<p></p>
</li>
<li>
<p>Click <b>Close </b>to finish the configuration:</p>
<p></p>
</li>
</ol></li>
<li>
<p>Once the CA role has been installed and configured the CA database can be restored, this can be done through the CA GUI or via the command line by running the following commands:</p>
<p>&nbsp;</p>
</li>
</ol>
<div><span style="font-family:Times New Roman;font-size:medium;"> </span><ol>
<li>net stop certsvc</li>
<li>certutil -restoredb -f e:\CA-Backup\1</li>
<li>net start certsvc</li>
</ol><span style="font-family:Times New Roman;font-size:medium;"> </span><span style="font-family:Times New Roman;font-size:medium;"> </span><span style="font-family:Times New Roman;font-size:medium;"> </span></div>
<p><span style="font-family:Segoe UI Light;font-size:medium;">&nbsp;</span></p>
<p><span style="font-family:Segoe UI Light;font-size:medium;">Note that the restore path above will be correct based on the sample script that is detailed above. Also note the &ndash;f parameter to force overwrite the existing database created during the install.</span></p>
<ol>
<li>
<p>Now the CA server, private key and database have all been restored the original install script can be re-run to configure the CA. This will ensure the correct CDP and AIA paths are configured and CRL lifetimes as per the original install. If you are in doubt of the original config then the CA registry export in the backup folder can be used to rebuild the configuration of the CA. Any other configuration should now be applied to the server such as permissions on the CA, certificate managers etc.</p>
</li>
<li>
<p>All certificate templates which were previously published to the CA should be re-published. The list of these templates will be in the ca-templates.txt file located in the backup folder.</p>
</li>
<li>
<p>Any scheduled tasks should also be configured for the monitoring of the CA and copying og the CRL as per the original install.</p>
</li>
<li>
<p>The CA will now be fully operational and should be validated to ensure it is functioning correctly. You can test a certificate enrolment and revocation and then publication of the CRL to ensure this is working.</p>
</li>
<li>
<p>The last thing to do is to replay any certificates into the database that have been issued since the last backup. As we touched on earlier we can get the details of the certificates by filtering the inbox where the SMTP exit module sends the emails to. This should be filtered to only show emails which have been received between the last backup date and the current time. We can then look at all emails which contain details of the issued certificates. The following screenshot shows a sample of this from my lab:</p>
<p></p>
<p>As you can see, the email contains certificate details but pay particular attention to the base64 encoded certificate, which can be taken and pasted into notepad to re-construct the whole certificate. Follow these steps to replay the certificates to the database:</p>
<ol>
<li>
<p>Save the base64 encoded certificates from each of the emails to a *cer file in a folder on the CA. You should have a .cer file for every certificate you wish to restore.</p>
</li>
<li>
<p>Before we can replay any certificates into the database we need to configure the CA to allow this by running the following command:</p>
<p>&nbsp;</p>
</li>
</ol></li>
</ol>
<div><span style="font-family:Times New Roman;font-size:medium;"> </span>
<p>certutil -setreg ca\KRAFlags +KRAF_ENABLEFOREIGN</p>
<span style="font-family:Times New Roman;font-size:medium;"> </span></div>
<p><span style="font-family:Segoe UI Light;font-size:medium;">&nbsp;</span></p>
<ol><ol>
<li>
<p>Run the following command to add the certificate into the database:</p>
<p>&nbsp;</p>
</li>
</ol></ol>
<div><span style="font-family:Times New Roman;font-size:medium;"> </span>
<p>certutil -f &ndash;importcert &lt;certificate file&gt;</p>
<span style="font-family:Times New Roman;font-size:medium;"> </span></div>
<p><span style="font-family:Segoe UI Light;font-size:medium;">&nbsp;</span></p>
<p><span style="font-family:Segoe UI Light;font-size:medium;">Where &lt;certificate file&gt; is one of the saved files. You could script this so it loops through all of the certificates in the folder one by one and adds them to the database if you have many.</span></p>
<p><span style="font-family:Segoe UI Light;"><span style="font-size:medium;">Once all of the above steps have been completed your CA should be fully recovered and up to date with all issued certificates. The above procedure can also be adapted to migrate a Certificate Authority to another server, say during an upgrade to a newer platform, the concept is essentially the same. There are a few differences in the exact steps the full details of which can be found <a href="http://technet.microsoft.com/en-us/library/ee126170(v=ws.10).aspx"><span style="color:#0563c1;">here</span></a>. The process can also be used to recover the CA to a test environment for validating your disaster recovery plans and backups.</span></span></p>
<p><b><span style="font-family:Segoe UI Light;font-size:medium;">Manual CRL Resign</span></b></p>
<p><span style="font-family:Segoe UI Light;font-size:medium;">As you can see from the steps above a full CA recovery can be a lengthy process, particularly if you have not been alerted to its failure in a reasonable time frame. As we mentioned earlier this may mean that the CA cannot be recovered before the CRL is due to expire which would have dire consequences to any applications or services relying on that CA&rsquo;s certificates. To mitigate this a manual re-sign of the CRL can be done to extend the validity of the CRL for a short time period while the full recovery above is performed. The following steps go through a manual CRL resign:</span></p>
<ol>
<li>
<p>Log on to a server in your environment, preferably another CA, or you could use an up to date client operating system such as Windows 8.</p>
</li>
<li>
<p>Obtain a copy of the private key and make available on the machine, as detailed above this may be restoring the PFX file if not using a HSM or by configuring the HSM (which is why another CA is preferred) and restoring the private key using the HSM manufacturer&rsquo;s instructions. I won&rsquo;t go into the details of this as they are above in the Full CA Recovery section, but you should have the CA certificate and private key installed with the certificate showing the private key symbol as seen in the screenshot further above.</p>
</li>
<li>
<p>Obtain the latest CRL from the CDP and copy to a temporary directory on the machine, rename the CRL by adding a &ndash;old after the file name.</p>
</li>
<li>
<p>Extend the CRL lifetime by running the following command:</p>
<p>&nbsp;</p>
</li>
</ol>
<div><span style="font-family:Times New Roman;font-size:medium;"> </span>
<p>certutil &ndash;f &ndash;sign &lt;CRLFileName-old.crl&gt; &lt;CRLFileName.crl&gt; 0:XX</p>
<span style="font-family:Times New Roman;font-size:medium;"> </span></div>
<p><span style="font-family:Segoe UI Light;font-size:medium;">&nbsp;</span></p>
<p><span style="font-family:Segoe UI Light;font-size:medium;">Where 0:XX is the amount of hours you want to add to the CRLs validity, such as 0:48 for adding 48 hours. You can specify which ever time period you desire here, but don&rsquo;t go crazy and only specify a time period long enough to be able to perform a full recovery. It is tempting to add many days here, but remember that the CRL may then potentially get cached at the client side for that period of time and the client may not then retrieve an up to date CRL for that extended period.</span></p>
<p><span style="font-family:Segoe UI Light;font-size:medium;">Also note that the old file is specified first and then the newly signed file. The newly signed file should have the name that is referenced in the CDP.</span></p>
<ol>
<li>
<p>The newly signed CRL should then be published to the CDP, this may include a web CDP and LDAP CDP. For the web CDP, copy the file over to the virtual directory and overwrite the existing file, for the LDAP CDP run the following command:</p>
<p>&nbsp;</p>
</li>
</ol>
<div><span style="font-family:Times New Roman;font-size:medium;"> </span>
<p>certutil &ndash;f &ndash;dspublish &lt;CRLFileName.crl&gt;</p>
<span style="font-family:Times New Roman;font-size:medium;"> </span></div>
<p>&nbsp;</p>
<ol>
<li>
<p>Once the CRL has been published then the CDPs should be checked by using the Enterprise PKI console, you should see the status as <b>OK </b>&nbsp;for all CDPs, similar to the below screenshot:</p>
<p></p>
</li>
</ol>
<p><span style="font-family:Segoe UI Light;font-size:medium;">Another point to make here, although slightly off topic, is that the above certutil command can be used to add entries to the CRL. So if you haven&rsquo;t restored the CA fully or you are having some issues and you need to revoke a certificate in a hurry (maybe an employee has gone rogue?) you can manually add a serial number to the CRL by running the following command:</span></p>
<p><span style="font-family:Segoe UI Light;font-size:medium;">&nbsp;</span></p>
<div><span style="font-family:Times New Roman;font-size:medium;"> </span>
<p>certutil &ndash;f &ndash;sign &lt;CRLFileName-old.crl&gt; &lt;CRLFileName.crl&gt; +&rdquo;&lt;serial number&gt;</p>
<span style="font-family:Times New Roman;font-size:medium;"> </span></div>
<p><span style="font-family:Segoe UI Light;font-size:medium;">&nbsp;</span></p>
<p><span style="font-family:Segoe UI Light;font-size:medium;">Where &lt;serial number&gt; represents the serial number of the certificate you wish to add to the revocation list such as &ldquo;42 00 00 00 05 06 0a 1a 29 6d 40 a1 3e 00 00 00 00 00 05&rdquo;</span></p>
<p><span style="font-family:Segoe UI Light;font-size:medium;">&nbsp;</span></p>
<h2><span style="color:#2e74b5;font-family:Calibri Light;font-size:large;">Loss of Access to Private Key</span></h2>
<p><span style="font-family:Segoe UI Light;font-size:medium;">Let&rsquo;s now imagine a scenario where the CA loses access to its private key only. This could be due to a HSM failure or even accidental deletion of a software based key from the local Crypto folder by an administrator. In this instance the private key should be restored following step 5 in the <b>Full Recovery </b>section above. Once restored the service should be restarted and the CA should then function correctly.</span></p>
<p><span style="font-family:Segoe UI Light;font-size:medium;">&nbsp;</span></p>
<h2><span style="color:#2e74b5;font-family:Calibri Light;font-size:large;">Database corruption or other database issue.</span></h2>
<p><span style="font-family:Segoe UI Light;font-size:medium;">Another scenario that could happen is if there is database corruption for some reason, maybe due to a disk error or something similar. The process for recovery or mitigation is similar to the steps involved for a full recovery. Ultimately a recovery of the CA database will need to be done following steps 8 and 11 above in the <b>Full Recovery </b>section. Once the database has been restored then the service should be started and in theory will be good to go.</span></p>
<p><span style="font-family:Segoe UI Light;font-size:medium;">If it will take some time to recover the database then the procedure for resigning the CRL can be performed to extend the CRL lifetime.</span></p>
<p><span style="font-family:Segoe UI Light;font-size:medium;">&nbsp;</span></p>
<h2><span style="color:#2e74b5;font-family:Calibri Light;font-size:large;">CDP is Unavailable</span></h2>
<p><span style="font-family:Segoe UI Light;"><span style="font-size:medium;">When designing CRL distribution points you should ensure that redundancy is built into the design to cope with any failure at any point in the infrastructure. You should typically have more than one CDP listed and each CDP should be accessible from the clients you wish to serve, e.g. if you are providing services to remote clients then the CDP should be externally accessible. I normally advocate having a web CDP as the first one in the list due to its ubiquity amongst client types, including network devices and other non-Windows clients. This ensure that clients of all flavours will be able to retrieve a CRL from the first CDP in the list. Remember that with PKI the first CDP in the list is tried by the relying party, and if this is unavailable the second CDP is tried using the retry algorithm, this is explained in great detail <a href="http://technet.microsoft.com/en-us/library/ee619730(v=ws.10).aspx"><span style="color:#0563c1;">here</span></a>, although each device type may be different. So, having a web CDP first should minimise timeouts while connecting to the CDP. The downside to using a web CDP is that the server on which it is hosted needs to be redundant using something such as Network Load Balancing, or at a minimum DNS round robin. This adds complexity and potential cost to the web service when it may only be serving files of a few kilobytes. It would be good practice to configure the CDP on another highly available web property that you own which is already configured for load balancing and monitored for up time.</span></span></p>
<p><span style="font-family:Segoe UI Light;"><span style="font-size:medium;">Another area of concern for a web CDP, probably the biggest area for failure, is in the process used for copying the CRL from the CA over to the web server. Generally the CA will be configured to publish the CRL to the local file system and then a scheduled task of some sort used to copy the file over to the server. You can use any mechanism you like here for copying the file, maybe a PowerShell script, a VBScript or a good old batch file using robocopy. The way I like to do this is to create a task attached to Event ID 4872 in the security log. This audit event is generated in the security log when you have CA auditing switched on within the CA console and the &ldquo;Audit Object Access&rdquo; local security setting configured. I highly recommend you configure these settings for your CA. More information on the CA audit events can be found <a href="http://technet.microsoft.com/en-us/library/dd772671(WS.10).aspx"><span style="color:#0563c1;">here</span></a>. The steps for creating this task are listed below:</span></span></p>
<ol>
<li>
<p>Open the security log in event viewer and filter for event ID 4872 as per the following screenshot:</p>
<p></p>
</li>
<li>
<p>In the results select one of the audit events for the CRL publication, right click this and select <b>Attach Task To This Event&hellip;</b></p>
<p></p>
</li>
<li>
<p>Give the task a name and description how you like and click <b>Next.</b></p>
<p></p>
</li>
<li>
<p>Click <b>Next </b>again.</p>
</li>
<li>
<p>Select to <b>Start a program </b>and click <b>Next.</b></p>
<p></p>
</li>
<li>
<p>Select the script you wish to run, again this can be any copy script you desire, and click <b>Next.</b></p>
<p></p>
</li>
<li>
<p>Click <b>Finish</b> to create the task.</p>
</li>
</ol>
<p><span style="font-family:Segoe UI Light;font-size:medium;">Now any time the CA publishes a CRL, either automatically or manually, the copy script will run and push that CRL to the web CDP. This mechanism isn&rsquo;t infallible but generally works quite well. You may wish to add your own monitoring to make sure the script is running, maybe by sending a mail on CRL copy or by writing a log file. This mechanism also has the added bonus that the CRL file on the CDP will always be the latest one instead of waiting for some other arbitrary schedule.</span></p>
<p><span style="font-family:Segoe UI Light;font-size:medium;">The other type of CDP you can configure is LDAP based, where a Microsoft CA will store CRLs in Active Directory. LDAP CDPs may not be supported by all devices, hence my reasoning for adding them second in the list, but they provide redundancy &ldquo;out of the box&rdquo;. By being stored in AD they are replicated to all domain controllers in the forest as they are stored in the configuration partition. AD provides inherent redundancy via its multi-master model but also allows clients to use AD sites to connect to their closet domain controller. A Microsoft CA can also publish its CRL into AD automatically on CRL publication, so no extra scripts or configuration are required.</span></p>
<p><span style="font-family:Segoe UI Light;font-size:medium;">To summarise CDP failure, it is vitally important to ensure you have multiple CDPs configured and that with web CDPs some form of load balancing is implemented. Also, a robust copy mechanism should be used to ensure the web CDP always has the latest CRL available. LDAP CDPs have redundancy and availability by virtue of being stored in AD.</span></p>
<p><span style="font-family:Segoe UI Light;font-size:medium;">&nbsp;</span></p>
<h2><span style="color:#2e74b5;font-family:Calibri Light;font-size:large;">Custom templates removed from directory or lost due to other AD related failure</span></h2>
<p><span style="font-family:Segoe UI Light;"><span style="font-size:medium;">The last disaster recovery point I want to cover is around certificate templates. Imagine that an administrator has accidently deleted all certificate templates from AD or something has gone wrong with AD whereby the templates are unusable. There isn&rsquo;t a built in way to backup and restore those templates apart from using the AD tools. This is a bit heavy handed to just restore the certificate templates. To help with managing this I&rsquo;ve created a PowerShell script which will back up the certificate templates to an XML file which can later be used to re-create all of the certificate templates. The script can be found <a href="https://gallery.technet.microsoft.com/scriptcenter/Certificate-Templatre-f53ecebe"><span style="color:#0563c1;">here</span></a>. This script uses the Certificate Enrolment Web Services and Certificate Enrolment Policy Web Services roles, as the API needed to dump the templates out this way was added with this service. As far as I&rsquo;m aware there isn&rsquo;t any other supported mechanism to dump the certificate template objects out of AD. It should be noted that the CEP and CES services should be installed and you the script needs to be run on the box where this service is. More detail on the script can be found on the script centre posting.</span></span></p>
<p><span style="font-family:Segoe UI Light;font-size:medium;">Once you have a backup of your certificate templates the script can be used to re-create the exported templates within any Active Directory environment. All elements of the exported templates will be re-created apart from security permissions, these will need to be manually re-added.</span></p>
<p><span style="font-family:Segoe UI Light;font-size:medium;">&nbsp;</span></p>
<h1><span style="color:#2e74b5;font-family:Segoe UI Light;">Other Mitigations</span></h1>
<p><span style="font-family:Segoe UI Light;font-size:medium;">Using the backup and restore information above along with the backup matrix you should be well equipped to create your own disaster recovery documentation and approach to recovering you CA infrastructure. However you may still be in a predicament whereby you can&rsquo;t execute a recovery for some reason, maybe all your backups have been lost, stolen or otherwise corrupt. Well there are still options to allowing users, computers and services to carry on functioning when a new CRL cannot be issued. You can switch off certificate revocation checking.</span></p>
<p><b><span style="font-family:Segoe UI Light;font-size:medium;">NOTE: I do not advocate using this approach unless you absolutely have no choice in the matter, as disabling revocation checking is a huge security risk. Follow the below advice at your own risk!</span></b></p>
<p><span style="font-family:Segoe UI Light;font-size:medium;">Revocation checking is down to each individual application and will need to be configured on a per-app basis depending on what application you need to restore functionality too. As an example, if you are using smartcards for logon then you can disable revocation checking at the domain controller to allow user certificates to carry on being validated even when the CRL has expired. As noted, this is a big risk but maybe your only choice. Other applications and services will have their own method for disabling CRL checking and you should look this information up or if need be contact the application vendor if it is a non-Microsoft application, service or device. </span></p>
<p><span style="font-family:Segoe UI Light;font-size:medium;">&nbsp;</span></p>
<h1><span style="color:#2e74b5;font-family:Segoe UI Light;">Summary</span></h1>
<p><span style="font-family:Segoe UI Light;font-size:medium;">To summarise this monster post and close out I&rsquo;d like to leave you with a few key points:</span></p>
<ol>
<li>
<p>Having a robust backup strategy for your PKI is essential and this should be documented. You can use the approach detailed above to help build this out.</p>
</li>
<li>
<p>There is great value in understanding the different disaster scenarios and ensuring you have a restoration strategy for them. Using something like the backup matrix and referencing the particular restore process would be beneficial.</p>
</li>
<li>
<p>There are some techniques you can use to get yourself up and running in an emergency. <span style="text-decoration:line-through;">Re-singing</span> Re-signing the CRL is preferable but as an absolute last resort you can disable revocation checking.</p>
</li>
</ol>
<p><span style="font-family:Times New Roman;font-size:medium;"> </span></p>]]></content:encoded>
    </item>
  </channel>
</rss>