Disabling Managed Identities can reduce an organization’s ability to protect itself against configuration faults and credential leaks.
Authenticating via managed identities to an Azure resource solely relies on an API call with a non-secret token. The process is inner to Azure:
secrets used by Azure are not even accessible to end-users.
In typical scenarios without managed identities, the use of credentials can lead to mistakenly leaving them in code bases. In addition,
configuration faults may also happen when storing these values or assigning them permissions.
By transparently taking care of the Azure Active Directory authentication, Managed Identities allow getting rid of day-to-day credentials
management.
Ask Yourself Whether
The resource:
- Needs to authenticate to Azure resources that support Azure Active Directory (AAD).
- Uses a different Access Control system that doesn’t guarantee the same security controls as AAD, or no Access Control system at all.
There is a risk if you answered yes to all of those questions.
Recommended Secure Coding Practices
Enable the Managed Identities capabilities of this Azure resource. If supported, use a System-Assigned managed identity, as:
- It cannot be shared across resources.
- Its life cycle is deeply tied to the life cycle of its Azure resource.
- It provides a unique independent identity.
Alternatively, User-Assigned Managed Identities can also be used but don’t guarantee the properties listed above.
Sensitive Code Example
For Typical identity blocks:
resource "azurerm_api_management" "example" { # Sensitive, the identity block is missing
name = "example"
publisher_name = "company"
}
For connections between Kusto Clusters and Azure Data Factory:
resource "azurerm_data_factory_linked_service_kusto" "example" {
name = "example"
use_managed_identity = false # Sensitive
}
Compliant Solution
For Typical identity blocks:
resource "azurerm_api_management" "example" {
name = "example"
publisher_name = "company"
identity {
type = "SystemAssigned"
}
}
For connections between Kusto Clusters and Azure Data Factory:
resource "azurerm_data_factory_linked_service_kusto" "example" {
name = "example"
use_managed_identity = true
}
See