Blog - Title

September, 2009

  • Clarification on upgrading Windows Server 2003 to Windows Server 2008 R2

    Hi, Ned here again. I’ve been assigned to the Platforms beta team here for the past year. One question I’ve gotten a zillion times is which versions of Windows Server 2003 can be upgraded to 2008 R2. Our documentation is rather confusing – working on that – but here’s a quick explanation. I know this isn’t really a Directory Services issues, but I dunno – maybe it’s a DC or something. :-)

    From our TechNet docs:

    Supported Upgrade Scenarios

    From Windows Server 2003 (SP2, R2)Upgrade to Windows Server 2008 R2

    Datacenter

    Datacenter

    Enterprise

    Enterprise, Datacenter

    Standard

    Standard, Enterprise

    Above seems to imply that you must be running Windows Server 2003 R2. This is not the case – as long as the computer is Windows Server 2003 Service Pack 2 (whether or not the R2 product key and CD2 have been installed), you can upgrade. And as you already know, running Windows Server 2003 SP1 is unsupported anyway.

    Here’s my proof:

    1. I built a clean Win 2003 EE x64 SP2 non-R2 VM with a non-R2 product key.
    2. I upgraded with Win 2008 R2 EE x64, no errors or compatibility warnings.
    3. I built a clean Win 2003 EE x64 SP2 R2 VM with an R2 product key.
    4. I upgraded with Win 2008 R2 EE x64, no errors or compatibility warnings.

    Here’s my proof from the setupact.log files that are written into %systemroot%\panther during the upgrade:

    image001

    image002

    Notice how the upgrade doesn’t know, care, or distinguish that one is R2 and one is not. It was just ‘2003 SP2’ to the upgrade code…

    And of course, it must be a 64-bit copy of Win2003. We don’t do upgrades from x86 to x64.

    Update September 21, 2009:  One of our PM's points out that the upgrade will be blocked from Windows Server 2003 if it's in a cluster - no worries though, there are migration steps and a tool documented on TechNet to swing things over to the new nodes.

    - Ned ‘No really, I support DS’ Pyle

  • ADWS has been released for Windows Server 2008 and Windows Server 2003

    Ned here. The beta is over, and the new AD Web Service service introduced in Windows Server 2008 R2 has been released to the world for downlevel OS's. ADWS allows AD PowerShell to connect to domain controllers and do... work. It also allows the new AD Administration Center - which is a kissing cousin of the AD Users and and Computers snap-in - to manage AD objects. If you have only Windows 7 clients with RSAT, or a mix of Win2003, Win2008, and Win 2008 R2 DC's, this download is for you:

    Download Active Directory Management Gateway Service (Active Directory Web Service for Windows Server 2003 and Windows Server 2008)

    For more info on ADAC, take a look here.

    I'll talk more about ADAC and ADWS in the coming weeks, but I figured you'd want this sucker sooner than later.

    - Ned "I'm an AD" Pyle

  • Windows 2008 R2: Managing AD LDS using the AD PowerShell Module

    Hello it’s LaNae again. Now that Windows 2008 R2 is available we get to use the coolness of PowerShell with AD LDS. When you install the AD LDS role on a Windows 2008 R2 server it will also install the AD PowerShell module.

    Unfortunately the documentation in the help files for each cmdlet does not give an example of what the syntax would be for AD LDS. You can find a list of the cmdlets in the “What’s New in AD DS: Active Directory Module for Windows PowerShell” located at

    http://technet.microsoft.com/en-us/library/dd378783(WS.10).aspx

    Active Directory Cmdlets used with AD LDS

    Below you will find a list of Active Directory cmdlets as well as the syntax that can be used to manage AD LDS instances.

    Enable-ADOptionalFeature: Enable an optional feature.

    Example: Enable-ADOptionalFeature “Recycle Bin Feature” –server servername:port –scope ForestorConfigurationSet –target “CN=Configuration,CN={GUID}”

    Get-ADObject: Gets one or more AD LDS objects.

    Example: Get-ADObject -filter ‘objectclass -eq "user"’ -searchbase 'partition DN' -server servername:port - properties DistinguishedName | FT Name, DistinguishedName –A

    image

    Get-ADOrganizationalUnit: Gets one or more AD LDS OUs

    Example: Get-ADOrganizationalUnit -Filter {Name -Like '*'} -searchbase "partition DN" -server 'servername:port' - AuthType Negotiate | FT Name, DistinguishedName –A

    image

    Get-ADUser: Gets one or more AD LDS users

    Example: Get-ADUser -Filter 'Name -like "*"' -searchbase "partition DN” -server 'servername:port'

    image

    Get-ADGroup: Gets one or more AD LDS groups

    Example: Get-ADGroup' -Filter 'Name -like "*"' -searchbase "DN of partition to search" -server 'servername:port'

    image

    Get-ADGroupMember: Gets the members of an AD LDS group

    Example: Get-ADGroupMember -identity 'DN of group' -server 'servername:port' -partition "DN of partition where group resides" | FT Name,DistinguishedName -A

    image

    New-ADGroup: Creates a new AD LDS group

    Example: New-ADGroup -Name "groupname" -server 'servername:port' -GroupCategory Security -GroupScope Global -DisplayName "group display name" -path "DN where new group will reside"

    image

    New-ADUser: Creates a new AD LDS user

    Example: New-ADUser -name "username" -Displayname "Display Name" -server 'servername:port' -path "DN of where the new user will reside"

    image

    ADD-ADGroupMember: Adds an AD LDS user to a group

    Example: Add-ADGroupMember -identity "DN of group" -member "DN of user" -partition "DN of partition where group resides"

    image

    New-ADOrganizationalUnit: Creates a new AD LDS OU

    Example: New-ADOrganizationalUnit -name "OU Name" -server 'servername:port' -path "DN of OU location"

    image

    Remove-ADGroup: Removes an AD LDS group

    Example: Remove-ADGroup 'SID of Group' -server 'servername:portnumber' -partition "partition where group resides"

    image

    Remove-ADGroupMember: Removes an AD LDS user from a group.

    Example: Remove-ADGroupMember -identity "DN of group" -member "DN of user" -server 'servername:port' -partition "DN of partition where group resides"

    image

    Remove-ADOrganizationalUnit: Deletes an OU in AD LDS

    Example: Remove-ADOrganizationalUnit -identity "DN of OU" -recursive -server 'servername:port' -partition "DN of partition where OU resides"

    image

    Remove-ADUser: Deletes a user from AD LDS

    Example: Remove-ADUser -identity "DN of user" -server 'servername:port' -partition "DN of partition where user resides"

    image

    -LaNae Wade

  • Managed Service Accounts: Understanding, Implementing, Best Practices, and Troubleshooting

    Ned here again. One of the more interesting new features of Windows Server 2008 R2 and Windows 7 is Managed Service Accounts. MSA’s allow you to create an account in Active Directory that is tied to a specific computer. That account has its own complex password and is maintained automatically. This means that an MSA can run services on a computer in a secure and easy to maintain manner, while maintaining the capability to connect to network resources as a specific user principal.

    Today I will:

    • Describe how MSA works
    • Explain how to implement MSA’s
    • Cover some limitations of MSA’s
    • Troubleshoot a few common issues with MSA’s

    Let’s be about it.

    How Managed Service Accounts Work

    The Windows Server 2008 R2 AD Schema introduces a new object class called msDS-ManagedServiceAccount. Create an MSA, examine its objectClass attribute, and notice the object has an interesting object class inheritance structure:

    Computer
    msDS-ManagedServiceAccount
    organizationalPerson
    Top
    User

    The object is a user and a computer at the same time, just like a computer account. But it does not have an object class of person like a computer account typically would; instead it has msDS-ManagedServiceAccount. MSA’s inherit from a parent object class of “Computer”, but they are also users. MSA objects do not contain new attributes from the Win2008 R2 schema update.

    And this leads me to how MSA’s handle passwords – it’s pretty clever. An MSA is a quasi-computer object that utilizes the same password update mechanism used by computer objects. So, the MSA account password is updated when the computer updates its password (every 30 days by default). This can be controlled - just like a computer’s password - with the following two DWORD values:

    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\NetLogon\Parameters

    DisablePasswordChange = [0 or 1, default if value name does not exist is 0]
    MaximumPasswordAge = [1-1,000,000 in days, default if value name does not exist is 30]

    MSA’s, like computers, do not observe domain or fine-grained password policies. MSA’s use a complex, automatically generated password (240 bytes, which is 120 characters, and cryptographically random). MSA’s cannot be locked out, and cannot perform interactive logons. Administrators can set an MSA password to a known value, although there’s ordinarily no justifiable reason (and they can be reset on demand; more on this later).

    All Managed Service Accounts are created (by default) in the new CN=Managed Service Accounts, DC=<domain>, DC=<com> container. You can see this by configuring DSA.MSC to show “Advanced Features”:

    image

    image

    As you will see later though, there isn’t much point to looking at this in AD Users and Computers because… wait for it… all your administration will be done through PowerShell. You knew that was coming, didn’t you?

    MSA’s automatically maintain their Kerberos Service Principal Names (SPN), are linked to one computer at a time, and support delegation. A network capture shows a correctly configured MSA using Kerberos:

    image

    image

    Implementing MSA’s

    Forest and OS Requirements

    To use MSAs you must:

    • Use Active Directory
    • Extend your AD schema to Windows Server 2008 R2
    • Host services using MSAs on Windows Server 2008 R2 and Windows 7 computers (MSAs cannot be installed on down-level operating systems)
    • PowerShell, AD PowerShell (part of the RSAT), and the .Net 3.5x framework enabled on any computers using or configuring MSAs

    MSAs do not require a specific Forest Functional Level, but there is a scenario where part of MSA fucntionality requires a Windows Server 2008 Domain Fcuntional Level. This means:

    • If your domain is Windows Server 2008 R2 functional level, automatic passwords and SPN management will work
    • If your domain is less than WIndows Server 2008 R2 Domain Functional Level, automatic passwords will work. Automatic SPN management will not work, and SPN’s will have to be maintained by administrators

    Deployment

    Using a new MSA always works in four steps:

    1. You create the MSA in AD.

    2. You associate the MSA with a computer in AD.

    3. You install the MSA on the computer that was associated.

    4. You configure the service(s) to use the MSA.

    We begin by using PowerShell to create the new MSA in Active Directory. You can run this command on Windows Server 2008 R2 or Windows 7 computer that has the RSAT feature “Active Directory Module for Windows PowerShell” enabled. Perform all commands as an administrator.

    1. Start PowerShell.

    2. Import the AD module with:

    Import-Module ActiveDirectory

    3. Create an MSA with:

    New-ADServiceAccount -Name <some new unique MSA account name> -Enabled $true

    image

    4.    Associate the new MSA with a target computer in Active Directory:

    Add-ADComputerServiceAccount -Identity <the target computer that needs an MSA> -ServiceAccount <the new MSA you created in step 3>

    image

    5. Now logon to the target computer where the MSA is going to be running. Ensure the following features are enabled:

    • Active Directory Module for Windows PowerShell
    • .NET Framework 3.5.1 Feature

    image

    image

    6. Start PowerShell.

    7. Import the AD module with:

    Import-Module ActiveDirectory

    8. Install the MSA with:

    Install-ADServiceAccount -Identity <the new MSA you created in step 3>

    image

    Note: Besides being a local administrator on the computer, the account installing the MSA needs to have permissions to modify the MSA in AD. If a domain admin this "just works"; otherwise, you would need to delegate modify permissions to the service account's AD object. 

    9. Now you can associate the new MSA with your service(s).

    The GUI way:

    a. Start services.msc.

    b. Edit your service properties.

    c. On the Log On tab, set “This Account” to the domain\name$ of your MSA. So if your MSA was called “AskDS” in the “contoso.com” domain, it would be:

    contoso\askds$

    d. Remove all information from Password and Confirm password – they should not contain any data:

    image

    e. Click Apply and Ok to the usual “Logon as a Service Right granted” message:

    image

    f. Start the service. It should run without errors.

    image

    image

    The PowerShell way:

    a. Start PowerShell.

    b. Paste this sample script into a text file:

    # Sample script for setting the MSA password through PowerShell
    # Provided "AS IS" with no warranties, and confers no rights.
    # See
    http://www.microsoft.com/info/cpyright.mspx

    # Edit this section:

    $MSA="contoso\askds$"
    $ServiceName="'testsvc'"

    # Don't edit this section:

    $Password=$null
    $Service=Get-Wmiobject win32_service -filter "name=$ServiceName"
    $InParams = $Service.psbase.getMethodParameters("Change")
    $InParams["StartName"] = $MSA
    $InParams["StartPassword"] = $Password
    $Service.invokeMethod("Change",$InParams,$null)

    c. Modify the highlighted red sections to correctly configure your MSA and service name.

    d. Save the text file as MSA.ps1.

    e. In your PowerShell console, get your script policy with:

    Get-ExecutionPolicy

    image

    f. Set your execution policy to remote signing only:

    Set-ExecutionPolicy remotesigned

    image

    g. Run the script:

    image

    h. Set your execution policy back to whatever you had returned in step E:

    image

    Note: Obviously, I made this example very manual; it could easily be automated completely. That’s the whole point of PowerShell after all. Also, it is ok to shake your fist at us for not having the User and Password capabilities in the V2 PowerShell cmdlet Set-Service. Grrr.

    Removal

    Removing an MSA is a simple two-part process. Now that you know all the PowerShell rigmarole, here are the two things you do:

    1. Use the following PowerShell cmdlet to remove the MSA from a local computer:

    Remove-ADServiceAccount –identity <your MSA name>

    image

    2. Optionally, remove the service account from Active Directory. You can skip this step if you just want to reassign an existing MSA from one computer to another.

    Remove-ADComputerServiceAccount –Identity <the computer the MSA was assigned to previously> -ServiceAccount <the MSA>

    image

    Group Memberships

    The Set-ADServiceAccount and New-ADServiceAccount cmdlets do not allow you to make MSA’s members of groups. To do this you will instead use DSA.MSC or Add-ADGroupMember.

    AD Users and Computers method:

    1. Start DSA.MSC.

    2. Select the group (not the MSA).

    3. Add the MSA through the Members tab:

    image

    PowerShell method:

    1. Start PowerShell.

    2. Run:

    Add-ADGroupMember "<your group>" "<DN of the MSA>"

    So for example:

    image

    Note: Use the distinguished name of the MSA; otherwise Add-ADGroupMember will return “cannot find object with identity”. Don’t try to use NET GROUP as it doesn’t know how to find MSA’s.

    Limitations

    Managed Service Accounts are useful in most service scenarios. There are limits though, and understanding these up front will save you planning time later.

    • MSA’s cannot span multiple computers – An MSA is tied to a specific computer. It cannot be installed on more than one computer at once. In practical terms, this means MSAs cannot be used for:
      • Cluster nodes
      • Authenticated load-balancing using Kerberos for a group of web servers

    The MSA can only exist on one computer at a time; therefore, MSAs are not compatible with cluster fail-over scenarios. And authentication through a load balancer would require you to provide a Kerberos SPN of the MSA account-- that won’t work either. Load balancing scenarios include Microsoft software-based and third-party hardware and software-based load balancing solutions. If you’re clustering or NLB’ing, then you are still going to need to use old fashioned service accounts.

    A key clarification: You can have multiple MSAs installed on a single computer. So if you have an application that uses 5 services, it’s perfectly alright to use one MSA on all five services or five different MSA’s at once.

    • The supportability of an MSA is determined by the component, not Windows – Just because you can configure an MSA on a service doesn’t mean that the folks who make that service support the configuration. So, if the SQL team here says “we don’t support MSA’s on version X”, that’s it. You have to convince them to support their products, not me :-). Some good places to start asking, as we get closer to the general availability of Windows Server 2008 R2 in October:

    TechNet Forums - http://social.technet.microsoft.com/Forums

    MSDN Forums - http://social.msdn.microsoft.com/Forums

    SQL Support Blog - http://blogs.msdn.com/psssql/default.aspx

    Exchange Blog - http://msexchangeteam.com/

    SharePoint Blog - http://blogs.msdn.com/sharepoint/

    Dynamics Blog - https://community.dynamics.com/blogs/

    BizTalk Blog - http://blogs.msdn.com/biztalk_server_team_blog/

    Troubleshooting

    For the most part MSA’s are straightforward and have easily understandable errors. There are a few issues that people seem to run into repeatedly though:

    Error: Error 1069: The service did not start due to a logon failure.

    Cause: Typically caused by the MSA being disabled. Use Set-ADServiceAccount to enable your MSA.

    Error: Duplicate Backlink. The service account 'AskDS2' has backlinks to computer 'CN=2008R2-F-05,CN=Computers,DC=contoso,DC=com'. This add operation will potentially disable service accounts installed on the other computer. Cannot install service account. Error Message: 'Unknown error (0xc000005a)

    Cause: You are trying to associate an MSA with a computer that is already used by another computer. The error notes the server (in this case, 2008r2-f-05) currently using the MSA. Un-associate and uninstall the MSA from the old computer before using it on the new one.

    Error: Add-ADComputerServiceAccount : The object could not be found on the server.

    Cause: You gave an incorrect identity for the MSA and PowerShell cannot find it. Either it’s been deleted or you typed in the wrong name.

    Error: Please enter a valid password.

    Cause: You did not remove the password information in the service’s Logon On properties when editing in services.msc. See the setup steps above.

    Error: The account name is invalid or does not exist, or the password is invalid for the account name specified.

    Cause: This is typically caused by not adding the “$” character to the end of the account name used in the Log On tab in the service’s properties in services.msc. Also, this error is caused by simply mistyping the name of the account or forgetting to add the appropriate domain.

    Final Notes and References

    For further reading on Managed Service Accounts, check out:

    And there you go – now go forth and tame your environment.

    - Ned ‘120 characters ought to be enough for anyone’ Pyle

  • Comment problems

    Hi all. After the recent mandate of CAPTCHA for TechNet blogs, we seem to no longer be getting any comments registering here. If you have a question please use our email form until this is ironed out.

    Thanks!

    Ned

  • Windows 2008 R2 Standard Edition supports Version 2 and 3 Templates

    Chris here again. This time I have a quick post. For those looking for reasons to either implement a PKI or potentially upgrade a PKI to Windows Server 2008 R2, the Standard Edition now supports Version 2 and 3 templates. Prior to Windows Server 2008 R2 the Certification Authority role had to be installed on Enterprise or Datacenter edition of the OS to support the use of Version 2 or 3 templates.

    Version 2 templates give you the capability to use Autoenrollment, custom certificate templates, and key archival.

    Version 3 templates give the ability to provision Network Service access to the Private Key, as well as support for Suite B algorithms.

    To assist in determining which SKU to use when deploying a certification authority the folks at the Windows PKI Blog have posted a matrix that highlights features by SKU.

    Chris “this is very exciting” Delay

  • New Directory Services KB Articles/Blogs 8/23-8/29

    KB

    972878

    The "Guaranteed service type" Group Policy setting returns to the default value after you restart a client computer that is running Windows XP or Windows Server 2003

    973779

    Some QoS Group Policy settings are not retained after you restart a client computer that is running Windows Vista or Windows Server 2008

    974277

    User profiles cannot be deleted after you configure the "Site to Zone Assignment List" policy by using a non-US domain on a computer that has Internet Explorer 8 installed

    974877

    Description of Remote Server Administration Tools for Windows 7

    Blogs

    Designing and Implementing a PKI: Part I Design and Planning

    Debug 101: !poolused

    DirectAccess Design Guide is now available

    Exploring WMI with PowerShell V2

    AD Admin Center

    Adventures of Exchange 2010 and AdminSDHolder

  • Designing and Implementing a PKI: Part I Design and Planning

    The series:

    Designing and Implementing a PKI: Part I Design and Planning

    Designing and Implementing a PKI: Part II Implementation Phases and Certificate Authority Installation

    Designing and Implementing a PKI: Part III Certificate Templates

    Designing and Implementing a PKI: Part IV Configuring SSL for Web Enrollment and Enabling Key Archival

    Designing and Implementing a PKI: Part V Disaster Recovery

    Chris here again. This is part of a five part series. In Part I, I will cover design considerations, and planning for deploying a PKI. When implementing a PKI planning is the most important phase, and you can prevent a lot of issues by properly planning your PKI implementation.

    I recommend reading the following MSPress books on PKI and Certificate Services before implementing a Windows PKI, or any PKI for that matter. Both books are written by Brian Komar.

    Here is a link to the Windows 2003 Book: http://www.microsoft.com/learning/en/us/Books/6745.aspx

    And a link to the Windows 2008 Book: http://www.microsoft.com/learning/en/us/books/9549.aspx

    They are both excellent resources for anyone implementing, managing, or designing solution that use a Microsoft PKI. And both books go into far more detail then I can here.

    Why Deploy a PKI?

    There are a host of reasons to deploy a PKI; a few are listed here:

    • Control access to the network with 802.1x authentication
    • Approve and authorize applications with Code Signing
    • Protect user data with EFS
    • Secure network traffic IPSec
    • Protect LDAP-based directory queries Secure LDAP
    • Implement two-factor authentication with Smart Cards
    • Protect traffic to internal web-sites with SSL
    • Implement Secure Email

    In addition a number of applications can use certificates in some fashion. Here is a brief list:

    • Active Directory
    • Exchange
    • IIS
    • Internet Security & Acceleration Server
    • Office Communications Server
    • Outlook
    • System Center Configuration Manager
    • Windows Server Update Services

    Another thing to consider is what future applications you may need to support with your PKI. This may not be an answerable question, nor should you be expected to know for sure. In fact some of the applications or technologies that your PKI may be required to support may not have even been conceived of yet. My point here is that your design should incorporate plenty of flexibility. Not only do you want to deploy a PKI solution that supports existing technologies, but one that is scalable, and can support future technologies.

    Costs

    The next thing you want to think about is cost. I understand how difficult it can be to get budgets approved in any business. Despite our wishes as technology professionals that we could implement the appropriate solutions, sometimes we are handicapped by the budget that we have to complete a project. How much money is your business willing to invest in the PKI solution? What are the costs for implementing a PKI? Here are some items that may need to be included in your budget:

    Hardware Costs

    • Servers
    • Hardware Security Modules (HSMs)
    • Backup Devices
    • Backup Media

    Software Costs

    • Windows Server Licenses

    Human Capital

    • Paying someone to design, implement, and manage the PKI infrastructure.

    Cost Savings

    While you are planning your budget, it is important not to forget the cost savings that a Windows PKI solution can provide. The two key areas of savings that I see in a PKI solution are:

    Integration

    Microsoft CA’s, especially Enterprise CAs, have a tight integration with Microsoft products. The integration makes managing and requesting certificates from Microsoft Operating Systems and applications fairly straight forward, to the point that you do not really need any PKI experience to be able to request a certificate.

    Automation

    The greatest advantage of the Windows PKI solution is automation. An Enterprise CA is tightly integrated with Active Directory. Using autoenrollment, a simple group policy can be configured to automate the deployment of certificates to computers and users. The deployment is so transparent, that users do not have to do anything to request a certificate.

    Manageability

    In designing your PKI solution you will have to take into account the resources you have to manage the PKI solution. Day-to-day management for the most part is very limited, but you will need someone to provide the care and feeding of your PKI. You will need someone to issue and revoke certificates. You will need to have someone manage the hardware, apply patches, take backups. In other words, you need a Server Administrator. Also, you will need to have someone that publishes Certificate Revocation Lists and manages the CA itself.

    Security

    You will need to determine the level of security required for your PKI. In order to determine the level of security it is important to step back and understand what a Public Key Infrastructure and the certificates associated with the Public Key Infrastructure can be used for. Certificates can be used for identification, encryption, non-repudiation, and in some cases authentication. In your organization you probably have some standard on how a user receives a user account. When hired there was some form indicating that he/she needs a domain user account and the manager approves this form; in other words, the manager was assuring the identity of the user. Since certificates can be used for identification the same standard should be used when issuing certificates, if they are going to be used for that purpose. If you are using certificates just for encryption, you may be less concerned with the user’s identity. If using the keys from the certificate for encryption, it would depend on what data is being decrypted. If a user is just encrypting his/her recipes you may perhaps not require the same level of protection of the private keys as you would if the user is encrypting top secret government documents. In other words the level of security is going to be determined by the level of risk. This determination should include any corporate security policies for PKI and certificates. When creating your PKI security policy, you should also consider any industry or government regulations.

    Flexibility and Scalability

    The flexibility and scalability of your solution should be taken into consideration. If you have a high level of confidence that you will not need to change or adapt your PKI solution you can have a fairly simple design. However, if you need a solution that will need to support a variety of technologies, different levels of security, and a global presence, then your solution can get much more complicated.

    Physical Design

    When designing your PKI solution you will have to determine the hierarchy that you will use. There are generally three types of hierarchies, and they are denoted by the number of tiers.

    Single/One Tier Hierarchy

    image

    A single tier Hierarchy consists of one CA. The single CA is both a Root CA and an Issuing CA. A Root CA is the term for the trust anchor of the PKI. Any applications, users, or computers that trust the Root CA trust any certificates issued by the CA hierarchy. The Issuing CA is a CA that issues certificates to end entities. For security reasons, these two roles are normally separated. When using a single tier hierarchy they are combined. This may be sufficient for simple implementations where ease of manageability and lower cost outweigh the need for greater levels of security or flexibility. The level of security can be enhanced if the CA’s keys are protected by an HSM, but at the expense of higher equipment and management costs.

    Two Tier Hierarchy

    image

    A two tier hierarchy is a design that meets most company’s needs. In some ways it is a compromise between the One and Three Tier hierarchies. In this design there is a Root CA that is offline, and a subordinate issuing CA that is online. The level of security is increased because the Root CA and Issuing CA roles are separated. But more importantly the Root CA is offline, and so the private key of the Root CA is better protected from compromise. It also increases scalability and flexibility. This is due to the fact that there can be multiple Issuing CA’s that are subordinate to the Root CA. This allows you to have CA’s in different geographical location, as well as with different security levels. Manageability is slightly increased since the Root CA has to be brought online to sign CRL’s. Cost is increased marginally. I say marginally, because all you need is a hard drive and Windows OS license to implement an Offline Root. Install the hard drive, install your OS, build your PKI hierarchy, and then remove the hard drive and store it in a safe. The hard drive can be attached to existing hardware when CRLs need to be re-signed. A virtual machine could be used as the Root CA, although you would still want to store it on a separate hard drive that can be stored in a safe.

    Three Tier Hierarchy

    image

    Specifically the difference between a Two Tier Hierarchy is that second tier is placed between the Root CA and the issuing CA. The placement of this CA can be for a couple different reasons. The first reason would be to use the second tier CA as a Policy CA. In other words the Policy CA is configured to issue certificates to the Issuing CA that is restricted in what type of certificates it issues. The Policy CA can also just be used as an administrative boundary. In other words, you only issue certain certificates from subordinates of the Policy CA, and perform a certain level of verification before issuing certificates, but the policy is only enforced from an administrative not technical perspective.

    The other reason to have the second tier added is so that if you need to revoke a number of CAs due to a key compromise, you can perform it at the Second Tier level, leaving other “branches from the root” available. It should be noted that Second Tier CAs in this hierarchy can, like the Root, be kept offline.

    Following the paradigm, security increases with the addition of a Tier, and flexibility and scalability increase due to the increased design options. On the other hand, manageability increases as there are a larger number of CAs in the hierarchy to manage. And, of course, cost goes up.

    Security

    Private Key Protection

    One of the key aspects of designing a PKI solution is to make sure the proper controls are in place. Security for a PKI solution mostly revolves around protecting the private key pair of the CA. Each CA has a private/public key pair. The private key is used to sign CRL’s as well as certificates that are issued by the CA. Clients and application verify the signature so that they can be assured that a certificate was issued by a particular CA. If you install a Microsoft CA, the private key is protected by software, or more specifically the Data Protection API (DPAPI). Although this method does provide protection it does not prevent a user that is a member of the Administrators group on the CA from accessing the private key. This can be a cause for concern, because you may have administrators whose job is just to patch the system, and yet they have access to the private key which violates the concept of least privilege.

    There are generally two methods for protecting the private key of a CA. The first method is to keep the CA offline and the hard drive stored in a safe. By controlling the conditions the hard drive can be used, the opportunities for key compromise are reduced. The second method is to use a hardware device to protect the private key. For example, a smartcard can be used to store the private key of the CA. This is not the best solution since the smart card must remain in the reader attached to the CA in order to be used. Also, a smart card may not be as resilient, or provide the level of security that is required. It is however a low cost solution. A more standard solution is to use a Hardware Security Module (HSM). HSM’s are fairly expensive, but are normally certified for FIPS compliance -- a standardized measure of relative security. HSM’s are accepted as the most secure way to protect the private key for a CA.

    Role Separation

    Aside from private key protection you will most likely want to have some control as to the level of administrative access to a CA. In some cases you may have administrators that are responsible for performing every function on the CA. But in larger or higher security environments you will want to have some granular control over what access different role holders have. Below is a list of common roles on a CA:

    • CA or PKI Administrator whose role is to manage the CA itself.
    • Certificate Manager who issues and revokes certificates.
    • Enrollment Agent is typically a role used in conjunction with smart cards; an Enrollment Agent enrolls for a certificate on behalf of another user.
    • Key Recovery Manager if using key archival. If you are using key archival, the Key Recovery Manager is responsible for recovering private keys. Also, if you are using EFS an EFS Recovery Agent role may be created to recover data encrypted using EFS.

    In addition to these roles that have direct interaction with the CA, you also will have ancillary roles that support the CA. These include:

    • Backup Operator who is responsible for backing up the CA and restoring data in case of failure.
    • Auditor who is responsible for reviewing audit logs and ensuring policy is not being violated.

    Physical Security

    Certificates issued by CAs are used in many cases for very sensitive operations such as establishment of identity, authentication and encryption. As such, it is important to not only protect the private key but to protect physical access. Law #3 of the Ten Immutable Laws of Security, states: “If a bad guy has unrestricted physical access to your computer, it's not your computer anymore.” For this reason you will want to protect physical access to the CAs. This will depend on the resources you have available, but typically in larger organizations the CAs are stored in a locked cage in a data center. Only individuals that need physical access to the CA to perform their duties should be given access.

    Policy

    Generally the security requirements, such as those mentioned above, are dictated by a corporate security policy. A security policy usually takes into consideration regulatory and industry requirements as well as unique requirements for the individual company. The policy may also specify technical aspects of the PKI such as the encryption algorithms that must be used as well as operation of the Certificate Authorities.

    In addition to security policies there may be CA-specific policies that need to be developed before implementing the PKI. These include Certificate Policy and Certification Practice Statement. The Certificate Policy explains what methods are used to establish the identity of a subject before issuing a certificate. A Certification Practice Statement outlines the operation of the PKI from a security perspective. Many companies, especially third parties companies that issue certificates, have their Certificate Policies and Certification Practice Statements available publicly. It may be helpful to view one of these public documents when writing your own policy documents.

    Additional Security Considerations

    In addition to the topics discussed it is important to apply any relevant security patches to your online CAs and to install them in a timely manner. In addition to patches, you should have an anti-malware solution installed on your CA.

    So far we have covered reasons to deploy a Public Key Infrastructure. We also have covered the various costs involved in a PKI infrastructure, as well as the impact of various design considerations. Now we will dive a little deeper into specific configuration decisions and technical aspects of the Certificate Authorities.

    CA Configuration

    Certificate Validity Period

    Digital certificates have a lifetime, a start date and an end date for which they are considered valid. You should determine what values for this lifetime are appropriate for each CA certificate and end-entity certificate issued by your CA’s. For CA’s, this lifetime is set when the CA is installed and when the private key is renewed. For end-entity certificates there are a number of factors taken into account:

    • These include the validity period for the issuing CA. The CA will not issue certificates that are valid past the CA’s lifetime.
    • The validity period specified in the Certificate Template.
    • The value of this registry key, specified in this KB article: http://support.microsoft.com/kb/254632

    The certificate issued will be configured with the validity period that is the shortest of these items.

    Key Length

    The length of a key definitely affects security of information protected with that key. Thus, you will need to determine the key lengths you will use with each key pair. First you will need to determine the key lengths that will be used for each of the CA key pairs. Additionally, you will need to determine the key lengths for any certificates issued by the issuing CA. The key lengths for the CA certificates are determined by the key size requested when the CA is installed and when the key pair is renewed. The key length at installation is set during the CA Setup process. The key length for renewal is determined by a value set in the CAPolicy.inf configuration file installed on the CA.

    For certificates issued by the issuing CA the maximum key size is limited by the CSP that is being used. The specific key size that is required can be specified in the certificate request or in the Certificate Template if using an Enterprise CA. As a general guideline, the longer the lifetime of the certificate the longer the key length should be. For applications that will be using certificates you will need to determine the maximum key length they support. Some applications have limitation on the key size not only in the actual certificate it is using, but also for any certificates in the CA hierarchy. From a security standpoint it is recommend that 4096 bit key is used for Certification Authorities key pair. However, if you wanted to insure maximum compatibility with network devices and applications a 2048 bit key would be the better choice.

    AIA Locations

    When a client or application is validating a certificate it needs to not only validate the certificate that is being used but also the entire chain of the certificate. In other words, the application or client needs a certificate from each CA in the chain beginning with the issuing CA and ending with the Root CA. If the application or client does not have access to the certificates in the chain locally the application or client needs a place from which to obtain the certificates. This location is called the Authority Information Access or AIA. The AIA location is the repository where the CA certificate is stored so that it can be downloaded by clients or applications validating a certificate. The AIA location is included in the AIA extension of a certificate. Before implementing your PKI it is important to think about what types of clients will be validating the certificates and where they reside. If you are using Windows clients that are internal to your network and are domain members then LDAP locations in Active Directory are a good place for clients to access the AIA repository. If you have non-Windows clients or Windows clients that are not domain members that are internal then an internally hosted web site would be the ideal location for the AIA repository. However, if clients may need to validate a certificate when outside the network, then you will need an AIA repository that is available externally, perhaps on the public network.

    CDP Locations

    A CRL Distribution Point (CDP) is where clients or applications that are validating a certificate download the certificate revocation list (CRL) to obtain revocation status. CA’s periodically publish CRLs to allow clients and applications to determine if a certificate has been revoked. CRLs contain the serial number of the certificate that has been revoked, a timestamp indicating when the certificate was revoked, as well as the reason for revocation. Similar to AIA Locations, you need to keep in mind what types of clients you are supporting and where they are located.

    CRL Validity and Overlap Periods

    Like certificates, CRLs have a start date and an end date denoting a period for which they are valid. As such, you will need to consider what the CRL lifetime should be for each CA. In general, the CRL lifetime is proportional to the number of certificates the CA is expected to issue. Offline CA’s that issue relatively few certificates, and those only to other CAs, would tend to have CRLs with a more extended lifetime, for example, six months to a year. This reflects the fact that, in a properly managed PKI, an offline CA would rarely revoke a certificate. Issuing CAs, on the other hand, can be expected to issue large numbers of certificates to end-entities. It is quite common to revoke an end-entity certificate for any number of reasons, so the lifetime of an issuing CA’s CRL can be quite short; a few days or even hours.

    Another thing to consider is the overlap period. The overlap period is a short time interval beyond the expiration date of the CRL, and reflects the period between when a new CRL is published, and when the old CRL actually expires. During this time both CRLs are valid. This allows time for the new CRL to replicate to all of the repositories before the old CRL expires.

    Delta CRLs

    Delta CRLs are CRLs that contain revocation information for certificates that have been revoked since the base CRL was last published. For example, you have a Certificate A and it is revoked. The CA then publishes a new Base CRL that includes the revocation information for Certificate A. Shortly thereafter, Certificate B is revoked. At the designated interval a Delta CRL is published which contains the serial number and reason for revocation for Certificate B. When a client needs to determine revocation status Certificates A or B it downloads both the base CRL and the Delta CRL. The client determines that Certificate A is revoked from the base CRL, and then determines that Certificate B is revoked from the Delta CRL.

    The reason for Delta CRLs is due to limitations with base CRLs. Base CRLs can grow rather large over time as they contain the serial number and revocation reason for every valid certificate that has been revoked from a CA. Instead of publishing a large CRL over and over again, revocation status can be updated with the smaller Delta CRL. In this way clients that have a time valid CRL will just need to download the Delta CRL. Like base CRLs you will need to determine how often Delta CRLs are published. It should be noted that the use of Delta CRLs is completely optional and is not normally used with offline CAs for obvious reasons.

    OCSP URIs

    Windows Vista, Windows 7, Windows 2008 and Windows 2008 R2 can obtain revocation information from an Online Responder via the Online Certificate Status Protocol. If you are using an Online Responder to provide revocation status, you should include the URI that points to the Online Responder.

    Microsoft PKI

    Other than the benefits of the Windows PKI, most of the things I have mentioned so far apply to any Public Key Infrastructure. I am now going to focus on a Microsoft-specific implementation.

    Operating System Version

    Currently both Windows 2003 and Windows 2008 are supported so you need to determine which OS you’re going to use for your CAs. In order to make that decision you will need to know what additional features Windows Server 2008 has over Windows Server 2003. Here are a few of the many new features in Windows Server 2008:

    Windows Server 2008 R2

    Windows Server 2008 R2 adds a number of new features to Certificate Services. These features include:

    • Cross-Forest enrollment- Windows 2008 R2 Supports Cross-Forest enrollment which will allow a CA or multiple CAs in one forest to support clients in multiple Forests.
    • Certificate Enrollment Web Service and Policy Service- Allows clients to enroll for certificates over web interfaces. This new capability allows clients to retrieve certificates even if they are not located on the same physical network as Active Directory and the CA. Clients query the Enrollment Policy Service, to determine which Certificates they should enroll for, the Enrollment Policy Service contacts Active Directory and responds to the client with CA and Certificate Template information. The client then queries the Enrollment Web Service, to enroll for certificates. The Enrollment Web Service than contacts the CA on behalf of the client, and returns the enrolled certificates back to the client.
    • Non-persistent certificates (not stored in the CA database) - Certificate Templates can be configured to not store certificates in the CA database. The is useful for CAs that issue certificates for network authentication, in which certificates have a lifetime of hours or days and the storage of the certificates in the database would impact CA performance unnecessarily.

    Operating System Edition

    There are three editions of the OS on which you can install the Certificate Authority role. Those editions are Standard, Enterprise, and Datacenter. Standard or Enterprise Editions are normally used.

    Below are the key features that Enterprise and Datacenter Edition supports and Standard Edition does not. It is important to note that Datacenter Edition does not offer any additional functionality in terms of Certificate Services over Enterprise Edition.

    • Version 2 Templates
    • The ability to duplicate and modify Certificate Templates
    • Certificate Autoenrollment (requires version 2 templates)
    • Common Criteria Role Separation enforcement
    • Key Archival and Retrieval

    Certificate Authority Type

    Next, you need to consider what type of Windows CA is required. A Standalone CA does not require Active Directory and can be installed on a non-domain member server. Requests for certificate enrollment can be sent through Web Enrollment if installed, or by sending a request file to the CA. The request files are usually generated through the Certreq.exe tool. Also, in Windows Server 2008 and Vista you can use the Certificate Management Console to build custom requests.

    An Enterprise CA is integrated with Active Directory and requires AD in order to function. The Enterprise CA supports the same enrollment methods as the Standalone CA. In addition, however, an Enterprise can receive requests submitted through the Certificates MMC console. An Enterprise CA also allows for computer or user Autoenrollment which allows certificate request and issuance to be automated through a Group Policy setting. Enterprise CAs also use certificate templates which allow define what types of certificates a user or computer request from the CA.

    Additionally, PKI related configuration information is stored in Active Directory. This makes it easy for applications and clients to locate an issuing CA, associated Certificate Templates, CRL’s and AIA information.

    Certificate Templates

    Certificate Templates allow you to create a template from which the values in the certificate request are generated. When a user requests a certificate based on a Certificate Template, the request generated by the client is built based upon the configuration of the template. Certificate templates are key to Autoenrollment, since Autoenrollment requires certificate templates. The importance of certificate templates is that it reduces management cost, and makes the CA easier to use. This is due to the fact that the user does not have to use complicated methods such as using certreq.exe and the associated configuration file to generate requests. Certificate Templates are stored in Active Directory and replicated to all domain controllers in the forest. This makes them highly available in order to support all clients in the forest.

    For more information about Certificate Templates, please visit the following URLs:

    Enrollment

    Another important aspect to consider is how clients will enroll for certificates. There are several methods to enroll for certificates and the actual method you choose may vary. But for the majority of customers most enrollments will be done through Autoenrollment. For one off situations and testing enrollment, manual enrollment or Web Enrollment will typically be used. Beginning with Windows 2008 there is Network Device Enrollment Service that can be used for network devices to enroll.

    Autoenrollment

    Autoenrollment adds a high level of automation to certificate issuance. In order to deploy Autoenrollment, you must first configure a certificate template from which clients will generate their requests. You then need to enable a Group Policy setting that enables Autoenrollment. Once you enable autoenrollment the computer or user, depending on what template is configured will automatically request a certificate based on the template after Group Policy refreshes.

    For more information about Autoenrollment, please visit the following URLs:

    Manual Enrollment

    There are several different methods for manual enrollment. The first method is to use the Certificates Management Console to enroll for certificates directly. The second method is to use the Certificate Management Console to generate a request file that can later be submitted to the Certification Authority. Third, a tool called certreq.exe can be used to create requests that can later be submitted to the CA. Certreq.exe can also be used to submit the request to the CA and also to download, and install the resulting certificate.

    Web Enrollment

    Web Enrollment is a web page that can be used to submit requests and download issued certificates from a CA. Web enrollment has typically been used to generate custom requests. However, with the ability to create custom requests in Windows Vista and Windows 2008 there is less of a need to use Web Enrollment

    Application Specific Enrollment

    Many Microsoft applications, such as Internet Information Services and Office Communication Server have built in wizards that assist with enrolling for certificates that are used by those applications.

    Network Device Enrollment Service (NDES)

    NDES is a role that uses the SCEP protocol to allow network devices to enroll for certificates.

    Additional Considerations

    Key Archival and Retrieval

    Key Archival is a feature that allows the CA to archive the private key associated with a certificate in its database. A Key Recovery Manager can than recover the private key for a certificate if required. Although separate from Key Archival, an EFS Recovery Agent can be configured to recover EFS encrypted files.

    For more information about Key Archival and Retrieval, please visit the following URLs:

    Active Directory and Group Policy

    Aside from Autoenrollment, Active Directory and Group Policy allow the configuration of PKI related settings for clients. This includes EFS-related configuration, automatically publishing Root CA certificates to the Trusted Root Certification Store on clients, revocation checking configuration, and more…

    For more information about PKI-related Group Policy settings, please visit the following URL:

    Configure Public Key Group Policy: http://technet.microsoft.com/en-us/library/cc962057.aspx

    Conclusion

    I attempted to cover many aspects of the PKI implementation you will need to consider before deploying a Public Key Infrastructure. There is a great deal of information out there. As I mentioned before I would strongly recommend reading the Brian Komar books. I would also invite you to review PKI related posts on the Ask Directory Services Team Blog:

    http://blogs.technet.com/askds/archive/tags/PKI/default.aspx

    and the Windows PKI Blog:

    http://blogs.technet.com/pki/default.aspx

    As well as the Best Practices for Implementing a Microsoft Windows Server 2003 Public Key Infrastructure, which is located at:

    http://www.microsoft.com/downloads/details.aspx?familyid=0BC67F4E-4FCF-4717-89E8-D0EE5E23A242&displaylang=en.

    And the Windows Server 2003 PKI Operations Guide that can be downloaded from:

    http://www.microsoft.com/downloads/details.aspx?FamilyID=8e25369f-bc5a-4083-a42d-436bdb363e7e&DisplayLang=en .

    - Chris “two-fer” Delay