1. Resources
  2. Detection rules
  3. Custom Microsoft Entra Role Created or Changed

Custom Microsoft Entra Role Created or Changed detection rules

An attacker with the right to manage roles creates a custom Microsoft Entra role, or adds permissions to one that is already assigned, to hold sensitive permissions under a role name that nobody watches.

Platform
Microsoft Entra ID
Severity
High
Log source
Microsoft Entra ID audit logs
Last updated
Rule formats
Sigmaand queries for: SplunkMicrosoft SentinelIBM QRadar
What an attacker needs
The Privileged Role Administrator or Global Administrator role in a tenant that is licensed for Microsoft Entra custom roles.
Impact
Standing privileged access under a role name that is not on any watch list, for example the right to add credentials to application registrations.
Response
Remove the unapproved assignments of the role, take the added permissions out of the definition, and remove credentials the holders added to applications.
Mitigation
Keep the roles that can manage role definitions to a few accounts behind approval, and review the permissions of every custom role regularly.
Audit activities
Add role definitionUpdate role definition

How the attack works

Microsoft Entra ID has built-in roles such as Global Administrator and Application Administrator, and it lets an organization define roles of its own. A custom role is a role definition with a name and a list of permissions, for example microsoft.directory/applications/credentials/update, which allows adding credentials to application registrations. Microsoft states that these are the same permissions the built-in roles use. Creating a definition and assigning it are separate steps, and one definition can be assigned many times, for the whole organization or for a single object such as one app registration.

That makes a custom role a quiet way to hold power. Alerting on privileged access usually looks for the names of built-in roles. A custom role can have any name, and a role called after a support team can carry the permission to add credentials to every application in the tenant. Editing a definition that is already assigned is quieter still, because the access of every holder grows at once and no role assignment is made. Microsoft records the changes in the audit category RoleManagement as Add role definition and Update role definition. Microsoft documents the activity names only, so the rule on this page cannot say which permissions were added.

What an attacker needs

  • The Privileged Role Administrator role, which Microsoft names as the least privileged role that can create and assign Microsoft Entra custom roles, or Global Administrator.
  • A Microsoft Entra ID P1 or P2 license in the tenant, which custom roles require.

Impact

Standing privileged access that does not show up as a privileged role. With a permission to update application credentials, the holder can add a secret to an application and act with everything that application was granted. The role survives a review that only lists the members of the well-known built-in roles.

Detection rules

Custom Microsoft Entra Role Definition Created or Updated

Detects the creation or change of a role definition in Microsoft Entra ID. Microsoft's audit activity reference lists "Add role definition" and "Update role definition" in the category RoleManagement of the Core Directory service and documents their names only. A custom role can carry sensitive permissions, such as updating the credentials of application registrations, under any name, and a change to a definition that is already assigned widens the access of every holder without a role assignment. The record does not list the permissions in a documented field, so the rule matches the activity and the definition has to be read. The actor is in InitiatedBy and the role in TargetResources.

LevelMediumStatusExperimentalLog sourceMicrosoft Entra ID audit logs
title: Custom Microsoft Entra Role Definition Created or Updated
id: 19f55328-70f9-473d-b2a4-fbb8c1a85068
status: experimental
description: >-
  Detects the creation or change of a role definition in Microsoft Entra ID.
  Microsoft's audit activity reference lists "Add role definition" and
  "Update role definition" in the category RoleManagement of the Core
  Directory service and documents their names only. A custom role can carry
  sensitive permissions, such as updating the credentials of application
  registrations, under any name, and a change to a definition that is already
  assigned widens the access of every holder without a role assignment. The
  record does not list the permissions in a documented field, so the rule
  matches the activity and the definition has to be read. The actor is in
  InitiatedBy and the role in TargetResources.
references:
  - https://learn.microsoft.com/en-us/entra/identity/monitoring-health/reference-audit-activities
  - https://learn.microsoft.com/en-us/entra/identity/role-based-access-control/custom-create
  - https://attack.mitre.org/techniques/T1098/003/
author: Forestall
date: 2026-11-18
tags:
  - attack.persistence
  - attack.privilege-escalation
  - attack.t1098.003
