|
1 | 1 | ---
|
2 |
| -title: 'Azure Active Directory Domain Services: Enable kerberos constrained delegation | Microsoft Docs' |
3 |
| -description: Enable kerberos constrained delegation on Azure Active Directory Domain Services managed domains |
| 2 | +title: Kerberos constrained delegation for Azure AD Domain Services | Microsoft Docs |
| 3 | +description: Learn how to enable resource-based Kerberos constrained delegation (KCD) in an Azure Active Directory Domain Services managed domain. |
4 | 4 | services: active-directory-ds
|
5 |
| -documentationcenter: '' |
6 | 5 | author: iainfoulds
|
7 | 6 | manager: daveba
|
8 |
| -editor: curtand |
9 | 7 |
|
10 | 8 | ms.assetid: 938a5fbc-2dd1-4759-bcce-628a6e19ab9d
|
11 | 9 | ms.service: active-directory
|
12 | 10 | ms.subservice: domain-services
|
13 | 11 | ms.workload: identity
|
14 |
| -ms.tgt_pltfrm: na |
15 |
| -ms.devlang: na |
16 | 12 | ms.topic: conceptual
|
17 |
| -ms.date: 05/13/2019 |
| 13 | +ms.date: 09/04/2019 |
18 | 14 | ms.author: iainfou
|
19 | 15 |
|
20 | 16 | ---
|
| 17 | +# Configure Kerberos constrained delegation (KCD) in Azure Active Directory Domain Services |
21 | 18 |
|
22 |
| -# Configure Kerberos constrained delegation (KCD) on a managed domain |
23 |
| -Many applications need to access resources in the context of the user. Active Directory supports a mechanism called Kerberos delegation, which enables this use-case. Further, you can restrict delegation so that only specific resources can be accessed in the context of the user. Azure AD Domain Services managed domains are different from traditional Active Directory domains since they are more securely locked down. |
| 19 | +As you run applications, there may be a need for those applications to access resources in the context of a different user. Active Directory Domain Services (AD DS) supports a mechanism called *Kerberos delegation* that enables this use-case. Kerberos *constrained* delegation (KCD) then builds on this mechanism to define specific resources that can be accessed in the context of the user. Azure Active Directory Domain Services (Azure AD DS) managed domains are more securely locked down that traditional on-premises AD DS environments, so use a more secure *resource-based* KCD. |
24 | 20 |
|
25 |
| -This article shows you how to configure Kerberos constrained delegation on an Azure AD Domain Services managed domain. |
| 21 | +This article shows you how to configure resource-basd Kerberos constrained delegation in an Azure AD DS managed domain. |
26 | 22 |
|
27 |
| -[!INCLUDE [active-directory-ds-prerequisites.md](../../includes/active-directory-ds-prerequisites.md)] |
| 23 | +## Prerequisites |
28 | 24 |
|
29 |
| -## Kerberos constrained delegation (KCD) |
30 |
| -Kerberos delegation enables an account to impersonate another security principal (such as a user) to access resources. Consider a web application that accesses a back-end web API in the context of a user. In this example, the web application (running in the context of a service account or a computer/machine account) impersonates the user when accessing the resource (back-end web API). Kerberos delegation is insecure since it does not restrict the resources the impersonating account can access in the context of the user. |
| 25 | +To complete this article, you need the following resources: |
31 | 26 |
|
32 |
| -Kerberos constrained delegation (KCD) restricts the services/resources to which the specified server can act on the behalf of a user. Traditional KCD requires domain administrator privileges to configure a domain account for a service and it restricts the account to a single domain. |
| 27 | +* An active Azure subscription. |
| 28 | + * If you don’t have an Azure subscription, [create an account](https://azure.microsoft.com/free/?WT.mc_id=A261C142F). |
| 29 | +* An Azure Active Directory tenant associated with your subscription, either synchronized with an on-premises directory or a cloud-only directory. |
| 30 | + * If needed, [create an Azure Active Directory tenant][create-azure-ad-tenant] or [associate an Azure subscription with your account][associate-azure-ad-tenant]. |
| 31 | +* An Azure Active Directory Domain Services managed domain enabled and configured in your Azure AD tenant. |
| 32 | + * If needed, [create and configure an Azure Active Directory Domain Services instance][create-azure-ad-ds-instance]. |
| 33 | +* A Windows Server management VM that is joined to the Azure AD DS managed domain. |
| 34 | + * If needed, complete the tutorial to [create a Windows Server VM and join it to a managed domain][create-join-windows-vm] then [install the AD DS management tools][tutorial-create-management-vm]. |
| 35 | +* A user account that's a member of the *Azure AD DC administrators* group in your Azure AD tenant. |
33 | 36 |
|
34 |
| -Traditional KCD also has a few issues associated with it. In earlier operating systems, if the domain administrator configured account-based KCD for the service, the service administrator had no useful way to know which front-end services delegated to the resource services they owned. And any front-end service that could delegate to a resource service represented a potential attack point. If a server that hosted a front-end service was compromised, and it was configured to delegate to resource services, the resource services could also be compromised. |
| 37 | +## Kerberos constrained delegation overview |
35 | 38 |
|
36 |
| -> [!NOTE] |
37 |
| -> On an Azure AD Domain Services managed domain, you do not have domain administrator privileges. Therefore, **traditional account-based KCD cannot be configured on a managed domain**. Use resource-based KCD as described in this article. This mechanism is also more secure. |
38 |
| -> |
39 |
| -> |
| 39 | +Kerberos delegation lets one account impersonate another account to access resources. For example, a web application that accesses a back-end web component can impersonate itself as a different user account when it makes the back-end connection. Kerberos delegation is insecure as it doesn't limit what resources the impersonating account can access. |
40 | 40 |
|
41 |
| -## Resource-based KCD |
42 |
| -From Windows Server 2012 onwards, service administrators gain the ability to configure constrained delegation for their service. In this model, the back-end service administrator can allow or deny specific front-end services from using KCD. This model is known as **resource-based KCD**. |
| 41 | +Kerberos constrained delegation (KCD) restricts the services or resources that a specified server or application can connect when impersonating another identity. Traditional KCD requires domain administrator privileges to configure a domain account for a service, and it restricts the account to run on a single domain. Traditional KCD also has a few issues. For example, in earlier operating systems, the service administrator had no useful way to know which front-end services delegated to the resource services they owned. Any front-end service that could delegate to a resource service was a potential attack point. If a server that hosted a front-end service configured to delegate to resource services was compromised, the resource services could also be compromised. |
43 | 42 |
|
44 |
| -Resource-based KCD is configured using PowerShell. You use the `Set-ADComputer` or `Set-ADUser` cmdlets, depending on whether the impersonating account is a computer account or a user account/service account. |
| 43 | +In an Azure AD DS managed domain, you don't have domain administrator privileges. As a result, traditional account-based KCD can't be configured in an Azure AD DS a managed domain. Resource-based KCD can instead be used, which is also more secure. |
45 | 44 |
|
46 |
| -### Configure resource-based KCD for a computer account on a managed domain |
47 |
| -Assume you have a web app running on the computer 'contoso-webapp.contoso.com'. It needs to access the resource (a web API running on 'contoso-api.contoso.com') in the context of domain users. Here's how you would set up resource-based KCD for this scenario: |
| 45 | +### Resource-based KCD |
48 | 46 |
|
49 |
| -1. [Create a custom OU](create-ou.md). You can delegate permissions to manage this custom OU to users within the managed domain. |
50 |
| -2. Join both virtual machines (the one running the web app and the one running the web API) to the managed domain. Create these computer accounts within the custom OU. |
51 |
| -3. Now, configure resource-based KCD using the following PowerShell command: |
| 47 | +Windows Server 2012 and later gives service administrators the ability to configure constrained delegation for their service. This model is known as resource-based KCD. With this approach, the back-end service administrator can allow or deny specific front-end services from using KCD. |
52 | 48 |
|
53 |
| -```powershell |
54 |
| -$ImpersonatingAccount = Get-ADComputer -Identity contoso-webapp.contoso.com |
55 |
| -Set-ADComputer contoso-api.contoso.com -PrincipalsAllowedToDelegateToAccount $ImpersonatingAccount |
56 |
| -``` |
| 49 | +Resource-based KCD is configured using PowerShell. You use the [Set-ADComputer][Set-ADComputer] or [Set-ADUser][Set-ADUser] cmdlets, depending on whether the impersonating account is a computer account or a user account / service account. |
57 | 50 |
|
58 |
| -> [!NOTE] |
59 |
| -> The computer accounts for the web app and the web API need to be in a custom OU where you have permissions to configure resource-based KCD. You cannot configure resource-based KCD for a computer account in the built-in 'AAD DC Computers' container. |
60 |
| -> |
| 51 | +## Configure resource-based KCD for a computer account |
61 | 52 |
|
62 |
| -### Configure resource-based KCD for a user account on a managed domain |
63 |
| -Assume you have a web app running as a service account 'appsvc' and it needs to access the resource (a web API running as a service account - 'backendsvc') in the context of domain users. Here's how you would set up resource-based KCD for this scenario. |
| 53 | +In this scenario, let's assume you have a web app that runs on the computer named *contoso-webapp.contoso.com*. The web app needs to access a web API that runs on the computer named *contoso-api.contoso.com* in the context of domain users. Complete the following steps to configure this scenario: |
64 | 54 |
|
65 |
| -1. [Create a custom OU](create-ou.md). You can delegate permissions to manage this custom OU to users within the managed domain. |
66 |
| -2. Join the virtual machine running the backend web API/resource to the managed domain. Create its computer account within the custom OU. |
67 |
| -3. Create the service account (for example, 'appsvc') used to run the web app within the custom OU. |
68 |
| -4. Now, configure resource-based KCD using the following PowerShell command: |
| 55 | +1. [Create a custom OU](create-ou.md). You can delegate permissions to manage this custom OU to users within the Azure AD DS managed domain. |
| 56 | +1. [Domain-join the virtual machines][create-join-windows-vm], both the one that runs the web app, and the one that runs the web API, to the Azure AD DS managed domain. Create these computer accounts in the custom OU from the previous step. |
69 | 57 |
|
70 |
| -```powershell |
71 |
| -$ImpersonatingAccount = Get-ADUser -Identity appsvc |
72 |
| -Set-ADUser backendsvc -PrincipalsAllowedToDelegateToAccount $ImpersonatingAccount |
73 |
| -``` |
| 58 | + > [!NOTE] |
| 59 | + > The computer accounts for the web app and the web API must be in a custom OU where you have permissions to configure resource-based KCD. You can't configure resource-based KCD for a computer account in the built-in *AAD DC Computers* container. |
74 | 60 |
|
75 |
| -> [!NOTE] |
76 |
| -> Both the computer account for the backend web API and the service account need to be in a custom OU where you have permissions to configure resource-based KCD. You cannot configure resource-based KCD for a computer account in the built-in 'AAD DC Computers' container or for user accounts in the built-in 'AAD DC Users' container. Thus, you cannot use user accounts synchronized from Azure AD to set up resource-based KCD. |
77 |
| -> |
| 61 | +1. Finally, configure resource-based KCD using the [Set-ADComputer][Set-ADComputer] PowerShell cmdlet. From your domain-joined management VM and logged in as user account that's a member of the *Azure AD DC administrators* group, run the following cmdlets. Provide your own computer names as needed: |
| 62 | + |
| 63 | + ```powershell |
| 64 | + $ImpersonatingAccount = Get-ADComputer -Identity contoso-webapp.contoso.com |
| 65 | + Set-ADComputer contoso-api.contoso.com -PrincipalsAllowedToDelegateToAccount $ImpersonatingAccount |
| 66 | + ``` |
78 | 67 |
|
79 |
| -## Related Content |
80 |
| -* [Azure AD Domain Services - Getting Started guide](tutorial-create-instance.md) |
81 |
| -* [Kerberos Constrained Delegation Overview](https://technet.microsoft.com/library/jj553400.aspx) |
| 68 | +## Configure resource-based KCD for a user account |
| 69 | +
|
| 70 | +In this scenario, let's assume you have a web app that runs as a service account named *appsvc*. The web app needs to access a web API that runs as a service account named *backendsvc* in the context of domain users. Complete the following steps to configure this scenario: |
| 71 | +
|
| 72 | +1. [Create a custom OU](create-ou.md). You can delegate permissions to manage this custom OU to users within the Azure AD DS managed domain. |
| 73 | +1. [Domain-join the virtual machines][create-join-windows-vm] that run the backend web API/resource to the Azure AD DS managed domain. Create its computer account within the custom OU. |
| 74 | +1. Create the service account (for example, 'appsvc') used to run the web app within the custom OU. |
| 75 | +
|
| 76 | + > [!NOTE] |
| 77 | + > Again, the computer account for the web API VM, and the service account for the web app, must be in a custom OU where you have permissions to configure resource-based KCD. You can't configure resource-based KCD for accounts in the built-in *AAD DC Computers* or *AAD DC Users* containers. This also means that you can't use user accounts synchronized from Azure AD to set up resource-based KCD. You must create and use service accounts specifically created in Azure AD DS. |
| 78 | +
|
| 79 | +1. Finally, configure resource-based KCD using the [Set-ADUser][Set-ADUser] PowerShell cmdlet. From your domain-joined management VM and logged in as user account that's a member of the *Azure AD DC administrators* group, run the following cmdlets. Provide your own service names as needed: |
| 80 | +
|
| 81 | + ```powershell |
| 82 | + $ImpersonatingAccount = Get-ADUser -Identity appsvc |
| 83 | + Set-ADUser backendsvc -PrincipalsAllowedToDelegateToAccount $ImpersonatingAccount |
| 84 | + ``` |
| 85 | +
|
| 86 | +## Next steps |
| 87 | +
|
| 88 | +To learn more about how delegation works in Active Directory Domain Services, see [Kerberos Constrained Delegation Overview][kcd-technet]. |
| 89 | +
|
| 90 | +<!-- INTERNAL LINKS --> |
| 91 | +[create-azure-ad-tenant]: ../active-directory/fundamentals/sign-up-organization.md |
| 92 | +[associate-azure-ad-tenant]: ../active-directory/fundamentals/active-directory-how-subscriptions-associated-directory.md |
| 93 | +[create-azure-ad-ds-instance]: tutorial-create-instance.md |
| 94 | +[create-join-windows-vm]: join-windows-vm.md |
| 95 | +[tutorial-create-management-vm]: tutorial-create-management-vm.md |
| 96 | +[Set-ADComputer]: /powershell/module/addsadministration/set-adcomputer |
| 97 | +[Set-ADUser]: /powershell/module/addsadministration/set-aduser |
| 98 | +
|
| 99 | +<!-- EXTERNAL LINKS --> |
| 100 | +[kcd-technet]: https://technet.microsoft.com/library/jj553400.aspx |
0 commit comments