Azure / terraform-azurerm-caf-enterprise-scale

Azure landing zones Terraform module
https://aka.ms/alz/tf
MIT License
785 stars 510 forks source link

Feature Request: Enable Specifying Role Assignment Principal Type #978

Open csmith66 opened 3 weeks ago

csmith66 commented 3 weeks ago

Community Note

Description

I would like have the ability to control the principal_type value set in all of the module's role assignments, whether implicitly or explicitly (preferably).

Example: https://github.com/Azure/terraform-azurerm-caf-enterprise-scale/blob/0783a8a720ed4d950c10006bfa845eb59155f334/resources.role_assignments.tf#L1

Is your feature request related to a problem?

Yes, it is a security best practice to utilize Groups instead of assigning individual Users role assignments. Using this module to define and deploy a policy that enforces this concept by blocking creation of role assignments targeting individual users requires that any future role assignments explicitly set the principal_type. However, this module does not expose any mechanism to pass the principal_type or do any internal checks against Entra to determine the appropriate value to set, effectively breaking the module's capability to manage role assignments.

Describe the solution you'd like

At least one of two mechanisms should be provided:

Additional context