AZ_CUSTOM_PRIVILEGED_ROLE

Summary

FSProtect ACL Alias

AZ_CUSTOM_PRIVILEGED_ROLE

Entra ID (Azure AD) Alias

Custom Directory Role (Privileged)

Affected Object Types

Users, Groups, Service Principals

Exploitation Certainty

Certain

Graph Permission / Role

Custom Role with elevated permissions

Description

AZ_CUSTOM_PRIVILEGED_ROLE represents a custom directory role in Microsoft Entra ID (Azure AD) that has been configured with privileged permissions. Unlike built-in roles, custom roles are created by administrators to meet specific organizational needs, but they may inadvertently include dangerous permission combinations.

Why Custom Roles Can Be Dangerous:

  • Permission sprawl: Custom roles may accumulate permissions over time without proper review.

  • Unintended privilege: Administrators may not fully understand the implications of certain permissions.

  • Bypass detection: Security tools may not flag custom roles as privileged.

  • Audit gaps: Custom roles may not be included in standard privilege reviews.

Privileged Permissions to Watch For:

Permission
Risk

microsoft.directory/users/password/update

Reset any user's password

microsoft.directory/groups/members/update

Modify group memberships

microsoft.directory/applications/credentials/update

Add credentials to apps

microsoft.directory/servicePrincipals/credentials/update

Add credentials to SPs

microsoft.directory/roleAssignments/allProperties/allTasks

Manage role assignments

microsoft.directory/users/allProperties/allTasks

Full control over users

microsoft.directory/groups/allProperties/allTasks

Full control over groups

Important: Custom roles can be scoped to Administrative Units, but dangerous permissions remain dangerous regardless of scope.

Identification

1

Find All Custom Roles

2

Identify Custom Roles with Privileged Permissions

3

Find Members of Privileged Custom Roles

Exploitation

An attacker with a privileged custom role can abuse the granted permissions based on what the role includes. The exploitation technique depends on which privileged permissions are assigned to the custom role.

  • Abuse Password Reset Permission If the custom role has microsoft.directory/users/password/update, the attacker can reset any in-scope user's password. For detailed techniques, see AZ_RESET_PASSWORD.

  • Abuse Group Membership Permission If the custom role has microsoft.directory/groups/members/update, the attacker can add themselves or other principals to privileged groups. For detailed techniques, see AZ_MG_ADD_MEMBER.

  • Abuse Application Credentials Permission If the custom role has microsoft.directory/applications/credentials/update, the attacker can add credentials to applications and authenticate as the associated service principal. For detailed techniques, see AZ_ADD_SECRET.

  • Abuse Service Principal Credentials Permission If the custom role has microsoft.directory/servicePrincipals/credentials/update, the attacker can add credentials directly to service principals. For detailed techniques, see AZ_ADD_SECRET.

  • Abuse Role Assignment Permission If the custom role has microsoft.directory/roleAssignments/allProperties/allTasks, the attacker can assign any directory role to themselves or others, including Global Administrator. For detailed techniques, see AZ_MG_GRANT_ROLE.

Mitigation

  • Audit all custom roles and their permissions:

    • Go to Microsoft Entra ID -> Roles and administrators -> Custom roles.

    • Review each custom role's permissions.

  • Apply least privilege: Remove unnecessary privileged permissions from custom roles.

    • Avoid allProperties/allTasks permissions.

    • Use specific actions instead of broad permissions.

  • Regular access reviews for custom role assignments:

    • Go to Identity Governance -> Access Reviews.

    • Review users and service principals with custom role assignments.

  • Document custom roles: Maintain documentation of why each custom role exists and what permissions it requires.

  • Use built-in roles when possible: Prefer built-in roles over custom roles to benefit from Microsoft's security guidance.

  • Monitor custom role changes: Alert on modifications to custom role definitions.

Detection

Detect custom role abuse in Audit logs.

  • Go to Microsoft Entra ID -> Audit logs.

  • Filter by activities:

    • Add custom role definition

    • Update custom role definition

    • Add role assignment

    • Activities matching the permissions in your custom roles

Monitor for:

  • New custom role creation with privileged permissions.

  • Permission additions to existing custom roles.

  • Role assignments to custom roles with privileged permissions.

  • Actions performed by users with privileged custom roles.

References

  • https://learn.microsoft.com/en-us/entra/identity/role-based-access-control/custom-create

  • https://learn.microsoft.com/en-us/entra/identity/role-based-access-control/custom-overview

  • https://learn.microsoft.com/en-us/entra/identity/role-based-access-control/permissions-reference

  • https://learn.microsoft.com/en-us/entra/identity/role-based-access-control/overview

Last updated

Was this helpful?