Katabarwa Labs
← Blog

How to detect when someone changes an Azure custom role definition

Azure security / IAM · August 29, 2026 · 5 min read

A custom role starts life scoped tight: a handful of actions, reviewed once, approved, forgotten. Months later someone edits it to unblock a deployment and adds Microsoft.Authorization/roleAssignments/write. From that moment, everyone holding the role can grant themselves anything, including Owner. No alert fires, the role keeps its innocent name, and the change is invisible until an audit (or an incident) finds it. That is silent permission creep, and Azure has nothing built in that watches for it.

Why Azure cannot tell you this out of the box

The DIY approach: list, classify, diff

Everything you need is in the ARM management plane. The pattern is a scheduled job that lists every custom role, classifies each one, and diffs against the last run:

Post the result to a Teams channel on a schedule and you have a working guardrail. The parts people get wrong are the wildcard expansion, the notActions subtraction, and the drift snapshot, which is exactly where the edge cases live.

A ready-made option: Role Definition Guard

Our tool for this: Role Definition Guard on the Azure Marketplace. It runs as a managed application inside your own subscription, so nothing leaves your tenant.

Role Definition Guard is that pattern packaged, with the edge cases unit-tested. Every Monday at 07:00 UTC it reads every custom role definition at the configured scope, classifies each one with wildcard-aware matching and notActions subtraction, and posts a Teams digest (an Adaptive Card via an Incoming Webhook you provide) of every role that is owner-equivalent or holds a dangerous permission, plus a drift diff against the last run: new dangerous roles and roles whose dangerous-permission set grew are called out specially. "Last changed by" comes from the ARM audit fields. It runs on Reader only and never writes; it inspects and reports, nothing else, and its only egress is to your own Teams webhook.

Key facts

Related reading: just-in-time Azure role elevation without paying for PIM.


Written by the team at Katabarwa Labs. We build small, single-purpose Azure tools that run entirely inside your own tenant. Questions: abaho@llmgraph.ai.