How the attack works
Azure Policy evaluates resources against definitions that are assigned to a scope, from a management group down to a single resource, and every child resource inherits the assignment. Definitions with the deny or audit effect are guardrails. Definitions with the deployIfNotExists or modify effect act: Microsoft documents that the template deployment or the modification is made with a managed identity associated with the policy assignment, and that identity is granted the roles named in the definition, which can be as broad as Contributor on the whole scope. A remediation task applies the same deployment or modification to resources that already exist.
This gives two kinds of abuse. The first weakens a guardrail: deleting an assignment (Microsoft.Authorization/policyAssignments/delete), creating an exemption for a scope (Microsoft.Authorization/policyExemptions/write), or updating an assignment to exclude scopes, to stop enforcement or to override the effect. The second is privilege escalation. A change to a definition or to an initiative takes effect in every existing assignment of it, so an identity that can only write policy, for example through the Resource Policy Contributor role, decides what the assignment's managed identity deploys with its existing roles. Datadog Security Labs described this path in 2024, with examples such as a policy that turns off Activity log categories and one that deploys a script extension to virtual machines. All of these changes are Azure Resource Manager operations recorded in the Activity log with their caller.
What an attacker needs
- Rights to write Azure Policy objects at the scope: Owner, Resource Policy Contributor or a custom role with
Microsoft.Authorization/policyDefinitions/write,policySetDefinitions/write,policyAssignments/writeorpolicyAssignments/delete. Microsoft states that Resource Policy Contributor includes most Azure Policy operations. - For an exemption:
Microsoft.Authorization/policyExemptions/writeon the scope and theexempt/Actionon the target assignment. - For the escalation: an existing assignment with the
deployIfNotExistsormodifyeffect whose managed identity holds broad roles. Microsoft notes that the Contributor role can trigger a remediation but cannot create or update definitions and assignments.
Impact
A guardrail that the organization relies on, such as a ban on public network access, allowed regions or required diagnostic settings, stops applying to a scope without any change to the resources themselves. Through a changed definition, the managed identity of an assignment deploys or modifies resources across the assignment's scope with the roles it already holds, which can reach every subscription under a management group. The change stays in place and keeps acting on new resources until the definition is restored.
Detection rules
Azure Policy Assignment Deleted or Exemption Created
Detects a successful deletion of an Azure Policy assignment, or a successful create or update of a policy exemption. Deleting an assignment ends its effect for the whole scope, and an exemption takes a resource hierarchy or a single resource out of the evaluation of an assignment. Both switch off a guardrail, such as a deny rule or a required diagnostic setting, for whatever is done next in that scope. The Activity log event names the assignment or the exemption in its resource ID but not the policy it belongs to, so look the object up before you judge the change.
title: Azure Policy Assignment Deleted or Exemption Created
id: 1077b98a-b34a-4589-ab53-83c3fdc56487
status: experimental
description: >-
Detects a successful deletion of an Azure Policy assignment, or a successful
create or update of a policy exemption. Deleting an assignment ends its
effect for the whole scope, and an exemption takes a resource hierarchy or a
single resource out of the evaluation of an assignment. Both switch off a
guardrail, such as a deny rule or a required diagnostic setting, for
whatever is done next in that scope. The Activity log event names the
assignment or the exemption in its resource ID but not the policy it
belongs to, so look the object up before you judge the change.
references:
- https://attack.mitre.org/techniques/T1484/
- https://learn.microsoft.com/en-us/azure/governance/policy/concepts/exemption-structure
- https://learn.microsoft.com/en-us/azure/governance/policy/concepts/assignment-structure
- https://learn.microsoft.com/en-us/azure/role-based-access-control/permissions/management-and-governance
author: Forestall
date: 2026-11-18
tags:
- attack.defense-impairment
- attack.t1484
logsource:
product: azure
service: activitylogs
detection:
selection:
OperationNameValue:
- MICROSOFT.AUTHORIZATION/POLICYASSIGNMENTS/DELETE
- MICROSOFT.AUTHORIZATION/POLICYEXEMPTIONS/WRITE
ActivityStatusValue:
- Success
- Succeeded
condition: selection
falsepositives:
- Planned waivers for single resources and the replacement of an assignment by a newer one. Match each event to a request and check that an exemption has an expiry date.
- Policy-as-code pipelines that delete and recreate assignments. Exclude the pipeline identity in a filter_ selection by Caller once confirmed.
level: medium
False positives
- Planned waivers for single resources and the replacement of an assignment by a newer one. Match each event to a request and check that an exemption has an expiry date.
- Policy-as-code pipelines that delete and recreate assignments. Exclude the pipeline identity in a filter_ selection by Caller once confirmed.
Azure Policy Assignment Created or Updated
Detects a successful create or update of an Azure Policy assignment. A new assignment of a definition with the deployIfNotExists or modify effect puts a managed identity to work on every resource in the scope. An update of an existing assignment can exclude scopes from it (notScopes), stop its enforcement (enforcementMode DoNotEnforce) or override its effect. The Activity log event does not say which of these happened, and assignments are written in normal governance work, so use the rule for review of unexpected callers and for correlation with the other rules on this page, not as an alert on its own.
title: Azure Policy Assignment Created or Updated
id: 71fee61a-9c3c-4077-b805-2de33bee4f63
status: experimental
description: >-
Detects a successful create or update of an Azure Policy assignment. A new
assignment of a definition with the deployIfNotExists or modify effect puts
a managed identity to work on every resource in the scope. An update of an
existing assignment can exclude scopes from it (notScopes), stop its
enforcement (enforcementMode DoNotEnforce) or override its effect. The
Activity log event does not say which of these happened, and assignments are
written in normal governance work, so use the rule for review of unexpected
callers and for correlation with the other rules on this page, not as an
alert on its own.
references:
- https://attack.mitre.org/techniques/T1484/
- https://learn.microsoft.com/en-us/azure/governance/policy/concepts/assignment-structure
- https://learn.microsoft.com/en-us/azure/governance/policy/how-to/remediate-resources
- https://learn.microsoft.com/en-us/azure/role-based-access-control/permissions/management-and-governance
author: Forestall
date: 2026-11-18
tags:
- attack.privilege-escalation
- attack.defense-impairment
- attack.t1484
logsource:
product: azure
service: activitylogs
detection:
selection:
OperationNameValue: MICROSOFT.AUTHORIZATION/POLICYASSIGNMENTS/WRITE
ActivityStatusValue:
- Success
- Succeeded
condition: selection
falsepositives:
- Governance teams, landing zone deployments and policy-as-code pipelines that assign policies. Exclude their identities in a filter_ selection by Caller once confirmed.
level: low
False positives
- Governance teams, landing zone deployments and policy-as-code pipelines that assign policies. Exclude their identities in a filter_ selection by Caller once confirmed.
Azure Policy Definition or Initiative Created or Updated
Detects a successful create or update of a custom Azure Policy definition or initiative (policy set definition), or of a version of one. A change to a definition or to the definitions inside an initiative takes effect in every assignment of it. For the deployIfNotExists and modify effects that means the managed identity of each assignment deploys or changes resources as the new definition says, with the roles that identity already holds. The Activity log event does not contain the rule, the effect or the deployment template, so compare the definition with its previous version.
title: Azure Policy Definition or Initiative Created or Updated
id: 1ab0af38-7638-4b9b-8c0e-2f521d741578
status: experimental
description: >-
Detects a successful create or update of a custom Azure Policy definition or
initiative (policy set definition), or of a version of one. A change to a
definition or to the definitions inside an initiative takes effect in every
assignment of it. For the deployIfNotExists and modify effects that means
the managed identity of each assignment deploys or changes resources as the
new definition says, with the roles that identity already holds. The
Activity log event does not contain the rule, the effect or the deployment
template, so compare the definition with its previous version.
references:
- https://attack.mitre.org/techniques/T1484/
- https://learn.microsoft.com/en-us/azure/governance/policy/how-to/remediate-resources
- https://learn.microsoft.com/en-us/azure/role-based-access-control/permissions/management-and-governance
- https://securitylabs.datadoghq.com/articles/azure-policy-privilege-escalation/
author: Forestall
date: 2026-11-18
tags:
- attack.privilege-escalation
- attack.defense-impairment
- attack.t1484
logsource:
product: azure
service: activitylogs
detection:
selection:
OperationNameValue:
- MICROSOFT.AUTHORIZATION/POLICYDEFINITIONS/WRITE
- MICROSOFT.AUTHORIZATION/POLICYDEFINITIONS/VERSIONS/WRITE
- MICROSOFT.AUTHORIZATION/POLICYSETDEFINITIONS/WRITE
- MICROSOFT.AUTHORIZATION/POLICYSETDEFINITIONS/VERSIONS/WRITE
ActivityStatusValue:
- Success
- Succeeded
condition: selection
falsepositives:
- Governance teams and policy-as-code pipelines that maintain custom definitions and initiatives. Correlate with change records and exclude the pipeline identity in a filter_ selection by Caller.
level: medium
False positives
- Governance teams and policy-as-code pipelines that maintain custom definitions and initiatives. Correlate with change records and exclude the pipeline identity in a filter_ selection by Caller.
Azure Policy Remediation Task Created or Updated
Detects a successful create or update of an Azure Policy remediation task (Microsoft.PolicyInsights/remediations/write). A remediation task applies the deployment template of a deployIfNotExists policy, or the operations of a modify policy, to the existing resources in a scope, and it does so with the managed identity of the policy assignment. After a definition was changed, a remediation task is what pushes the change onto resources that already exist. Microsoft notes that the Contributor role can trigger remediation without being able to change definitions or assignments. Remediation is routine compliance work, so use the rule for review and for correlation with definition and assignment changes.
title: Azure Policy Remediation Task Created or Updated
id: 7ddf8a4e-3d0d-41b1-81d5-3c0edbe7234b
status: experimental
description: >-
Detects a successful create or update of an Azure Policy remediation task
(Microsoft.PolicyInsights/remediations/write). A remediation task applies
the deployment template of a deployIfNotExists policy, or the operations of
a modify policy, to the existing resources in a scope, and it does so with
the managed identity of the policy assignment. After a definition was
changed, a remediation task is what pushes the change onto resources that
already exist. Microsoft notes that the Contributor role can trigger
remediation without being able to change definitions or assignments.
Remediation is routine compliance work, so use the rule for review and for
correlation with definition and assignment changes.
references:
- https://attack.mitre.org/techniques/T1484/
- https://learn.microsoft.com/en-us/azure/governance/policy/how-to/remediate-resources
- https://learn.microsoft.com/en-us/azure/governance/policy/overview
- https://learn.microsoft.com/en-us/azure/role-based-access-control/permissions/management-and-governance
author: Forestall
date: 2026-11-18
tags:
- attack.privilege-escalation
- attack.t1484
logsource:
product: azure
service: activitylogs
detection:
selection:
OperationNameValue: MICROSOFT.POLICYINSIGHTS/REMEDIATIONS/WRITE
ActivityStatusValue:
- Success
- Succeeded
condition: selection
falsepositives:
- Compliance and platform teams that remediate non-compliant resources, by hand or on a schedule. Exclude their identities in a filter_ selection by Caller once confirmed.
level: low
False positives
- Compliance and platform teams that remediate non-compliant resources, by hand or on a schedule. Exclude their identities in a filter_ selection by Caller once confirmed.
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.
Policy definition changed, then a deployIfNotExists action that references it
A changed definition does nothing until Azure Policy acts on it. The Policy category of the Activity log records the deployIfNotExists action together with the definition it came from, so a definition write followed by policy deployments from that definition shows the change being carried out by the assignment's identity.
- In the Administrative category of the Azure Activity log, find a successful
MICROSOFT.AUTHORIZATION/POLICYDEFINITIONS/WRITEorMICROSOFT.AUTHORIZATION/POLICYSETDEFINITIONS/WRITE. Keep theCallerand the definition ID from the resource ID. - In the Policy category, take the events after that time with the operation
MICROSOFT.AUTHORIZATION/POLICIES/DEPLOYIFNOTEXISTS/ACTION. - Read the policy definition ID and the policy assignment ID from the
policiesentry in the event properties, and keep the events that name the changed definition. - List the resources of those events and review the deployments that the assignment's managed identity made on them.
EventsMICROSOFT.AUTHORIZATION/POLICYDEFINITIONS/WRITEMICROSOFT.AUTHORIZATION/POLICYSETDEFINITIONS/WRITEMICROSOFT.AUTHORIZATION/POLICIES/DEPLOYIFNOTEXISTS/ACTION
LimitsA planned definition update produces the same sequence, so it has to be matched with change records. Datadog Security Labs reported that the modify and append effects left no Policy events in its tests, so a definition changed to one of those effects is not seen by the second step.
Policy definition or assignment changed and a remediation task started by the same caller
Existing resources are only touched by a deployIfNotExists or modify policy when a remediation task runs. A caller that writes a definition or an assignment and creates a remediation task shortly after is pushing the change onto every existing resource in the scope, with the assignment's managed identity.
- In the Azure Activity log, a definition, initiative or assignment is written with status Success:
MICROSOFT.AUTHORIZATION/POLICYDEFINITIONS/WRITE,POLICYSETDEFINITIONS/WRITEorPOLICYASSIGNMENTS/WRITE. Keep theCaller. - Within 24 hours the same
Callercreates a remediation task:MICROSOFT.POLICYINSIGHTS/REMEDIATIONS/WRITEwith status Success. - Read the remediation task to learn which assignment and which resources it covers.
EventsMICROSOFT.AUTHORIZATION/POLICYDEFINITIONS/WRITEMICROSOFT.AUTHORIZATION/POLICYASSIGNMENTS/WRITEMICROSOFT.POLICYINSIGHTS/REMEDIATIONS/WRITE
LimitsPlatform teams roll out a new policy and remediate in the same change, so their identities have to be excluded by name. The 24 hours are a starting point. An attacker who lets another identity, or the portal option at assignment time, start the remediation does not match.
Operation denied by policy, then the same caller exempts the scope or deletes the assignment
A deny policy stops a request and the Activity log records that as a Policy event with the status Failed. A caller that is denied and then removes the obstacle itself, by an exemption or by deleting the assignment, is working around the guardrail and not asking for a waiver.
- In the Policy category of the Azure Activity log, find an event with the operation
MICROSOFT.AUTHORIZATION/POLICIES/DENY/ACTION. Keep theCaller, the resource ID and the policy assignment ID from thepoliciesentry in the event properties. - Within 24 hours the same
CallerrunsMICROSOFT.AUTHORIZATION/POLICYEXEMPTIONS/WRITEorMICROSOFT.AUTHORIZATION/POLICYASSIGNMENTS/DELETEwith status Success. - Check that the exemption or the deleted assignment belongs to the assignment ID of the first step, and look for the denied operation succeeding afterwards.
EventsMICROSOFT.AUTHORIZATION/POLICIES/DENY/ACTIONMICROSOFT.AUTHORIZATION/POLICYEXEMPTIONS/WRITEMICROSOFT.AUTHORIZATION/POLICYASSIGNMENTS/DELETE
LimitsAn administrator who is allowed to grant waivers may hit the policy first and then create an approved exemption. It needs the Policy category in the exported Activity log. The 24 hours are a starting point.
Triage
- Identify the Caller and the definition, assignment or exemption from the resource ID of the event, and check for a matching change request or pipeline run.
- For a definition or initiative change, compare the rule, the effect and the deployment template with the previous version, and list the assignments that use it together with the roles of their managed identities.
- For an assignment update, read the current
notScopes,enforcementModeandoverridesof the assignment, because the event does not say which property changed. - For an exemption, read its scope, its category and its
expiresOndate, and find out which assignment it belongs to. - Look for a remediation task and for
deployIfNotExistsactions in the Policy category of the Activity log after the change, and for resource changes by the caller in the scope that lost its guardrail.
Response
Once the attack is confirmed:
- Restore the definition or initiative from source control, create the deleted assignment again and delete the exemptions that were not approved.
- Cancel remediation tasks that were started from the changed definition, and list the deployments they made.
- Contain the caller. Revoke its sessions, rotate its credentials and remove its policy rights until the change is explained.
- Undo what the assignment's managed identity deployed or modified after the change, starting with role assignments, credentials, extensions on virtual machines and logging settings.
- Review what was created or changed in the scope while the guardrail was off, for example resources with public access or resources in regions that are not allowed, and bring it back into compliance.
- Reduce the roles of the managed identities of
deployIfNotExistsandmodifyassignments to what their definitions need.
Mitigation
- Treat Resource Policy Contributor as a privileged role. Limit it and Owner at management group and subscription scope, and assign them through Privileged Identity Management.
- Give the managed identity of each
deployIfNotExistsormodifyassignment the smallest set of roles its definition needs. Microsoft documents that the permissions inroleDefinitionIdsshould be restricted to the smallest possible set. - Manage custom definitions, initiatives, assignments and exemptions from source control with review, so that a change outside the pipeline stands out.
- Give every exemption an expiry date with the
expiresOnproperty and review the list of exemptions regularly. - Send the Azure Activity log of every subscription and management group to your SIEM, including the Policy category.
Frequently asked questions
Why is the right to write Azure Policy a privileged right?
Policies with the deployIfNotExists or modify effect do not act as the person who wrote them. Microsoft documents that the deployment or modification is made with the managed identity of the policy assignment. Whoever can change the definition decides what that identity deploys with the roles it already holds, which are often broader than the roles of the person who edits the policy.
Does the Activity log show what was changed in a policy definition?
No. The event names the operation, the caller and the definition in its resource ID, but not the rule, the effect or the deployment template. Compare the definition with its previous version in source control or in an export. The same holds for an assignment update, where the event does not say whether scopes were excluded, enforcement was stopped or the effect was overridden.
Are the actions of a policy itself visible in the Activity log?
Partly. The Policy category of the Activity log records effect actions, and the operation name follows the effect, for example Microsoft.Authorization/policies/deployIfNotExists/action, with the definition and the assignment in the event properties. Datadog Security Labs reported in 2024 that it found no such events for the modify and append effects. Do not rely on the Policy category alone, and watch the definition and assignment changes themselves.
What is the difference between an exemption and a deleted assignment?
Deleting an assignment ends the policy for its whole scope. An exemption keeps the assignment and takes one resource hierarchy or one resource out of its evaluation, optionally until an expiry date. An exemption is easier to overlook, because the assignment still shows as present. Microsoft requires the exempt action on the assignment in addition to the right to write exemptions.
References
- MITRE ATT&CK T1484: Domain or Tenant Policy Modification
- Remediate non-compliant resources with Azure Policy
- Azure Policy overview
- Azure Policy assignment structure
- Azure Policy exemption structure
- Azure permissions for Management and governance
- Azure built-in roles for Management and governance
- Azure Activity Log event schema
- Datadog Security Labs: Who polices your policies? Azure policy abuse for privilege escalation and persistence