Managing Azure Permissions

Guardrails provides a rich set of capabilities for managing authentication of users, as well as authorization to Azure services and resources. Guardrails integrates with Azure Role-Based Access Control to provide a simple but flexible model for managing access to your Azure subscriptions using Azure Custom Roles.

Permissions policies customize which levels are available to assign permissions, as well as the set of operations that those levels encompass. Refer to the permissions core concepts documentation for more information.

Enabling Azure Permissions

To enable full Azure permissions management through Guardrails with a default configuration, set the Azure > Turbot > Permissions policy to Enforce: Role Mode.

resource "turbot_policy_setting" "azure_permissions" {
  resource        = "id of subscription or parent folder or policy pack"   //highlight-line
  type            = "tmod:@turbot/azure-iam#/policy/types/permissions"
  value           = "Enforce: Role Mode"
}

Standard Levels

The Permissions > Levels policies configure which standard Turbot roles will be created. Levels enabled in this policy appear in the UI and can be assigned to a user in the Turbot console.

This gives you a large degree of control about what rights can be granted in your organization. You can choose to disable levels that don't apply. Example use cases:

Standard permission levels are:

LevelDescription
UserBasic access.
MetadataRead-only access to resource metadata.
ReadOnlyRead access to all resource data.
OperatorOperational permissions but not create/delete.
AdminCreate, modify, and delete resources.
OwnerFull administrative access including IAM management.
SuperUserUnrestricted access. Not applicable to individual services.

Subscription-level permission level policies (Azure/Admin, Azure/Metadata, etc.) can be configured in Azure > Permissions > Levels. By default, all levels are enabled.

Permission level policies for each service are disabled by default, but can be configured in Azure > {service} > Permissions > Levels:

You can use the Azure > Permissions > Levels [Default] policy to configure the default levels for all services. By default, service-level permissions are not enabled.

[!NOTE] Permission levels will not be created if no permissions are actually effective at that level, even if they are enabled by the Permissions > Levels policies. For example, if you enable permissions with all levels enabled (the default configuration), but no services are enabled, only the Azure/SuperUser is created. No other levels have any permissions defined, thus they will not be created. Enabling a service (e.g., Azure > Storage > Enabled) will result in creation of additional levels (Azure/Admin, Azure/Operator, Azure/ReadOnly, etc.) which will then be grantable.

Modifiers

Permission Level Modifiers provide a mechanism to modify the standard permissions policies generated by Turbot. Modifiers work with Turbot's IAM rules engine to modify the access directly in the Turbot custom role definitions.

You can use Modifiers to:

Modifier example use cases:

Modifiers leverage the existing Turbot rules engine to modify the roles that Turbot generates. They do not generate separate roles.

Modifiers can add, remove, and change permissions for any Azure service to any standard permission level. Modifiers effectively redefine (override) the permission level to which an API operation is defined. Permissions defined in the Modifiers policy override the Turbot defaults.

Modifiers are cumulative in the same way that levels are. If you add a permission to the Metadata level, it is also added to ReadOnly, Operator, and Admin.

Modifier policies exist for both provider levels and per-service levels:

To set a subscription-level Modifier, edit the Azure > Turbot > Permissions > Levels > Modifiers policy.

For a service-level modifier, edit the Azure > {service} > Permissions > Levels > Modifiers policy (for example, Azure > Storage > Permissions > Levels > Modifiers).

These policies should contain an array of permission: level assignments:

- "microsoft.sql/locations/longtermretentionbackups/read": "operator"
- "microsoft.sql/locations/longtermretentionbackups/write": "operator"

Alternatively, set the policy with Terraform:

resource "turbot_policy_setting" "azure_permissions_modifiers" {
  resource        = "id of subscription or parent folder or policy pack"   //highlight-line
  type            = "tmod:@turbot/azure-iam#/policy/types/permissionsLevelsModifiers"
  value           =  jsonencode([
                        {"microsoft.sql/locations/longtermretentionbackups/read": "operator"},
                        {"microsoft.sql/locations/longtermretentionbackups/write": "operator"}
                  ])
}

[!NOTE] If multiple service-level policies assign an operation to different levels, the operation will be assigned at the lower permission level in the provider permissions. For example, if microsoft.network/networkwatchers/read is assigned to Azure/Network/Operator and also Azure/NetworkWatcher/User, then it will be assigned to Azure/User.

[!NOTE] If an operation is set to None in a service-level modifier, but another service has the operation defined at that level, it will NOT be removed at the Azure level. For example, if microsoft.network/networkwatchers/delete is assigned to None in the Azure/Network/Admin level, Azure/Admin will still have microsoft.network/networkwatchers/delete because it is allowed for Azure/NetworkWatcher/Admin.

Custom Levels

Custom Levels provide another mechanism for flexibility in managing Azure permissions. Whereas Modifiers allow you to customize the rights granted to Turbot built-in permission levels, Custom Levels allow you to create your own levels that you can use to assign access through the Turbot console.

Custom Level example use cases:

The Custom Levels policy allows you to map your existing IAM roles to Turbot users to provide them access to Azure. The custom roles appear in the UI in the subscription as "grantable" to a user. They are named Azure/Role/{RoleName}, for example Azure/Role/MyCustomRole.

Custom levels can be specified via the Azure > Turbot > Permissions > Custom Levels policy:

- "My Custom Role"
- "My Other Custom Role"

Alternatively, set the policy with Terraform:

resource "turbot_policy_setting"  "azure_permissions_custom_levels" {
  resource        = "id of subscription or parent folder or policy pack"   //highlight-line
  type            = "tmod:@turbot/azure-iam#/policy/types/permissionsCustomLevelsSubscription"
  value           =  jsonencode([
                        "My Custom Role",
                        "My Other Custom Role"
                  ])
}

Troubleshooting

IssueSolution
Permission levels not appearing in UIVerify Azure > Turbot > Permissions is set to Enforce: Role Mode. Ensure at least one service is enabled. Levels are only created when effective permissions exist.
Custom roles not grantableCheck that the custom role name in the policy exactly matches the Azure RBAC role name.
IAM resources not being createdVerify Azure > Turbot > Permissions is not set to Skip or None.
Further assistanceOpen a Support Ticket