logsource:
  product: azure
  service: auditlogs
detection:
  selection:
    Category: RoleManagement
    OperationName:
      - Add role definition
      - Update role definition
  filter_failed:
    Result: failure
  condition: selection and not filter_failed
falsepositives:
  - Planned delegation work, in which identity administrators create or adjust custom roles for support and application teams. This is rare in most tenants, so confirm each event with a change record.
level: medium

False positives

  • Planned delegation work, in which identity administrators create or adjust custom roles for support and application teams. This is rare in most tenants, so confirm each event with a change record.

Detection logic

Patterns that need more than one event, a baseline or knowledge of your own environment. Each is a hypothesis to build and tune in your SIEM, not a ready rule.

Custom role created or changed and then assigned by the same account

Detection hypothesisSequence of events

An administrator who defines a role for a team rarely assigns it in the same breath, and when they do the assignee is the team. An attacker creates or widens the role and assigns it straight away, to an account they control. The definition change followed by an assignment from the same actor is the pattern.

  1. Audit log, category RoleManagement: Add role definition or Update role definition. Take the actor from InitiatedBy and the role from TargetResources.
  2. Within 24 hours, an assignment activity by the same actor, such as Add role assignment to role definition or Add member to role.
  3. Alert when the two events share the actor, and raise the priority when the account that received the role was created recently or is the actor itself.

EventsAdd role definitionUpdate role definitionAdd role assignment to role definitionAdd member to role

LimitsA planned delegation project creates and assigns roles on the same day. The audit record does not say in a documented field which role an assignment refers to, so the two events are tied by actor and time only. The 24 hours are a starting point.

Triage

  • Read InitiatedBy for the actor and TargetResources for the role definition.
  • Open the role definition and read its permissions. The audit record does not list them in a documented field.
  • Look for permissions that update the credentials of applications, grant consent, or manage groups, users and devices beyond what the stated purpose of the role needs.
  • List the assignments of the role and their scope, and check whether an assignment was made by the same actor around the same time.
  • Ask for the change record, and review the sign-in behind the actor's session.

Response

Once the attack is confirmed:

  1. Remove the role's assignments that nobody approved, then remove the added permissions from the definition or delete the role.
  2. Review what the holders of the role did while they held it, such as credentials added to applications and consent granted, and remove those credentials and grants.
  3. Revoke the sessions and reset the credentials of the account that changed the definition, and remove the role that allowed it.
  4. Compare the other custom roles of the tenant with their last known definitions.

Mitigation

  • Keep Privileged Role Administrator and Global Administrator to a few accounts, and require Privileged Identity Management activation with approval for both.
  • Review the custom role definitions of the tenant regularly. List the roles that are not built in and read their permissions, not only their names.
  • Treat a custom role that can update credentials, grant consent or manage group membership as privileged in access reviews and in alerting on role assignments.
  • Assign custom roles for a single app registration where that is enough, instead of for the whole organization.

Frequently asked questions

Does the audit record show which permissions were added to the custom role?

Not in a documented field. Microsoft's audit activity reference lists the activities Add role definition and Update role definition by name only. To see what the role allows, open the role definition in the admin center or read its allowed resource actions through Microsoft Graph, and compare them with the purpose of the role.

Can a custom role hold every permission that Global Administrator has?

No. Microsoft states that custom roles can only include permissions that are enabled for custom use, in the categories app registrations, enterprise applications, consent, devices, users and groups. That still covers sensitive actions, such as updating the credentials of application registrations.

Why is a changed role definition harder to notice than a role assignment?

An assignment names a person and a role, and most monitoring looks for the names of built-in privileged roles. A custom role can have any name. When a definition that is already assigned gets new permissions, every holder gains them at once and no assignment is written at all.

Is there a public incident report for this technique?

No public incident report describes this at the audit event level. The page is based on what Microsoft documents about custom roles: who can create them, which permissions they can hold and how they are assigned.

References

We respect your privacy

We use cookies to keep this site secure and working properly. With your permission, we also use optional cookies to understand usage and improve the experience. Cookie Policy

You can change your choice at any time.