|
1 | 1 | ---
|
2 | 2 | title: Securing managed identities in Azure Active Directory
|
3 |
| -description: Explanation of how to find, assess, and increase the security of managed identities. |
| 3 | +description: Learn to find, assess, and increase the security of managed identities in Azure AD |
4 | 4 | services: active-directory
|
5 |
| -author: janicericketts |
| 5 | +author: jricketts |
6 | 6 | manager: martinco
|
7 | 7 | ms.service: active-directory
|
8 | 8 | ms.workload: identity
|
9 | 9 | ms.subservice: fundamentals
|
10 | 10 | ms.topic: conceptual
|
11 |
| -ms.date: 08/20/2022 |
| 11 | +ms.date: 02/07/2023 |
12 | 12 | ms.author: jricketts
|
13 | 13 | ms.reviewer: ajburnle
|
14 | 14 | ms.custom: it-pro, seodec18, ignite-2022
|
15 | 15 | ms.collection: M365-identity-device-management
|
16 | 16 | ---
|
17 | 17 |
|
18 |
| -# Securing managed identities |
| 18 | +# Securing managed identities in Azure Active Directory |
19 | 19 |
|
20 |
| -Developers are often challenged by the management of secrets and credentials used to secure communication between different services. Managed identities are secure Azure Active Directory (Azure AD) identities created to provide identities for Azure resources. |
| 20 | +In this article, learn about managing secrets and credentials to secure communication between services. Managed identities provide an automatically managed identity in Azure Active Directory (Azure AD). Applications use managed identities to connect to resources that support Azure AD authentication, and to obtain Azure AD tokens, without credentials management. |
21 | 21 |
|
22 |
| -## Benefits of using managed identities for Azure resources |
| 22 | +## Benefits of managed identities |
23 | 23 |
|
24 |
| -The following are benefits of using managed identities: |
| 24 | +Benefits of using managed identities: |
25 | 25 |
|
26 |
| -* You don't need to manage credentials. With managed identities, credentials are fully managed, rotated, and protected by Azure. Identities are automatically provided and deleted with Azure resources. Managed identities enable Azure resources to communicate with all services that support Azure AD authentication. |
| 26 | +* With managed identities, credentials are fully managed, rotated, and protected by Azure. Identities are provided and deleted with Azure resources. Managed identities enable Azure resources to communicate with services that support Azure AD authentication. |
27 | 27 |
|
28 |
| -* No one (including any Global Administrator) has access to the credentials, so they cannot be accidentally leaked by, for example, being included in code. |
| 28 | +* No one, including the Global Administrator, has access to the credentials, which can't be accidentally leaked by being included in code. |
29 | 29 |
|
30 |
| -## When to use managed identities? |
| 30 | +## Using managed identities |
31 | 31 |
|
32 |
| -Managed identities are best used for communications among services that support Azure AD authentication. |
| 32 | +Managed identities are best for communications among services that support Azure AD authentication. A source system requests access to a target service. Any Azure resource can be a source system. For example, an Azure virtual machine (VM), Azure Function instance, and Azure App Services instances support managed identities. |
33 | 33 |
|
34 |
| -A source system requests access to a target service. Any Azure resource can be a source system. For example, an Azure VM, Azure Function instance, and Azure App Services instances support managed identities. |
| 34 | +Learn more in the video, [What can a managed identity be used for?](https://www.youtube.com/embed/5lqayO_oeEo) |
35 | 35 |
|
36 |
| - > [!VIDEO https://www.youtube.com/embed/5lqayO_oeEo] |
| 36 | +### Authentication and authorization |
37 | 37 |
|
38 |
| -### How authentication and authorization work |
| 38 | +With managed identities, the source system obtains a token from Azure AD without owner credential management. Azure manages the credentials. Tokens obtained by the source system are presented to the target system for authentication. |
39 | 39 |
|
40 |
| -With managed identities the source system can obtain a token from Azure AD without the source owner having to manage credentials. Azure manages the credentials. The token obtained by the source system is presented to the target system for authentication. |
| 40 | +The target system authenticates and authorizes the source system to allow access. If the target service supports Azure AD authentication, it accepts an access token issued by Azure AD. |
41 | 41 |
|
42 |
| -The target system needs to authenticate (identify) and authorize the source system before allowing access. When the target service supports Azure AD-based authentication it accepts an access token issued by Azure AD. |
| 42 | +Azure has a control plane and a data plane. You create resources in the control plane, and access them in the data plane. For example, you create an Azure Cosmos DB database in the control plane, but query it in the data plane. |
43 | 43 |
|
44 |
| -Azure has a control plane and a data plane. In the control plane, you create resources, and in the data plane you access them. For example, you create an Azure Cosmos DB database in the control plane, but query it in the data plane. |
| 44 | +After the target system accepts the token for authentication, it supports mechanisms for authorization for its control plane and data plane. |
45 | 45 |
|
46 |
| -Once the target system accepts the token for authentication, it can support different mechanisms for authorization for its control plane and data plane. |
| 46 | +Azure control plane operations are managed by Azure Resource Manager and use Azure role-based access control (Azure RBAC). In the data plane, target systems have authorization mechanisms. Azure Storage supports Azure RBAC on the data plane. For example, applications using Azure App Services can read data from Azure Storage, and applications using Azure Kubernetes Service can read secrets stored in Azure Key Vault. |
47 | 47 |
|
48 |
| -All of Azure’s control plane operations are managed by [Azure Resource Manager](../../azure-resource-manager/management/overview.md) and use [Azure Role Based Access Control](../../role-based-access-control/overview.md). In the data plane,, each target system has its own authorization mechanism. Azure Storage supports Azure RBAC on the data plane. For example, applications using Azure App Services can read data from Azure Storage, and applications using Azure Kubernetes Service can read secrets stored in Azure Key Vault. |
| 48 | +Learn more: |
| 49 | +* [What is Azure Resource Manager?](../../azure-resource-manager/management/overview.md) |
| 50 | +* [What is Azure RBAC?](../../role-based-access-control/overview.md) |
| 51 | +* [Azure control plane and data plane](../../azure-resource-manager/management/control-plane-and-data-plane.md) |
| 52 | +* [Azure services that can use managed identities to access other services](../managed-identities-azure-resources/managed-identities-status.md) |
49 | 53 |
|
50 |
| -For more information about control and data planes, see [Control plane and data plane operations - Azure Resource Manager](../../azure-resource-manager/management/control-plane-and-data-plane.md). |
| 54 | +## System-assigned and user-assigned managed identities |
51 | 55 |
|
52 |
| -All Azure services will eventually support managed identities. For more information, see [Services that support managed identities for Azure resources](../managed-identities-azure-resources/services-support-managed-identities.md). |
| 56 | +There are two types of managed identities, system- and user-assigned. |
53 | 57 |
|
54 |
| -## Types of managed identities |
| 58 | +System-assigned managed identity: |
55 | 59 |
|
56 |
| -There are two types of managed identities—system-assigned and user-assigned. |
| 60 | +* One-to-one relationship with the Azure resource |
| 61 | + * For example, there's a unique managed identity associated with each VM |
| 62 | +* Tied to the Azure resource lifecycle. When the resource is deleted, the managed identity associated with it, is automatically deleted. |
| 63 | +* This action eliminates the risk from orphaned accounts |
57 | 64 |
|
58 |
| -System-assigned managed identity has the following properties: |
| 65 | +User-assigned managed identity |
59 | 66 |
|
60 |
| -* They have 1:1 relationship with the Azure resource. For example, there's a unique managed identity associated with each VM. |
61 |
| - |
62 |
| -* They are tied to the lifecycle of Azure resources. When the resource is deleted, the managed identity associated with it's automatically deleted, eliminating the risk associated with orphaned accounts. |
63 |
| - |
64 |
| -User-assigned managed identities have the following properties: |
65 |
| - |
66 |
| -* The lifecycle of these identities is independent of an Azure resource, and you must manage the lifecycle. When the Azure resource is deleted, the assigned user-assigned managed identity is not automatically deleted for you. |
67 |
| - |
68 |
| -* A single user-assigned managed identity can be assigned to zero or more Azure resources. |
69 |
| - |
70 |
| -* They can be created ahead of time and then assigned to a resource. |
| 67 | +* The lifecycle is independent from an Azure resource. You manage the lifecycle. |
| 68 | + * When the Azure resource is deleted, the assigned user-assigned managed identity isn't automatically deleted |
| 69 | +* Assign user-assigned managed identity to zero or more Azure resources |
| 70 | +* Create an identity ahead of time, and then assigned it to a resource later |
71 | 71 |
|
72 | 72 | ## Find managed identity service principals in Azure AD
|
73 | 73 |
|
74 |
| -There are several ways in which you can find managed identities: |
75 |
| - |
76 |
| -* Using the Enterprise Applications page in the Azure portal |
77 |
| - |
78 |
| -* Using Microsoft Graph |
| 74 | +To find managed identities, you can use: |
79 | 75 |
|
80 |
| -### Using the Azure portal |
| 76 | +* Enterprise applications page in the Azure portal |
| 77 | +* Microsoft Graph |
81 | 78 |
|
82 |
| -1. In Azure Active Directory, select Enterprise applications. |
| 79 | +### The Azure portal |
83 | 80 |
|
84 |
| -2. Select the filter for “Managed Identities” |
| 81 | +1. In the Azure portal, in the left navigation, select **Azure Active Directory**. |
| 82 | +2. In the left navigation, select **Enterprise applications**. |
| 83 | +3. In the **Application type** column, under **Value**, select the down-arrow to select **Managed Identities**. |
85 | 84 |
|
86 |
| -  |
| 85 | +  |
87 | 86 |
|
88 |
| - |
| 87 | +### Microsoft Graph |
89 | 88 |
|
90 |
| -### Using Microsoft Graph |
91 |
| - |
92 |
| -You can get a list of all managed identities in your tenant with the following GET request to Microsoft Graph: |
| 89 | +Use the following GET request to Microsoft Graph to get a list of managed identities in your tenant. |
93 | 90 |
|
94 | 91 | `https://graph.microsoft.com/v1.0/servicePrincipals?$filter=(servicePrincipalType eq 'ManagedIdentity')`
|
95 | 92 |
|
96 |
| -You can filter these requests. For more information, see the Graph documentation for [GET servicePrincipal](/graph/api/serviceprincipal-get). |
| 93 | +You can filter these requests. For more information, see [GET servicePrincipal](/graph/api/serviceprincipal-get?view=graph-rest-1.0&tabs=http&preserve-view=true). |
97 | 94 |
|
98 |
| -## Assess the security of managed identities |
| 95 | +## Assess managed identity security |
99 | 96 |
|
100 |
| -You can assess the security of managed identities in the following ways: |
| 97 | +To assess managed identity security: |
101 | 98 |
|
102 |
| -* Examine privileges and ensure that the least privileged model is selected. Use the following PowerShell cmdlet to get the permissions assigned to your managed identities. |
| 99 | +* Examine privileges to ensure the least-privileged model is selected |
| 100 | + * Use the following PowerShell cmdlet to get the permissions assigned to your managed identities: |
103 | 101 |
|
104 | 102 | `Get-AzureADServicePrincipal | % { Get-AzureADServiceAppRoleAssignment -ObjectId $_ }`
|
105 | 103 |
|
106 |
| - |
107 |
| -* Ensure the managed identity is not part of any privileged groups, such as an administrators group. You can do this by enumerating the members of your highly privileged groups with PowerShell. |
| 104 | +* Ensure the managed identity is not part of a privileged group, such as an administrators group. |
| 105 | + * To enumerate the members of your highly privileged groups with PowerShell: |
108 | 106 |
|
109 | 107 | `Get-AzureADGroupMember -ObjectId <String> [-All <Boolean>] [-Top <Int32>] [<CommonParameters>]`
|
110 | 108 |
|
111 |
| -* [Ensure you know what resources the managed identity is accessing](../../role-based-access-control/role-assignments-list-powershell.md). |
| 109 | +* Confirm what resources the managed identity accesses |
| 110 | + * See, [List Azure role assignments using Azure PowerShell](../../role-based-access-control/role-assignments-list-powershell.md). |
112 | 111 |
|
113 | 112 | ## Move to managed identities
|
114 | 113 |
|
115 |
| -If you are using a service principal or an Azure AD user account, evaluate if you can instead use a managed identity to eliminate the need to protect, rotate, and manage credentials. |
| 114 | +If you're using a service principal or an Azure AD user account, evaluate the use of managed identities. You can eliminate the need to protect, rotate, and manage credentials. |
116 | 115 |
|
117 | 116 | ## Next steps
|
118 | 117 |
|
119 |
| -**For information on creating managed identities, see:** |
120 |
| - |
121 |
| -[Create a user assigned managed identity](../managed-identities-azure-resources/how-to-manage-ua-identity-portal.md). |
122 |
| - |
123 |
| -[Enable a system assigned managed identity during resource creation](../managed-identities-azure-resources/qs-configure-portal-windows-vm.md) |
124 |
| - |
125 |
| -[Enable system assigned managed identity on an existing resource](../managed-identities-azure-resources/qs-configure-portal-windows-vm.md) |
126 |
| - |
127 |
| -**For more information on service accounts see:** |
128 |
| - |
129 |
| -[Introduction to Azure Active Directory service accounts](service-accounts-introduction-azure.md) |
130 |
| - |
131 |
| -[Securing service principals](service-accounts-principal.md) |
| 118 | +* [What are managed identities for Azure resources?](../managed-identities-azure-resources/overview.md) |
| 119 | +* [Configure managed identities for Azure resources on a VM using the Azure portal](../managed-identities-azure-resources/qs-configure-portal-windows-vm.md) |
132 | 120 |
|
133 |
| -[Governing Azure service accounts](service-accounts-governing-azure.md) |
| 121 | +**Service accounts** |
134 | 122 |
|
135 |
| -[Introduction to on-premises service accounts](service-accounts-on-premises.md) |
| 123 | +* [Securing cloud-based service accounts](service-accounts-introduction-azure.md) |
| 124 | +* [Securing service principals](service-accounts-principal.md) |
| 125 | +* [Governing Azure AD service accounts](service-accounts-governing-azure.md) |
| 126 | +* [Securing on-premises service accounts](service-accounts-on-premises.md) |
0 commit comments